Skip to main content

Module config

Module config 

Source
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):

  1. Embedded defaults.
  2. User overlay at ~/.config/cc-toolgate/config.toml.
  3. 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§

CargoConfig
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.
KubectlConfig
kubectl subcommand evaluation rules.
Settings
Global settings that affect evaluation behavior.
WrapperConfig
Commands that execute their arguments as subcommands. The wrapped command is extracted and evaluated; the final decision is max(floor, wrapped_command_decision).