Documentation
¶
Overview ¶
Package config provides CLI configuration commands including init. path.go contains path resolution utilities for the init command, enabling initialization at arbitrary filesystem locations.
Package config provides CLI commands for autospec configuration management. Includes: init, config, migrate, doctor
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConstitutionRunner = runConstitutionFromInitImpl
ConstitutionRunner is the function that runs the constitution workflow. It can be replaced in tests to avoid running real Claude. Exported for testing from other packages.
var WorktreeScriptRunner = runWorktreeGenScriptFromInitImpl
WorktreeScriptRunner is the function that runs the worktree gen-script workflow. It can be replaced in tests to avoid running real Claude. Exported for testing from other packages.
Functions ¶
func EnsureDirectory ¶ added in v0.8.0
EnsureDirectory ensures the target path exists as a directory. Creates the directory (and any parents) with 0755 permissions if needed. Returns an error if:
- The path exists but is a file (not a directory)
- The directory cannot be created (e.g., permission denied)
func Register ¶
Register adds all configuration commands to the root command. This function is called from the root CLI package during initialization.
func ResolvePath ¶ added in v0.8.0
ResolvePath converts a raw path argument to an absolute path. It handles the following cases:
- Empty string or ".": returns current working directory
- "~" or "~/...": expands tilde to user home directory
- Relative path: resolves against current working directory
- Absolute path: returns unchanged
Returns an error if the path cannot be resolved.
Types ¶
type AgentOption ¶
type AgentOption struct {
// Name is the unique identifier for the agent (e.g., "claude", "gemini").
Name string
// DisplayName is the human-readable name shown in prompts.
DisplayName string
// Recommended indicates whether this agent should be pre-selected by default.
// Only Claude is recommended.
Recommended bool
// Selected indicates whether the agent is currently selected in the prompt.
Selected bool
}
AgentOption represents an agent displayed in the multi-select prompt. Used by promptAgentSelection to show available agents with selection state.
func GetSupportedAgents ¶
func GetSupportedAgents() []AgentOption
GetSupportedAgents returns supported agents as AgentOptions. In production builds, only production agents (claude, opencode) are returned. In dev builds, all registered agents are returned. Claude is marked as Recommended by default. Agents are returned in alphabetical order by name for consistent display.
func GetSupportedAgentsWithDefaults ¶
func GetSupportedAgentsWithDefaults(defaultAgents []string) []AgentOption
GetSupportedAgentsWithDefaults returns agents with selections pre-applied. If defaultAgents is empty, only Claude is pre-selected (as recommended). Otherwise, agents in defaultAgents are pre-selected. Unknown agent names in defaultAgents are ignored.
type BoolFlagPair ¶ added in v0.9.0
type BoolFlagPair struct {
Positive string // Name of the enabling flag (e.g., "sandbox")
Negative string // Name of the disabling flag (e.g., "no-sandbox")
}
BoolFlagPair represents a pair of mutually exclusive boolean flags (--flag and --no-flag).