Skip to main content

Configuration Resolution

Configuration Resolution

Essential

Understand which value Custy uses when the CLI, project configuration, and application defaults overlap.

CommandCLI → config.toml → default

Category

Core Concepts

Quick Command

custy [GLOBAL OPTIONS] COMMAND [OPTIONS]

configuration priorityproject defaultsCLI overrides

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

PropertyTypeDescriptionDefaultRequired
1. Explicit CLI valueHighest priorityA value supplied for the current invocation overrides the corresponding project setting.-No
2. Project configuration.config/custy/config.tomlThe value under [tool.custy] is used when the matching CLI value is unspecified.-No
3. Built-in defaultFallbackThe 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.
current
2
Read project configuration
When the CLI value is unspecified, look up the corresponding path under [tool.custy].
pending
3
Apply the built-in default
Use the command's fallback when the configuration path is also absent.
pending
4
Validate the result
A required value that remains unresolved raises a configuration error.
pending

Configuration File Shape

Custy extracts its settings from the [tool.custy] table. Nested configuration paths become nested TOML tables.

.config/custy/config.toml
toml
[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.

Continue