mdefaults is a tool for Configuration as Code (CaC) for macOS. It allows you to manage macOS configuration settings through code, making it easier to version control and automate configuration changes.
mdefaults.mov
In the terminal
brew tap fumiya-kume/mdefaults
brew install mdefaults
In the .Brewfile
tap "fumiya-kume/mdefaults"
brew "mdefaults"
Place your configuration file in the directory ~/.mdefaults
. This is an example configuration file:
com.apple.dock autohide
com.apple.finder ShowPathbar
Then execute mdefaults pull
(get the current macOS configuration and save it to the file), mdefaults push
(apply the configuration file to macOS).
Pull the current macOS configuration that is written in the configuration file.
mdefaults pull
Apply the configuration settings from the file to macOS.
mdefaults push
Print the configuration file content.
mdefaults config
This command reads the configuration file located in ~/.mdefaults
and prints its contents to the console.
Enable verbose logging to get detailed information about the application's operations. This can be useful for debugging and understanding the application's behavior.
To enable verbose mode, use the --verbose
flag with any command:
mdefaults --verbose pull
This will provide additional log output in the console and write detailed logs to the mdefaults.log
file.
If you encounter any issues, please check the following:
- Ensure the configuration file is correctly formatted.
- Verify that
mdefaults
is installed correctly.
Contributions are welcome! Please fork the repository and submit a pull request.
go install github.com/fumiya-kume/mdefaults