Documentation
¶
Index ¶
- Constants
- func ExtractGitSubcommand(command string) string
- func IsGitCheckoutSubcommand(command string) bool
- func IsGitDiscardCommand(command string) bool
- func SetGitDir(dir string)
- func WriteJSONToOutput(value interface{}) error
- func WriteToOutput(output string)
- type ChangesCommand
- type ClearCommand
- type CodegraphCommand
- type Command
- type CommandContext
- type CommandRegistry
- func (r *CommandRegistry) AliasesOf(canonical string) []string
- func (r *CommandRegistry) CompletionCandidates() []string
- func (r *CommandRegistry) Execute(input string, chatAgent *agent.Agent) error
- func (r *CommandRegistry) GetCommand(name string) (Command, bool)
- func (r *CommandRegistry) IsSlashCommand(input string) bool
- func (r *CommandRegistry) ListCommands() []Command
- func (r *CommandRegistry) Register(cmd Command)
- func (r *CommandRegistry) RegisterAlias(short, canonical string)
- func (r *CommandRegistry) SuggestCommands(name string, maxSuggestions int) []string
- type CommitAction
- type CommitActionItem
- type CommitCommand
- func (c *CommitCommand) Description() string
- func (c *CommitCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *CommitCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *CommitCommand) Name() string
- func (c *CommitCommand) SetAgentError(err error)
- func (c *CommitCommand) Usage() string
- type CommitFlow
- type CommitJSONResult
- type CommitMessageHandler
- func (h *CommitMessageHandler) CreateCommit(commitMessage string) error
- func (h *CommitMessageHandler) EditCommitMessage(commitMessage string) (string, error)
- func (h *CommitMessageHandler) GenerateCommitMessage(diffOutput []byte, isSingleFile bool, filename string) (string, error)
- func (h *CommitMessageHandler) HandleCommitConfirmation(commitMessage string, filename string) (string, bool, error)
- type CompactCommand
- type EditCommand
- type ExecCommand
- type ExitCommand
- type FileItem
- type HelpCommand
- type IndexCommand
- type InfoCommand
- func (c *InfoCommand) Description() string
- func (c *InfoCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *InfoCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *InfoCommand) Name() string
- func (c *InfoCommand) Usage() string
- type InitCommand
- type JSONCommand
- type LogAction
- type LogActionItem
- type LogCommand
- type LogFlow
- type MCPCommand
- type MaxContextCommand
- type ModelsCommand
- func (m *ModelsCommand) Description() string
- func (m *ModelsCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (m *ModelsCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (m *ModelsCommand) Name() string
- func (m *ModelsCommand) Usage() string
- type OutputFormat
- type OutputWriter
- type PersonaCommand
- type ProvidersCommand
- func (p *ProvidersCommand) Description() string
- func (p *ProvidersCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (p *ProvidersCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (p *ProvidersCommand) Name() string
- func (p *ProvidersCommand) Usage() string
- type RecallCommand
- func (c *RecallCommand) Description() string
- func (c *RecallCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *RecallCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *RecallCommand) Name() string
- func (c *RecallCommand) Usage() string
- type ReviewCommand
- type ReviewDeepCommand
- type RevisionItem
- type RewindCommand
- type RiskProfileCommand
- type RollbackCommand
- type SearchCommand
- func (c *SearchCommand) Description() string
- func (c *SearchCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *SearchCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *SearchCommand) Name() string
- func (c *SearchCommand) Usage() string
- type SessionsCommand
- type SessionsFlow
- func (f *SessionsFlow) ExecuteSessionDelete(args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionExport(args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionImport(chatAgent *agent.Agent, args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionList(chatAgent *agent.Agent) (string, error)
- func (f *SessionsFlow) ExecuteSessionLoad(chatAgent *agent.Agent, args []string) (string, error)
- func (f *SessionsFlow) ExecuteSessionRename(chatAgent *agent.Agent, args []string) (string, error)
- type SettingsCommand
- type SetupCommand
- type ShellCommand
- type SkillCommand
- func (c *SkillCommand) Description() string
- func (c *SkillCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (c *SkillCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (c *SkillCommand) Name() string
- func (c *SkillCommand) Usage() string
- type StatusCommand
- func (s *StatusCommand) Description() string
- func (s *StatusCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (s *StatusCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (s *StatusCommand) Name() string
- func (s *StatusCommand) Usage() string
- type SubagentConfigCommand
- type SubagentPersonaCommand
- type SubagentPersonasCommand
- type TranscriptCommand
- type UsageCommand
- func (u *UsageCommand) Description() string
- func (u *UsageCommand) Execute(args []string, chatAgent *agent.Agent) error
- func (u *UsageCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
- func (u *UsageCommand) Name() string
- func (u *UsageCommand) Usage() string
- type UsageProvider
Constants ¶
const ( CommitStatusSuccess = "success" CommitStatusError = "error" CommitStatusDryRun = "dry-run" )
Commit status constants
Variables ¶
This section is empty.
Functions ¶
func ExtractGitSubcommand ¶
ExtractGitSubcommand extracts the first git subcommand from a command string for display purposes.
func IsGitCheckoutSubcommand ¶
IsGitCheckoutSubcommand checks if a git command is a checkout or switch operation. These operations are blocked from direct execution to require explicit user approval. This function checks ALL git commands in a compound shell command (e.g., "cd x && git checkout").
func IsGitDiscardCommand ¶
IsGitDiscardCommand checks if a git command could discard changes (restore, reset --hard, checkout -- <file>). These are always blocked from direct execution regardless of orchestrator permissions. This function checks ALL git commands in a compound shell command (e.g., "cd x && git reset").
func SetGitDir ¶
func SetGitDir(dir string)
SetGitDir sets the working directory for subsequent gitCommand calls.
func WriteJSONToOutput ¶
func WriteJSONToOutput(value interface{}) error
WriteJSONToOutput writes a JSON representation of value to stdout
Types ¶
type ChangesCommand ¶
type ChangesCommand struct{}
ChangesCommand shows tracked file changes in the current session
func (*ChangesCommand) Description ¶
func (c *ChangesCommand) Description() string
Description returns the command description
func (*ChangesCommand) Execute ¶
func (c *ChangesCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute shows the tracked changes for this session
func (*ChangesCommand) Usage ¶ added in v0.16.19
func (c *ChangesCommand) Usage() string
Usage returns the detailed help text shown by `/help changes`.
type ClearCommand ¶
type ClearCommand struct{}
ClearCommand handles clearing of conversation history
func (*ClearCommand) Description ¶
func (c *ClearCommand) Description() string
func (*ClearCommand) Execute ¶
func (c *ClearCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*ClearCommand) Name ¶
func (c *ClearCommand) Name() string
func (*ClearCommand) Usage ¶ added in v0.16.19
func (c *ClearCommand) Usage() string
Usage returns the detailed help text shown by `/help clear`.
type CodegraphCommand ¶ added in v0.16.19
type CodegraphCommand struct{}
CodegraphCommand implements the /codegraph slash command for managing the code intelligence graph: build, stats, and dead-code detection.
func (*CodegraphCommand) Description ¶ added in v0.16.19
func (c *CodegraphCommand) Description() string
Description returns the command description
func (*CodegraphCommand) Execute ¶ added in v0.16.19
func (c *CodegraphCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the codegraph command
func (*CodegraphCommand) Name ¶ added in v0.16.19
func (c *CodegraphCommand) Name() string
Name returns the command name
func (*CodegraphCommand) Usage ¶ added in v0.16.19
func (c *CodegraphCommand) Usage() string
Usage returns detailed help text for the command
type Command ¶
type Command interface {
Name() string
Description() string
Execute(args []string, chatAgent *agent.Agent) error
}
Command represents a slash command
type CommandContext ¶
type CommandContext struct {
OutputFormat OutputFormat
}
CommandContext provides context for command execution
type CommandRegistry ¶
type CommandRegistry struct {
// contains filtered or unexported fields
}
CommandRegistry manages all available slash commands
func NewCommandRegistry ¶
func NewCommandRegistry() *CommandRegistry
NewCommandRegistry creates a new command registry
func (*CommandRegistry) AliasesOf ¶
func (r *CommandRegistry) AliasesOf(canonical string) []string
AliasesOf returns the set of aliases that resolve to the given canonical command name. Used by /help <name> to show alternate spellings.
func (*CommandRegistry) CompletionCandidates ¶
func (r *CommandRegistry) CompletionCandidates() []string
CompletionCandidates returns all valid slash-command names (canonical plus aliases) sorted alphabetically. Used by the tab-completion CompletionProvider in the input reader.
func (*CommandRegistry) Execute ¶
func (r *CommandRegistry) Execute(input string, chatAgent *agent.Agent) error
Execute processes a slash command input Supports both / and ! prefixes (e.g. /exec ls or !exec ls)
func (*CommandRegistry) GetCommand ¶
func (r *CommandRegistry) GetCommand(name string) (Command, bool)
GetCommand returns a command by name. If name matches an alias, the canonical command is returned (SP-048-2d).
func (*CommandRegistry) IsSlashCommand ¶
func (r *CommandRegistry) IsSlashCommand(input string) bool
IsSlashCommand checks if input starts with a slash or bang
func (*CommandRegistry) ListCommands ¶
func (r *CommandRegistry) ListCommands() []Command
ListCommands returns all available commands
func (*CommandRegistry) Register ¶
func (r *CommandRegistry) Register(cmd Command)
Register adds a command to the registry
func (*CommandRegistry) RegisterAlias ¶
func (r *CommandRegistry) RegisterAlias(short, canonical string)
RegisterAlias maps a short name to a canonical command name. Looking up the alias via GetCommand or Execute resolves transparently. Aliases also participate in tab completion and "did you mean" suggestions.
func (*CommandRegistry) SuggestCommands ¶
func (r *CommandRegistry) SuggestCommands(name string, maxSuggestions int) []string
SuggestCommands returns up to maxSuggestions command names that are plausible corrections for a mistyped command. Matches are ranked by Levenshtein distance against the lowercased canonical name; commands whose lowercased name has the input as a prefix are pulled to the front (distance 0). Returns nil for empty input or when no candidate is reasonably close.
type CommitAction ¶
type CommitAction struct {
ID string
DisplayName string
Description string
Action func(*CommitFlow) error
}
CommitAction represents different commit actions
type CommitActionItem ¶
CommitActionItem adapts CommitAction for dropdown display
func (*CommitActionItem) Display ¶
func (c *CommitActionItem) Display() string
func (*CommitActionItem) SearchText ¶
func (c *CommitActionItem) SearchText() string
func (*CommitActionItem) Value ¶
func (c *CommitActionItem) Value() interface{}
type CommitCommand ¶
type CommitCommand struct {
// contains filtered or unexported fields
}
CommitCommand implements the /commit slash command
func (*CommitCommand) Description ¶
func (c *CommitCommand) Description() string
Description returns the command description
func (*CommitCommand) Execute ¶
func (c *CommitCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the commit command
func (*CommitCommand) ExecuteWithJSONOutput ¶
func (c *CommitCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput runs the commit command with JSON output
func (*CommitCommand) SetAgentError ¶
func (c *CommitCommand) SetAgentError(err error)
SetAgentError sets the agent creation error for better error reporting
func (*CommitCommand) Usage ¶ added in v0.16.19
func (c *CommitCommand) Usage() string
Usage returns the detailed help text shown by `/help commit`.
type CommitFlow ¶
type CommitFlow struct {
// contains filtered or unexported fields
}
CommitFlow manages the interactive commit workflow
func NewCommitFlow ¶
func NewCommitFlow(chatAgent *agent.Agent) *CommitFlow
NewCommitFlow creates a new commit flow
func NewCommitFlowWithFlags ¶
func NewCommitFlowWithFlags(chatAgent *agent.Agent, skipPrompt, dryRun, allowSecrets bool) *CommitFlow
NewCommitFlowWithFlags creates a new commit flow with CLI flags
func (*CommitFlow) CommitStagedWithMessage ¶
func (cf *CommitFlow) CommitStagedWithMessage() error
CommitStagedWithMessage commits staged files with an optional message or auto-generated message This method is designed for non-interactive use by the commit tool
func (*CommitFlow) Execute ¶
func (cf *CommitFlow) Execute() error
Execute runs a simplified commit flow: 1) If there are staged changes, use them and generate a commit message 2) If there are no staged changes, prompt user to select files, then generate the commit message
func (*CommitFlow) SetUserInstructions ¶
func (cf *CommitFlow) SetUserInstructions(instructions string)
SetUserInstructions sets the user instructions for commit message generation
type CommitJSONResult ¶
type CommitJSONResult struct {
Status string `json:"status"` // success, error, dry-run
Commit string `json:"commit,omitempty"` // commit hash if successful
Message string `json:"message,omitempty"` // commit message
Branch string `json:"branch,omitempty"` // branch name
Error string `json:"error,omitempty"` // error message
Review string `json:"review,omitempty"` // commit review (critical concerns)
}
CommitJSONResult is the JSON output structure for commit command
func (*CommitJSONResult) Validate ¶
func (r *CommitJSONResult) Validate() error
Validate checks that required fields are populated
type CommitMessageHandler ¶
type CommitMessageHandler struct {
// contains filtered or unexported fields
}
CommitMessageHandler handles commit message generation, editing, and retry logic
func NewCommitMessageHandler ¶
func NewCommitMessageHandler(chatAgent *agent.Agent, reader *bufio.Reader) *CommitMessageHandler
NewCommitMessageHandler creates a new commit message handler
func (*CommitMessageHandler) CreateCommit ¶
func (h *CommitMessageHandler) CreateCommit(commitMessage string) error
CreateCommit creates the git commit with the given message
func (*CommitMessageHandler) EditCommitMessage ¶
func (h *CommitMessageHandler) EditCommitMessage(commitMessage string) (string, error)
EditCommitMessage opens the default editor to edit the commit message
func (*CommitMessageHandler) GenerateCommitMessage ¶
func (h *CommitMessageHandler) GenerateCommitMessage(diffOutput []byte, isSingleFile bool, filename string) (string, error)
GenerateCommitMessage generates a commit message from staged diff
func (*CommitMessageHandler) HandleCommitConfirmation ¶
func (h *CommitMessageHandler) HandleCommitConfirmation(commitMessage string, filename string) (string, bool, error)
HandleCommitConfirmation handles the commit message preview, editing, and confirmation
type CompactCommand ¶
type CompactCommand struct {
// contains filtered or unexported fields
}
CompactCommand implements the /compact slash command. It produces an LLM-generated recap of the messages preceding the most recent user turn, substitutes that recap for the recapped messages, and leaves the latest user turn and everything after it intact.
func (*CompactCommand) Description ¶
func (c *CompactCommand) Description() string
Description returns the command description
func (*CompactCommand) Execute ¶
func (c *CompactCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the compact command
func (*CompactCommand) SetContext ¶ added in v0.16.19
func (c *CompactCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for the LLM summarization call. When wired through the command registry, this receives the agent's InterruptCtx so Stop/Ctrl+C can abort in-flight compaction.
Note: in concurrent multi-chat daemon mode, the registry reuses the same CompactCommand singleton, so c.ctx may be overwritten by a concurrent call. The Execute method falls back to the agent's own InterruptCtx() to avoid cross-chat interference.
func (*CompactCommand) Usage ¶ added in v0.16.19
func (c *CompactCommand) Usage() string
Usage returns the detailed help text shown by `/help compact`.
type EditCommand ¶
type EditCommand struct{}
EditCommand opens $EDITOR to compose or edit a query.
func (*EditCommand) Description ¶
func (c *EditCommand) Description() string
func (*EditCommand) Execute ¶
func (c *EditCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*EditCommand) Name ¶
func (c *EditCommand) Name() string
func (*EditCommand) Usage ¶ added in v0.16.19
func (c *EditCommand) Usage() string
Usage returns the detailed help text shown by `/help edit`.
type ExecCommand ¶
type ExecCommand struct{}
ExecCommand handles the /exec slash command Usage: /exec <shell-command-to-execute> Alias: !<shell-command-to-execute> (matches other tools like Jupyter, R, etc.)
func (*ExecCommand) Description ¶
func (c *ExecCommand) Description() string
func (*ExecCommand) Execute ¶
func (c *ExecCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*ExecCommand) Name ¶
func (c *ExecCommand) Name() string
func (*ExecCommand) Usage ¶ added in v0.16.19
func (c *ExecCommand) Usage() string
Usage returns the detailed help text shown by `/help exec`.
type ExitCommand ¶
type ExitCommand struct{}
ExitCommand implements the /exit slash command
func (*ExitCommand) Description ¶
func (e *ExitCommand) Description() string
Description returns the command description
func (*ExitCommand) Execute ¶
func (e *ExitCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the exit command
func (*ExitCommand) Usage ¶ added in v0.16.19
func (e *ExitCommand) Usage() string
Usage returns the detailed help text shown by `/help exit`.
type HelpCommand ¶
type HelpCommand struct {
// contains filtered or unexported fields
}
HelpCommand implements the /help slash command
func (*HelpCommand) Description ¶
func (h *HelpCommand) Description() string
Description returns the command description
func (*HelpCommand) Execute ¶
func (h *HelpCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the help command. With no args, prints the global help and command list. With one arg, prints per-command help (SP-048-2c).
func (*HelpCommand) Usage ¶ added in v0.16.19
func (h *HelpCommand) Usage() string
Usage returns the detailed help text shown by `/help help`.
type IndexCommand ¶
type IndexCommand struct{}
IndexCommand implements the /index slash command for toggling workspace indexing.
func (*IndexCommand) Description ¶
func (c *IndexCommand) Description() string
Description returns the command description
func (*IndexCommand) Execute ¶
func (c *IndexCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the index command
func (*IndexCommand) Usage ¶ added in v0.16.19
func (c *IndexCommand) Usage() string
Usage returns the detailed help text shown by `/help index`.
type InfoCommand ¶ added in v0.16.19
type InfoCommand struct{}
InfoCommand implements the /info slash command — a one-shot overview of the agent's current state: model, provider, context, cost, persona, embedding index, and subagent config.
func (*InfoCommand) Description ¶ added in v0.16.19
func (c *InfoCommand) Description() string
Description returns the command description
func (*InfoCommand) Execute ¶ added in v0.16.19
func (c *InfoCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute renders the agent state overview
func (*InfoCommand) ExecuteWithJSONOutput ¶ added in v0.16.19
func (c *InfoCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput emits the agent state overview as JSON.
func (*InfoCommand) Name ¶ added in v0.16.19
func (c *InfoCommand) Name() string
Name returns the command name
func (*InfoCommand) Usage ¶ added in v0.16.19
func (c *InfoCommand) Usage() string
Usage returns the detailed help text shown by `/help info`.
type InitCommand ¶
type InitCommand struct{}
InitCommand implements the /init slash command
func (*InitCommand) Description ¶
func (i *InitCommand) Description() string
Description returns the command description
func (*InitCommand) Execute ¶
func (i *InitCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the init command using the LLM to analyze the codebase
func (*InitCommand) Usage ¶ added in v0.16.19
func (i *InitCommand) Usage() string
Usage returns the detailed help text shown by `/help init`.
type JSONCommand ¶
type JSONCommand interface {
Command
ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
}
JSONCommand extends Command to support JSON output
type LogAction ¶
type LogAction struct {
ID string
DisplayName string
Description string
Action func(*LogFlow) error
}
LogAction represents different log management actions
type LogActionItem ¶
LogActionItem adapts LogAction for dropdown display
func (*LogActionItem) Display ¶
func (l *LogActionItem) Display() string
func (*LogActionItem) SearchText ¶
func (l *LogActionItem) SearchText() string
func (*LogActionItem) Value ¶
func (l *LogActionItem) Value() interface{}
type LogCommand ¶
type LogCommand struct{}
LogCommand shows the change history using the history package
func (*LogCommand) Description ¶
func (l *LogCommand) Description() string
Description returns the command description
func (*LogCommand) Execute ¶
func (l *LogCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute shows the change log using enhanced flow
func (*LogCommand) Usage ¶ added in v0.16.19
func (l *LogCommand) Usage() string
Usage returns the detailed help text shown by `/help log`.
type LogFlow ¶
type LogFlow struct {
// contains filtered or unexported fields
}
LogFlow manages enhanced log and history operations
func NewLogFlow ¶
NewLogFlow creates a new log flow
type MCPCommand ¶
type MCPCommand struct{}
MCPCommand implements the /mcp slash command
func (*MCPCommand) Description ¶
func (m *MCPCommand) Description() string
Description returns the command description
func (*MCPCommand) Execute ¶
func (m *MCPCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the MCP command
func (*MCPCommand) Usage ¶ added in v0.16.19
func (m *MCPCommand) Usage() string
Usage returns the detailed help text shown by `/help mcp`.
type MaxContextCommand ¶ added in v0.16.17
type MaxContextCommand struct{}
MaxContextCommand implements /max-context for inspecting or setting the user-defined context window cap (Config.MaxContextTokens). When set, the agent treats the model as if it has at most this many context tokens, limiting input/output budgets as a cost-control measure.
func (*MaxContextCommand) Description ¶ added in v0.16.17
func (c *MaxContextCommand) Description() string
func (*MaxContextCommand) Execute ¶ added in v0.16.17
func (c *MaxContextCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*MaxContextCommand) Name ¶ added in v0.16.17
func (c *MaxContextCommand) Name() string
func (*MaxContextCommand) Usage ¶ added in v0.16.17
func (c *MaxContextCommand) Usage() string
type ModelsCommand ¶
type ModelsCommand struct{}
ModelsCommand implements the /model slash command
func (*ModelsCommand) Description ¶
func (m *ModelsCommand) Description() string
Description returns the command description
func (*ModelsCommand) Execute ¶
func (m *ModelsCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the models command
func (*ModelsCommand) ExecuteWithJSONOutput ¶ added in v0.16.19
func (m *ModelsCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput emits the available models for the current provider as a JSON array. This mirrors the no-args /model list path. The `select` and `<model_id>` subcommands are interactive/stateful and are not meaningfully representable as JSON, so they fall through to the text Execute.
func (*ModelsCommand) Usage ¶ added in v0.16.19
func (m *ModelsCommand) Usage() string
Usage returns the detailed help text shown by `/help model`.
type OutputFormat ¶
type OutputFormat int
OutputFormat defines output format for commands
const ( OutputText OutputFormat = iota OutputJSON )
type OutputWriter ¶
OutputWriter captures and buffers output
func (*OutputWriter) String ¶
func (ow *OutputWriter) String() string
String returns the captured output
type PersonaCommand ¶
type PersonaCommand struct{}
PersonaCommand implements the /persona slash command.
Personas are catalog-fixed: the set of personas, their tool allowlists, system prompts, providers, and models are defined in pkg/personas/configs/*.json and are NOT user-customizable at runtime. The only mutable knob is enable/disable, which is recorded by ID in Config.DisabledPersonas so the catalog itself never gets mutated.
Workflow-level provider/model overrides (sprout automate) and per-spawn overrides (`run_subagent` arguments) remain available — those are transient, programmatic, and tracked separately.
func (*PersonaCommand) Description ¶
func (p *PersonaCommand) Description() string
func (*PersonaCommand) Execute ¶
func (p *PersonaCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*PersonaCommand) Name ¶
func (p *PersonaCommand) Name() string
func (*PersonaCommand) Usage ¶ added in v0.16.19
func (p *PersonaCommand) Usage() string
Usage returns the detailed help text shown by `/help persona`.
type ProvidersCommand ¶
type ProvidersCommand struct{}
ProvidersCommand implements the /provider slash command
func (*ProvidersCommand) Description ¶
func (p *ProvidersCommand) Description() string
Description returns the command description
func (*ProvidersCommand) Execute ¶
func (p *ProvidersCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the providers command
func (*ProvidersCommand) ExecuteWithJSONOutput ¶ added in v0.16.19
func (p *ProvidersCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput emits the provider list as a JSON array. This mirrors the /provider list path (the status, select, and setProvider subcommands are interactive/stateful and fall through to text Execute).
func (*ProvidersCommand) Name ¶
func (p *ProvidersCommand) Name() string
Name returns the command name
func (*ProvidersCommand) Usage ¶ added in v0.16.19
func (p *ProvidersCommand) Usage() string
Usage returns the detailed help text shown by `/help provider`.
type RecallCommand ¶ added in v0.16.19
type RecallCommand struct{}
RecallCommand implements the /recall slash command. It searches past sessions for content matching the given query and renders the results.
func (*RecallCommand) Description ¶ added in v0.16.19
func (c *RecallCommand) Description() string
Description returns the short description shown in /help listings.
func (*RecallCommand) Execute ¶ added in v0.16.19
func (c *RecallCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute renders the recalled items as a friendly markdown block.
func (*RecallCommand) ExecuteWithJSONOutput ¶ added in v0.16.19
func (c *RecallCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput emits the raw []RecalledItem slice as JSON.
func (*RecallCommand) Name ¶ added in v0.16.19
func (c *RecallCommand) Name() string
Name returns the slash command name.
func (*RecallCommand) Usage ¶ added in v0.16.19
func (c *RecallCommand) Usage() string
Usage returns the long help string shown by /help recall.
type ReviewCommand ¶
type ReviewCommand struct {
// contains filtered or unexported fields
}
func (*ReviewCommand) Description ¶
func (c *ReviewCommand) Description() string
Description returns the command description
func (*ReviewCommand) Execute ¶
func (c *ReviewCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the code review command
func (*ReviewCommand) SetContext ¶ added in v0.16.17
func (c *ReviewCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for review LLM calls (SP-073). When wired through the command registry, this receives the agent's InterruptCtx so Stop/Ctrl+C can abort in-flight review requests.
func (*ReviewCommand) Usage ¶ added in v0.16.19
func (c *ReviewCommand) Usage() string
Usage returns the detailed help text shown by `/help review`.
type ReviewDeepCommand ¶
type ReviewDeepCommand struct {
// contains filtered or unexported fields
}
ReviewDeepCommand implements the /review-deep slash command This command performs a deeper evidence-focused review on staged Git changes
func (*ReviewDeepCommand) Description ¶
func (c *ReviewDeepCommand) Description() string
Description returns the command description
func (*ReviewDeepCommand) Execute ¶
func (c *ReviewDeepCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the deep code review command
func (*ReviewDeepCommand) Name ¶
func (c *ReviewDeepCommand) Name() string
Name returns the command name
func (*ReviewDeepCommand) SetContext ¶ added in v0.16.17
func (c *ReviewDeepCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for review LLM calls (SP-073).
func (*ReviewDeepCommand) Usage ¶ added in v0.16.19
func (c *ReviewDeepCommand) Usage() string
Usage returns the detailed help text shown by `/help review-deep`.
type RevisionItem ¶
RevisionItem adapts revision information for dropdown display
func (*RevisionItem) Display ¶
func (r *RevisionItem) Display() string
func (*RevisionItem) SearchText ¶
func (r *RevisionItem) SearchText() string
func (*RevisionItem) Value ¶
func (r *RevisionItem) Value() interface{}
type RewindCommand ¶ added in v0.16.12
type RewindCommand struct{}
RewindCommand handles rewinding conversation to a previous turn
func (*RewindCommand) Description ¶ added in v0.16.12
func (c *RewindCommand) Description() string
func (*RewindCommand) Execute ¶ added in v0.16.12
func (c *RewindCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*RewindCommand) Name ¶ added in v0.16.12
func (c *RewindCommand) Name() string
func (*RewindCommand) Usage ¶ added in v0.16.12
func (c *RewindCommand) Usage() string
type RiskProfileCommand ¶
type RiskProfileCommand struct{}
RiskProfileCommand implements /risk-profile for inspecting or switching the SP-058 shell-command gating profile mid-session. The CLI flag --risk-profile sets the same field at startup; this command lets the user adjust without restarting.
func (*RiskProfileCommand) Description ¶
func (c *RiskProfileCommand) Description() string
func (*RiskProfileCommand) Execute ¶
func (c *RiskProfileCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*RiskProfileCommand) Name ¶
func (c *RiskProfileCommand) Name() string
func (*RiskProfileCommand) Usage ¶
func (c *RiskProfileCommand) Usage() string
type RollbackCommand ¶
type RollbackCommand struct{}
RollbackCommand provides rollback functionality
func (*RollbackCommand) Description ¶
func (r *RollbackCommand) Description() string
Description returns the command description
func (*RollbackCommand) Execute ¶
func (r *RollbackCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute performs a rollback
func (*RollbackCommand) Name ¶
func (r *RollbackCommand) Name() string
Name returns the command name
func (*RollbackCommand) Usage ¶ added in v0.16.19
func (r *RollbackCommand) Usage() string
Usage returns the detailed help text shown by `/help rollback`.
type SearchCommand ¶ added in v0.16.18
type SearchCommand struct{}
SearchCommand implements the /search slash command for searching across saved sessions by message content.
func (*SearchCommand) Description ¶ added in v0.16.18
func (c *SearchCommand) Description() string
func (*SearchCommand) Execute ¶ added in v0.16.18
func (c *SearchCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SearchCommand) ExecuteWithJSONOutput ¶ added in v0.16.18
func (c *SearchCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
func (*SearchCommand) Name ¶ added in v0.16.18
func (c *SearchCommand) Name() string
func (*SearchCommand) Usage ¶ added in v0.16.18
func (c *SearchCommand) Usage() string
type SessionsCommand ¶
type SessionsCommand struct{}
SessionsCommand handles session management with auto-tracking and session recovery
func (*SessionsCommand) Description ¶
func (c *SessionsCommand) Description() string
func (*SessionsCommand) Execute ¶
func (c *SessionsCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SessionsCommand) Name ¶
func (c *SessionsCommand) Name() string
func (*SessionsCommand) Usage ¶ added in v0.16.19
func (c *SessionsCommand) Usage() string
Usage returns the detailed help text shown by `/help sessions`.
type SessionsFlow ¶
type SessionsFlow struct{}
SessionsFlow handles advanced session operations
func (*SessionsFlow) ExecuteSessionDelete ¶
func (f *SessionsFlow) ExecuteSessionDelete(args []string) (string, error)
ExecuteSessionDelete removes a session file
func (*SessionsFlow) ExecuteSessionExport ¶
func (f *SessionsFlow) ExecuteSessionExport(args []string) (string, error)
ExecuteSessionExport exports a session to a JSON file
func (*SessionsFlow) ExecuteSessionImport ¶
ExecuteSessionImport imports a session from a JSON file
func (*SessionsFlow) ExecuteSessionList ¶
func (f *SessionsFlow) ExecuteSessionList(chatAgent *agent.Agent) (string, error)
ExecuteSessionList lists sessions for the current working directory, newest first.
func (*SessionsFlow) ExecuteSessionLoad ¶
ExecuteSessionLoad loads a session with optional summary context restoration
func (*SessionsFlow) ExecuteSessionRename ¶
ExecuteSessionRename renames a session
type SettingsCommand ¶ added in v0.16.19
type SettingsCommand struct{}
SettingsCommand implements the /settings slash command — an interactive settings browser that lets the user view and change configuration values.
func (*SettingsCommand) Description ¶ added in v0.16.19
func (s *SettingsCommand) Description() string
Description returns the command description
func (*SettingsCommand) Execute ¶ added in v0.16.19
func (s *SettingsCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the settings command
func (*SettingsCommand) Name ¶ added in v0.16.19
func (s *SettingsCommand) Name() string
Name returns the command name
func (*SettingsCommand) Usage ¶ added in v0.16.19
func (s *SettingsCommand) Usage() string
Usage returns the detailed help text shown by `/help settings`.
type SetupCommand ¶ added in v0.16.2
type SetupCommand struct{}
SetupCommand implements the /setup slash command, which displays a human-readable summary of the current Sprout configuration.
func (*SetupCommand) Description ¶ added in v0.16.2
func (s *SetupCommand) Description() string
Description returns the command description.
func (*SetupCommand) Execute ¶ added in v0.16.2
func (s *SetupCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the /setup command.
func (*SetupCommand) Name ¶ added in v0.16.2
func (s *SetupCommand) Name() string
Name returns the command name.
func (*SetupCommand) Usage ¶ added in v0.16.19
func (s *SetupCommand) Usage() string
Usage returns the detailed help text shown by `/help setup`.
type ShellCommand ¶
func (*ShellCommand) Description ¶
func (c *ShellCommand) Description() string
func (*ShellCommand) Execute ¶
func (c *ShellCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*ShellCommand) Name ¶
func (c *ShellCommand) Name() string
func (*ShellCommand) SetContext ¶ added in v0.16.12
func (c *ShellCommand) SetContext(ctx context.Context)
SetContext sets the cancellation context for LLM calls (SP-073).
func (*ShellCommand) Usage ¶ added in v0.16.19
func (c *ShellCommand) Usage() string
Usage returns the detailed help text shown by `/help shell`.
type SkillCommand ¶ added in v0.16.18
type SkillCommand struct{}
SkillCommand exposes the /skill slash command.
func (*SkillCommand) Description ¶ added in v0.16.18
func (c *SkillCommand) Description() string
func (*SkillCommand) Execute ¶ added in v0.16.18
func (c *SkillCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SkillCommand) ExecuteWithJSONOutput ¶ added in v0.16.18
func (c *SkillCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
func (*SkillCommand) Name ¶ added in v0.16.18
func (c *SkillCommand) Name() string
func (*SkillCommand) Usage ¶ added in v0.16.18
func (c *SkillCommand) Usage() string
type StatusCommand ¶
type StatusCommand struct{}
StatusCommand shows the current change tracking status
func (*StatusCommand) Description ¶
func (s *StatusCommand) Description() string
Description returns the command description
func (*StatusCommand) Execute ¶
func (s *StatusCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute shows the current status
func (*StatusCommand) ExecuteWithJSONOutput ¶ added in v0.16.19
func (s *StatusCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput emits the runtime status as JSON.
func (*StatusCommand) Usage ¶ added in v0.16.19
func (s *StatusCommand) Usage() string
Usage returns the detailed help text shown by `/help status`.
type SubagentConfigCommand ¶
type SubagentConfigCommand struct {
// contains filtered or unexported fields
}
SubagentConfigCommand implements the /subagent-provider and /subagent-model commands
func (*SubagentConfigCommand) Description ¶
func (s *SubagentConfigCommand) Description() string
Description returns the command description
func (*SubagentConfigCommand) Execute ¶
func (s *SubagentConfigCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the subagent config command
func (*SubagentConfigCommand) Name ¶
func (s *SubagentConfigCommand) Name() string
Name returns the command name
func (*SubagentConfigCommand) Usage ¶ added in v0.16.19
func (s *SubagentConfigCommand) Usage() string
Usage returns the detailed help text shown by `/help subagent-provider` or `/help subagent-model`.
type SubagentPersonaCommand ¶
type SubagentPersonaCommand struct{}
SubagentPersonaCommand is a backwards-compatible alias for /persona.
func (*SubagentPersonaCommand) Description ¶
func (s *SubagentPersonaCommand) Description() string
func (*SubagentPersonaCommand) Execute ¶
func (s *SubagentPersonaCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SubagentPersonaCommand) Name ¶
func (s *SubagentPersonaCommand) Name() string
func (*SubagentPersonaCommand) Usage ¶ added in v0.16.19
func (s *SubagentPersonaCommand) Usage() string
Usage returns the detailed help text shown by `/help subagent-persona`.
type SubagentPersonasCommand ¶
type SubagentPersonasCommand struct{}
SubagentPersonasCommand is a backwards-compatible alias for /persona list.
func (*SubagentPersonasCommand) Description ¶
func (s *SubagentPersonasCommand) Description() string
func (*SubagentPersonasCommand) Execute ¶
func (s *SubagentPersonasCommand) Execute(args []string, chatAgent *agent.Agent) error
func (*SubagentPersonasCommand) Name ¶
func (s *SubagentPersonasCommand) Name() string
func (*SubagentPersonasCommand) Usage ¶ added in v0.16.19
func (s *SubagentPersonasCommand) Usage() string
Usage returns the detailed help text shown by `/help subagent-personas`.
type TranscriptCommand ¶ added in v0.16.4
type TranscriptCommand struct{}
TranscriptCommand implements the /transcript slash command, a diagnostic tool for inspecting the agent's current conversation state. The default invocation captures a JSON snapshot to ~/.sprout/transcripts/<scope>/<session>/<utc>-manual.json. Subcommands enrich or change the output:
/transcript # snapshot only /transcript preview # snapshot + would-be /compact preview /transcript markdown # snapshot + rendered .md alongside /transcript diff # snapshot + diff vs previous snapshot
Multiple subcommands can be combined (e.g. `/transcript preview diff`). All snapshots include per-message source annotations so a reader can see which messages are LLM-generated checkpoint substitutes vs the original turns.
func (*TranscriptCommand) Description ¶ added in v0.16.4
func (c *TranscriptCommand) Description() string
Description returns the command description
func (*TranscriptCommand) Execute ¶ added in v0.16.4
func (c *TranscriptCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute runs the transcript command.
func (*TranscriptCommand) Name ¶ added in v0.16.4
func (c *TranscriptCommand) Name() string
Name returns the command name
func (*TranscriptCommand) Usage ¶ added in v0.16.4
func (c *TranscriptCommand) Usage() string
Usage returns the detailed help text shown by `/help transcript`.
type UsageCommand ¶ added in v0.16.19
type UsageCommand struct{}
UsageCommand implements the /usage slash command — a visual dashboard with Unicode bar charts for context window, cache efficiency, and cost.
func (*UsageCommand) Description ¶ added in v0.16.19
func (u *UsageCommand) Description() string
Description returns the command description
func (*UsageCommand) Execute ¶ added in v0.16.19
func (u *UsageCommand) Execute(args []string, chatAgent *agent.Agent) error
Execute renders the usage dashboard
func (*UsageCommand) ExecuteWithJSONOutput ¶ added in v0.16.19
func (u *UsageCommand) ExecuteWithJSONOutput(args []string, chatAgent *agent.Agent, ctx *CommandContext) error
ExecuteWithJSONOutput emits the usage dashboard data as JSON.
func (*UsageCommand) Name ¶ added in v0.16.19
func (u *UsageCommand) Name() string
Name returns the command name
func (*UsageCommand) Usage ¶ added in v0.16.19
func (u *UsageCommand) Usage() string
Usage returns the detailed help text shown by `/help usage`.
type UsageProvider ¶
type UsageProvider interface {
Usage() string
}
UsageProvider is implemented by commands that want to surface a longer per-command help string via `/help <name>`. Commands that don't implement it fall back to their Description().
Source Files
¶
- changes.go
- clear.go
- codegraph.go
- commands.go
- commit_command.go
- commit_flow.go
- commit_flow_console.go
- commit_git.go
- commit_review.go
- commit_types.go
- commit_utils.go
- compact.go
- diff_utils.go
- edit.go
- exec.go
- exit.go
- git_validator.go
- help.go
- index.go
- info.go
- init.go
- log_flow.go
- max_context.go
- mcp.go
- models.go
- persona.go
- providers.go
- recall_command.go
- review.go
- review_context.go
- rewind_command.go
- risk_profile.go
- search.go
- sessions.go
- sessions_flow.go
- settings_cmd.go
- setup.go
- shell.go
- skill.go
- subagent_config.go
- suggestions.go
- transcript.go
- usage_cmd.go