A command-line tool for performing simple edits to configuration files in various formats (TOML, YAML, JSON, Plist).
- Multiple Format Support: Works with TOML, YAML, JSON, and Plist files
- Format Conversion: Read from one format and write to another
- In-place Editing: Modify files directly or output to a different file
- JSON Pointer Support: Use RFC6901 JSON Pointer syntax to reference nested values
Retrieve a value at a specified path:
config-edit -i config.toml get # Get the entire document (omit the path)
config-edit -i config.toml get "" # Also gets the entire document
config-edit -i config.toml get "/server/port" # Get a specific valueSet a value at a specified path (overwrites existing values):
config-edit -i config.toml -w set "/server/port" "8080"
config-edit -i config.toml -w set "/server/host" "\"localhost\"" # For string values, use escaped quotes
config-edit -i config.toml -w set "/server/enabled" "true" # Boolean valuesAppend a value to an array at a specified path:
config-edit -i config.toml -w append "/server/allowed_ips" "\"192.168.1.1\""-i, --input <FILE>: Path to the input file (required)-o, --output <FILE>: Write output to a different file-w, --write: Modify the input file in place--if <FORMAT>: Override input file format detection--of <FORMAT>: Override output file format detection
Supported formats: toml, yaml, json, plist
# Convert TOML to JSON
config-edit -i config.toml -o config.json get
# Convert JSON to YAML
config-edit -i config.json -o config.yaml --of yaml get# Change the server port in a TOML file
config-edit -i config.toml -w set "/server/port" "9000"# Get only the server section from a config file
config-edit -i config.toml get "/server"cargo install config-editgit clone https://github.com/yourusername/config-edit.git
cd config-edit
cargo build --releaseThe binary will be available at target/release/config-edit.
Releases are automatically built for Linux, macOS, and Windows using GitHub Actions when a semantic version tag is pushed. To create a new release:
- Update the version in
Cargo.toml - Commit the changes
- Tag the commit with a semantic version (e.g.,
v1.0.0) - Push the tag to GitHub
git tag v1.0.0
git push origin v1.0.0This will trigger the GitHub Actions workflow to build the binaries and create a release with the binaries attached.