{"id":39099910,"url":"https://github.com/dsully/macos-defaults","last_synced_at":"2026-01-17T19:03:18.952Z","repository":{"id":177459666,"uuid":"659848040","full_name":"dsully/macos-defaults","owner":"dsully","description":"A tool for managing macOS defaults declaratively via YAML files.","archived":false,"fork":false,"pushed_at":"2025-11-08T16:34:09.000Z","size":111,"stargazers_count":62,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-08T18:16:25.233Z","etag":null,"topics":["command-line-utilities","defaults","macos","macos-setup","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsully.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-28T17:35:34.000Z","updated_at":"2025-11-08T16:34:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"9adb4d1b-4632-4e43-a438-1134181cda5c","html_url":"https://github.com/dsully/macos-defaults","commit_stats":null,"previous_names":["dsully/macos-defaults"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dsully/macos-defaults","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fmacos-defaults","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fmacos-defaults/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fmacos-defaults/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fmacos-defaults/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsully","download_url":"https://codeload.github.com/dsully/macos-defaults/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsully%2Fmacos-defaults/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28516540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-utilities","defaults","macos","macos-setup","rust"],"created_at":"2026-01-17T19:03:18.289Z","updated_at":"2026-01-17T19:03:18.943Z","avatar_url":"https://github.com/dsully.png","language":"Rust","readme":"# macos-defaults\n\nA tool for managing macOS defaults declaratively via YAML files.\n\n## Install\n\n### Homebrew\n\n```shell\nbrew install dsully/tap/macos-defaults\n```\n\n### Source\n\n```shell\ncargo install --git https://github.com/dsully/macos-defaults\n```\n\n## Usage\n\n### Dump a defaults domain to YAML\n\n```shell\n# To stdout:\nmacos-defaults dump -d com.apple.Dock\n\n# To a file:\nmacos-defaults dump -d com.apple.Dock dock.yaml\n\n# Global domain\nmacos-defaults dump -g\n```\n\n### Apply defaults from a YAML file\n\n```shell\n# From a single YAML file:\nmacos-defaults apply dock.yaml\n\n# From a directory with YAML files \u0026 debug logging:\nmacos-defaults apply -vvv ~/.config/macos-defaults/\n```\n\n### Generate shell completions\n\n```shell\nmacos-defaults completions [bash|fish|zsh] \u003e ~/.config/fish/completions/macos-defaults.fish\n```\n\nSee `macos-defaults --help` for more details.\n\n## YAML Format\n\n```yaml\n---\n# This will be printed to stdout.\ndescription: Contacts\n\n# Use the currentHost hardware UUID to find the correct plist file.\n# https://apple.stackexchange.com/questions/353528/what-is-currenthost-for-in-defaults\ncurrent_host: false\n\n# Send a SIGTERM to one or more processes if any defaults were changed.\nkill: [\"Contacts\", \"cfprefsd\"]\n\n# A nested map of plist domains to key/value pairs to set.\ndata:\n  # Show first name\n  # 1 = before last name\n  # 2 = after last name\n  NSGlobalDomain:\n    NSPersonNameDefaultDisplayNameOrder: 1\n\n  # Sort by\n  com.apple.AddressBook:\n    ABNameSortingFormat: \"sortingFirstName sortingLastName\"\n\n    # vCard format\n    # false = 3.0\n    # true = 2.1\n    ABUse21vCardFormat: false\n\n    # Enable private me vCard\n    ABPrivateVCardFieldsEnabled: false\n\n    # Export notes in vCards\n    ABIncludeNotesInVCard: true\n\n    # Export photos in vCards\n    ABIncludePhotosInVCard: true\n---\n# Multiple yaml docs in single file.\ndescription: Dock\n\nkill: [\"Dock\"]\n\ndata:\n  # Automatically hide and show the Dock\n  com.apple.dock:\n    autohide: true\n```\n\nYou may also use full paths to `.plist` files instead of domain names. This is the only way to set values in /Library/Preferences/.\n\n### Overwrite syntax\n\nBy default, the YAML will be merged against existing domains.\n\nFor example, the following config will leave any other keys on `DesktopViewSettings:IconViewSettings` untouched:\n```yaml\ndata:\n  com.apple.finder:\n    DesktopViewSettings:\n      IconViewSettings:\n        labelOnBottom: false # item info on right\n        iconSize: 80.0\n```\n\nThis can be overridden by adding the key `\"!\"` to a dict, which will delete any keys which are not specified. For example, the following config will delete all properties on the com.apple.finder domain except for DesktopViewSettings, and likewise, all properties on `IconViewSettings` except those specified.\n\n```yaml\ndata:\n  com.apple.finder:\n    \"!\": {} # overwrite!\n    DesktopViewSettings:\n      IconViewSettings:\n        \"!\": {} # overwrite!\n        labelOnBottom: false # item info on right\n        iconSize: 80.0\n```\n\nThis feature has the potential to erase important settings, so exercise caution. Running `macos-defaults apply` creates a backup of each modified plist at, for example, `~/Library/Preferences/com.apple.finder.plist.prev`.\n\n### Array merge syntax\n\nIf an array contains the element `\"...\"`, it will be replaced by the contents of the existing array. Arrays are treated like sets, so elements which already exist will not be added.\n\nFor example, the following config:\n\n```yaml\ndata:\n  org.my.test:\n    aDict:\n    };\n        anArray: [\"foo\", \"...\", \"bar\"]\n```\n\n* Prepend `\"foo\"` to `aDict:anArray`, if it doesn't already contain `\"foo\"`.\n* Append `\"bar\"` to `aDict:anArray`, if it doesn't already contain `\"bar\"`.\n\n## Examples\n\nSee my [dotfiles](https://github.com/dsully/dotfiles/tree/main/.data/macos-defaults) repository.\n\n## On YAML\n\n![Yelling At My Laptop](docs/YAML.jpg?raw=true)\n\n[YAML](https://yaml.org) is not a format I prefer, but out of common formats it unfortunately had the most properties I wanted.\n\n* [JSON](https://en.wikipedia.org/wiki/JSON) doesn't have comments and is overly verbose (JSONC/JSON5 is not common)\n\n* [XML](https://en.wikipedia.org/wiki/XML): No.\n\n* [INI](https://en.wikipedia.org/wiki/INI_file) is too limited.\n\n* [TOML](https://toml.io/en/) is overly verbose and is surprisingly not that easy to work with in Rust. Deeply nested maps are poorly handled.\n\n* [KDL](https://kdl.dev) is nice, but document oriented \u0026 needs struct annotations. Derive is implemented in the 3rd party [Knuffle](https://docs.rs/knuffel/latest/knuffel/) crate.\n\n* [RON](https://github.com/ron-rs/ron) is Rust specific, so editor support isn't there.\n\n* [KCL](https://kcl-lang.io), [CUE](https://cuelang.org), [HCL](https://github.com/hashicorp/hcl), too high level \u0026 not appropriate for the task.\n\nSo YAML it is.\n\n## Inspiration\n\nThis tool was heavily inspired by and uses code from [up-rs](https://github.com/gibfahn/up-rs)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsully%2Fmacos-defaults","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsully%2Fmacos-defaults","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsully%2Fmacos-defaults/lists"}