Documentation
¶
Overview ¶
Package cli implements clawtool's user-facing subcommands.
Subcommand layout (ADR-004 §4):
clawtool init write a default config if missing clawtool serve run as MCP server (delegates to internal/server) clawtool version print version clawtool help print top-level usage clawtool tools list list known tools and resolved enabled state clawtool tools enable <s> set tools.<selector>.enabled = true clawtool tools disable <s> set tools.<selector>.enabled = false clawtool tools status <s> print resolved state and the rule that won
Source / profile / group subcommands are scaffolded in main.go usage but not wired in v0.2 — they land alongside the source-instance feature.
Index ¶
- type App
- func (a *App) Init() error
- func (a *App) Path() string
- func (a *App) Run(argv []string) int
- func (a *App) SecretsPath() string
- func (a *App) SetSecretsPath(p string)
- func (a *App) ToolsDisable(selector string) error
- func (a *App) ToolsEnable(selector string) error
- func (a *App) ToolsList() error
- func (a *App) ToolsStatus(selector string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Stdout io.Writer
Stderr io.Writer
Stdin io.Reader
// ConfigPath overrides the default config location. Empty = config.DefaultPath().
ConfigPath string
// contains filtered or unexported fields
}
App holds CLI dependencies. Stdout/stderr are injected so tests can capture.
func New ¶
func New() *App
New returns an App writing to the process's stdout/stderr and using the default config path.
func (*App) Init ¶
Init writes a default config to disk if the file does not already exist. Returns an "already exists" error if it does — callers can ignore that.
func (*App) Run ¶
Run dispatches argv (excluding program name) to the right subcommand. Returns the exit code; 0 = success, 2 = usage error, 1 = runtime failure.
func (*App) SecretsPath ¶
SecretsPath returns the secrets-store path. Tests can shadow App.SecretsPath to point at a tmp file; production uses secrets.DefaultPath().
func (*App) SetSecretsPath ¶
SetSecretsPath lets tests redirect the secrets store to a tmp file.
func (*App) ToolsDisable ¶
ToolsDisable writes tools.<selector>.enabled = false.
func (*App) ToolsEnable ¶
ToolsEnable writes tools.<selector>.enabled = true.
func (*App) ToolsStatus ¶
ToolsStatus prints the resolved enabled state for a selector and the rule that won, per ADR-004 §4.