Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
🍎 defaults-rs
Open-source interface to a user's defaults on macOS
Key Features
- Read, write, delete, rename, import/export, and inspect preferences.
- Supports user/global/path domains.
- Supports all plist value types (API).
- Pretty-printing and better logging than the original
defaultstool. - Dynamically chooses between XML and binary PLIST data formats.
- Extremely small (<1.5k LOC).
Table of Contents
Installation
Using brew:
Using cargo:
Using mise:
# NOTE: This will compile the binary for your system.
Usage
The CLI command is drs. It closely mimics the original defaults tool.
Read a key (domain or path)
Write a key
Delete a key
Read the whole domain
List all entries in all domains containing word
View / fuzzy-read domains
# disable fuzzy-searching with the -n/--no-fuzzy flag
Use the global domain
Read the type of a key
Rename a key
Import/export a domain
Rust API Usage
In order to use the Rust API for defaults-rs, run this command in your project directory:
Please refer to the API reference for more information about all the available functions.
For examples, check out: examples/
Why defaults-rs
literally a personal take section, but here you go if you wanna listen to some yapping:
defaults-rs was initially made with the necessity of a thin wrapper around the CoreFoundation APIs which are responsible for storing a user's defaults. Now, it also serves as a backend for directly interfering with system preferences in the cutler project.
Contributing
New pull requests and issues are always welcome. Please read the contribution guidelines for more information about certain parts of the codebase and/or how to form a structured pull request.
License
This project has been licensed under the MIT License.