optify-cli-0.1.0 is not a library.
Optify CLI
A command-line tool for inspecting and querying Optify configuration options.
Installation
cargo install optify-cli
Or build from source:
cargo build --release
The binary will be at target/release/optify.
Usage
optify --dir <DIR> [--dir <DIR>...] [--schema <PATH>] <COMMAND>
Output is always compact single-line JSON.
Use jq to pretty-print or further process the output:
optify --dir ./configs get-options myConfig -f A | jq
Global Options
| Option | Description |
|---|---|
-d, --dir <DIR> |
Path to a configuration directory. Repeat to load from multiple directories. |
--schema <PATH> |
Optional path to a JSON schema file for validating configurations. |
list-features
List all available canonical feature names.
optify --dir ./configs list-features
Add --include-aliases to also show aliases:
optify --dir ./configs list-features --include-aliases
get-options <KEY>
Get the options for a specific configuration key, merged across the given features (last feature wins).
optify --dir ./configs get-options myConfig --features A B
Feature names with spaces must be quoted:
optify --dir ./configs get-options myConfig -f "feature with spaces" A
get-all-options
Get the full merged configuration for the given features.
optify --dir ./configs get-all-options --features A B
Examples
# List features in a config directory
optify --dir tests/test_suites/simple/configs list-features
# Get options for the "myConfig" key with feature A active
optify --dir tests/test_suites/simple/configs get-options myConfig -f A
# Get options for the "myConfig" key with features A and B active (B overrides A)
optify --dir tests/test_suites/simple/configs get-options myConfig -f A B
# Pretty-print with jq
optify --dir tests/test_suites/simple/configs get-options myConfig -f A | jq
# Get the full merged configuration for features A and B
optify --dir tests/test_suites/simple/configs get-all-options -f A B
# Load from multiple directories
optify --dir ./base-configs --dir ./override-configs get-options myConfig -f A
Testing
cargo test
Formatting
cargo fmt && cargo clippy --fix --allow-dirty --allow-staged