Configuration Resolution
Configuration Resolution
Essential
Understand which value Custy uses when the CLI, project configuration, and application defaults overlap.
Command
CLI → config.toml → defaultCategory
Core Concepts
Quick Command
custy [GLOBAL OPTIONS] COMMAND [OPTIONS]Overview
Custy resolves configurable values in a predictable order. An explicit CLI value wins, the project configuration supplies a reusable value when the CLI does not, and a built-in default is used when neither source provides one.
Resolution Priority
Properties
| Property | Type | Description | Default | Required |
|---|---|---|---|---|
1. Explicit CLI value | Highest priority | A value supplied for the current invocation overrides the corresponding project setting. | - | No |
2. Project configuration | .config/custy/config.toml | The value under [tool.custy] is used when the matching CLI value is unspecified. | - | No |
3. Built-in default | Fallback | The command's default is used when neither the CLI nor configuration supplies a value. | - | No |
How Resolution Works
Value Selection
1
Read the CLI value
Use an explicit value immediately when the command supplied one.
2
Read project configuration
When the CLI value is unspecified, look up the corresponding path under [tool.custy].
3
Apply the built-in default
Use the command's fallback when the configuration path is also absent.
4
Validate the result
A required value that remains unresolved raises a configuration error.
Configuration File Shape
Custy extracts its settings from the [tool.custy] table. Nested configuration
paths become nested TOML tables..config/custy/config.tomltoml[tool.custy.cli.execution]
dry_run = true
[tool.custy.logging]
level = "INFO"
With this configuration, supported commands inherit dry-run behavior and the
INFO log level when the current invocation does not explicitly override
those values.
Missing and Invalid Configuration
- A missing configuration file is treated as an empty project configuration; commands can continue when their remaining values have defaults.
- Invalid TOML or an invalid value is an error and should be corrected rather than silently ignored.
- The configuration object is cached for the lifetime of the Custy process. A new CLI invocation reads the file again.
- An unspecified option normally falls through to configuration. An explicit Boolean choice can remain an intentional CLI override.