Get the FREE Ultimate OpenClaw Setup Guide →

macfig

npx machina-cli add skill lu-zhengda/macos-toolkit/macfig --openclaw
Files (1)
SKILL.md
4.1 KB

macfig — macOS Defaults Manager

Browse macOS hidden defaults:

!macfig list $ARGUMENTS 2>&1 || echo "macfig not installed — brew install lu-zhengda/tap/macfig"

Analyze the output above. If showing categories, explain what each controls. If showing settings, explain each and its current value. Offer to change settings or apply presets. Always recommend macfig backup before changes.

Commands

CommandPurposeExample
macfig listList preset categoriesmacfig list
macfig list <category>Show settings in category with current valuesmacfig list dock
macfig get <domain> <key>Read a specific defaults valuemacfig get com.apple.dock autohide
macfig set <domain> <key> <value>Write a defaults valuemacfig set com.apple.dock autohide true
macfig preset <name>Apply a named preset bundlemacfig preset dev-setup
macfig backupBackup all tracked settings to JSONmacfig backup
macfig restore <file>Restore from backup filemacfig restore ~/.config/macfig/backup.json
macfig reset <domain> <key>Delete a key (restore macOS default)macfig reset com.apple.dock autohide
macfig search <query>Search keys across all domainsmacfig search animation
macfig diff <backup>Compare current state against a backupmacfig diff ~/.config/macfig/backup.json
macfig export [file]Export all tracked defaults to JSONmacfig export defaults.json
macfig import <file>Import and apply defaults from JSONmacfig import defaults.json
macfig watch <domain> <key>Monitor a defaults key for changesmacfig watch com.apple.dock autohide

Diff and Migration

Compare current settings against a backup to see what changed:

macfig backup
# ... make changes ...
macfig diff ~/.config/macfig/backup.json

Export and import defaults for machine migration:

# Export from old machine
macfig export my-defaults.json

# Import on new machine
macfig import my-defaults.json

Watch Mode

Monitor a specific defaults key for live changes:

macfig watch com.apple.dock autohide

Useful for debugging preference changes made by apps or System Settings.

JSON Output

Add --json to any read command for machine-readable output:

macfig list --json
macfig list dock --json
macfig get com.apple.dock autohide --json
macfig search animation --json
macfig diff backup.json --json
macfig export --json

Built-in Presets

PresetEffect
dock-speedFaster Dock animations and autohide delay
finder-devShow hidden files, extensions, path bar, status bar
keyboard-fastFaster key repeat rate and shorter delay
no-animationsDisable most macOS animations
privacyDisable analytics, Siri suggestions, ad tracking
dev-setupCombined developer-friendly defaults

Safety Guidelines

  • Always backup first: Run macfig backup before applying presets or bulk changes
  • Use presets over raw set: Presets handle type inference and process restart automatically
  • Use search to discover: Run macfig search <term> instead of guessing domain/key pairs
  • Revert with restore: If something breaks, macfig restore <backup-file> reverts all changes
  • Diff before import: Run macfig diff to preview changes before applying an import

TUI Mode

Launch macfig without arguments for interactive mode — browse categories, toggle settings, and preview changes.

Source

git clone https://github.com/lu-zhengda/macos-toolkit/blob/main/skills/macfig/SKILL.mdView on GitHub

Overview

macfig is a macOS defaults manager to read, write, backup, and apply system preferences. It exposes commands to list, get, set, export, import, diff from backups, and apply built-in presets for common configurations.

How This Skill Works

macfig tracks a set of domains and keys and provides a CLI to read (get/list), write (set), and reset values. It supports backup and restore to JSON, diffing current state against backups, exporting/importing for migration, and applying presets that bundle multiple changes. It also offers watch mode to monitor specific preference keys in real time.

When to Use It

  • You want to adjust Dock behavior, such as speed or autohide, using presets or direct set commands.
  • You need to reveal Finder hidden files or tweak Finder-related preferences.
  • You are backing up macOS defaults, exporting/importing them for migration, or diffing changes against a backup.
  • You prefer using built-in presets (e.g., dock-speed, finder-dev, dev-setup) over manual key-by-key changes.
  • You want to monitor or audit preference changes in real time with watch.

Quick Start

  1. Step 1: macfig backup
  2. Step 2: macfig list dock to review current values
  3. Step 3: macfig preset dock-speed

Best Practices

  • Always run macfig backup before applying changes.
  • Prefer presets over manual set when suitable to ensure proper typing and required restarts.
  • Use macfig get to verify the exact value after a change.
  • Use macfig diff to see what changed compared with a backup.
  • If something goes wrong, revert with macfig restore <backup-file> or reset keys as needed.

Example Use Cases

  • Backup current settings, then apply the 'dock-speed' preset to speed up Dock animations.
  • Enable Finder dev options with the 'finder-dev' preset to show hidden files and additional UI elements.
  • Export all tracked defaults to defaults.json for seamless migration to a new Mac.
  • Diff current settings against backup.json to audit unintended changes.
  • Watch the autohide key for com.apple.dock to debug app-initiated changes.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers