Expand description
Configuration types, loading, and overlay merge logic. Configuration loading and overlay merge logic.
cc-toolgate ships with sensible defaults embedded in the binary via
config.default.toml. Overlays merge on top in this order (later wins):
- Embedded defaults.
- User overlay at
~/.config/cc-toolgate/config.toml. - Project overlay at
<git-root>/.claude/cc-toolgate.toml(if CWD is inside a git repo). Lets a project permit extra commands without loosening user-global rules.
User overlays use full merge semantics: lists extend (deduplicated),
scalars override, remove_<field> subtracts, and replace = true
replaces entirely. Project overlays are restricted to additive
operations only — replace and remove_* fields are stripped for
security (a repo should not be able to weaken user-global rules).
Structs§
- Cargo
Config - Cargo subcommand evaluation rules.
- Commands
- Flat command name → decision mappings for simple commands.
- Config
- Top-level configuration, produced by merging embedded defaults with
an optional user overlay from
~/.config/cc-toolgate/config.toml. - GhConfig
- GitHub CLI (gh) subcommand evaluation rules.
- GitConfig
- Git subcommand evaluation rules.
- Kubectl
Config - kubectl subcommand evaluation rules.
- Settings
- Global settings that affect evaluation behavior.
- Wrapper
Config - Commands that execute their arguments as subcommands. The wrapped command is extracted and evaluated; the final decision is max(floor, wrapped_command_decision).