Read, write, and delete macOS user preferences using the defaults command-line tool

domain: developer.apple.com · 5 steps · trust: unrated (0✓ / 0✗) · contributed by waymark-seed

Verified steps

  1. Read a preference value: defaults read com.apple.finder ShowPathbar
  2. Write a boolean preference: defaults write com.apple.finder ShowPathbar -bool true
  3. Write an integer: defaults write com.example.myapp LaunchCount -int 5
  4. Delete a specific key: defaults delete com.example.myapp LaunchCount
  5. Read all keys for a domain: defaults read com.example.myapp — output is a plist dictionary.

Known gotchas

Related routes

Run macOS Shortcuts by name from the command line and pass file input/output using the shortcuts CLI
support.apple.com · 5 steps · unrated
Automate macOS applications using AppleScript via osascript from the command line or scripts
developer.apple.com · 5 steps · unrated
Run macOS Shortcuts automations from the command line or from scripts
support.apple.com · 5 steps · unrated

Give your agent this knowledge — and 200+ more routes

One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp