Documentation
¶
Index ¶
- Variables
- func AddAgentFlag(cmd *cobra.Command, dest *string)
- func AddDebugFlag(cmd *cobra.Command, dest *bool)
- func AddFileFlag(cmd *cobra.Command, dest *[]string, description string)
- func AddMCPFlag(cmd *cobra.Command, dest *string)
- func AddMaxTurnsFlag(cmd *cobra.Command, dest *int, defaultValue int)
- func AddNativeSearchFlags(cmd *cobra.Command, native, noNative *bool)
- func AddProviderFlag(cmd *cobra.Command, dest *string)
- func AddSearchFlag(cmd *cobra.Command, dest *bool)
- func AddSystemMessageFlag(cmd *cobra.Command, dest *string)
- func AddToolFlags(cmd *cobra.Command, tools *string, readDirs, writeDirs, shellAllow *[]string)
- func AddYoloFlag(cmd *cobra.Command, dest *bool)
- func AgentFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func AtAgentCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func Execute()
- func ExtractAgentFromArgs(args []string) (agentName string, filteredArgs []string)
- func ImageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func LoadAgent(agentName string, cfg *config.Config) (*agents.Agent, error)
- func MCPFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func MCPServerArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ToolsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func UsageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func WireSpawnAgentRunner(cfg *config.Config, toolMgr *tools.ToolManager, yoloMode bool) error
- type CLIFlags
- type CommonFlags
- type ModelLister
- type ProviderInfo
- type SessionSettings
- type SpawnAgentRunner
- type ToolDefinition
Constants ¶
This section is empty.
Variables ¶
var Commit = "unknown"
var Date = "unknown"
var Version = "dev"
These will be set by the linker during build
Functions ¶
func AddAgentFlag ¶ added in v0.0.34
AddAgentFlag adds the --agent/-a flag with completion
func AddDebugFlag ¶ added in v0.0.34
AddDebugFlag adds the --debug/-d flag
func AddFileFlag ¶ added in v0.0.34
AddFileFlag adds the --file/-f flag
func AddMCPFlag ¶ added in v0.0.34
AddMCPFlag adds the --mcp flag with completion
func AddMaxTurnsFlag ¶ added in v0.0.34
AddMaxTurnsFlag adds the --max-turns flag
func AddNativeSearchFlags ¶ added in v0.0.34
AddNativeSearchFlags adds --native-search and --no-native-search flags
func AddProviderFlag ¶ added in v0.0.34
AddProviderFlag adds the --provider/-p flag with completion
func AddSearchFlag ¶ added in v0.0.34
AddSearchFlag adds the --search/-s flag
func AddSystemMessageFlag ¶ added in v0.0.34
AddSystemMessageFlag adds the --system-message/-m flag
func AddToolFlags ¶ added in v0.0.34
AddToolFlags adds tool-related flags (--tools, --read-dir, --write-dir, --shell-allow)
func AddYoloFlag ¶ added in v0.0.35
AddYoloFlag adds the --yolo flag for auto-approving all tool operations
func AgentFlagCompletion ¶ added in v0.0.33
func AgentFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
AgentFlagCompletion provides shell completion for the --agent flag.
func AtAgentCompletion ¶ added in v0.0.33
func AtAgentCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
AtAgentCompletion provides completions for @agent syntax in positional args. When typing "@<TAB>", completes to "@agent-builder", "@commit", etc.
func ExtractAgentFromArgs ¶ added in v0.0.33
ExtractAgentFromArgs checks args for @agent-name syntax and returns the agent name and filtered args. Returns empty string if no @agent found.
func ImageProviderFlagCompletion ¶ added in v0.0.6
func ImageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ImageProviderFlagCompletion handles --provider flag completion for image commands
func LoadAgent ¶ added in v0.0.34
LoadAgent loads and validates an agent by name. Returns nil if agentName is empty.
func MCPFlagCompletion ¶ added in v0.0.15
func MCPFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MCPFlagCompletion provides completions for --mcp flag with comma-separated support. When typing "playwright,file<TAB>", completes to "playwright,filesystem".
func MCPServerArgCompletion ¶ added in v0.0.23
func MCPServerArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
MCPServerArgCompletion provides completions for MCP server names as positional arguments. Used by commands like "mcp test <server>" and "mcp remove <server>".
func ProviderFlagCompletion ¶ added in v0.0.6
func ProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ProviderFlagCompletion handles --provider flag completion for LLM commands
func ToolsFlagCompletion ¶ added in v0.0.25
func ToolsFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ToolsFlagCompletion provides completions for --tools flag with comma-separated support. When typing "read_file,wr<TAB>", completes to "read_file,write_file".
func UsageProviderFlagCompletion ¶ added in v0.0.34
func UsageProviderFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
UsageProviderFlagCompletion handles --provider flag completion for the usage command. Returns the specific providers that the usage command supports.
func WireSpawnAgentRunner ¶ added in v0.0.35
WireSpawnAgentRunner sets up the spawn_agent runner if the tool is enabled. This should be called after SetupToolManager.
Types ¶
type CLIFlags ¶ added in v0.0.34
type CLIFlags struct {
Provider string
Tools string
ReadDirs []string
WriteDirs []string
ShellAllow []string
MCP string
SystemMessage string
MaxTurns int
MaxTurnsSet bool // true if --max-turns was explicitly set
Search bool
Files []string // files passed via -f flag, used for agent template expansion (e.g., {{.Files}})
}
CLIFlags holds the CLI flag values that can override settings.
type CommonFlags ¶ added in v0.0.34
type CommonFlags struct {
Provider *string
Debug *bool
MCP *string
Tools *string
ReadDirs *[]string
WriteDirs *[]string
ShellAllow *[]string
SystemMessage *string
Search *bool
NativeSearch *bool
NoNativeSearch *bool
MaxTurns *int
Files *[]string
Agent *string
}
CommonFlags holds pointers to flag variables shared across commands. Each command creates its own instance with its own variables.
type ModelLister ¶ added in v0.0.8
ModelLister is an interface for providers that can list available models
type ProviderInfo ¶ added in v0.0.32
type ProviderInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Credential string `json:"credential"` // "api_key", "oauth", "none"
EnvVar string `json:"env_var,omitempty"` // Environment variable for API key
RequiresKey bool `json:"requires_key"` // Whether API key is required
SupportsListModels bool `json:"supports_list_models"`
Models []string `json:"models,omitempty"` // Curated model list
Configured bool `json:"configured"` // Whether provider is in user config
IsBuiltin bool `json:"is_builtin"` // Whether this is a built-in provider
}
ProviderInfo describes a provider for external consumption
type SessionSettings ¶ added in v0.0.34
type SessionSettings struct {
// Provider/model
Provider string
Model string
// Tool settings
Tools string
ReadDirs []string
WriteDirs []string
ShellAllow []string
ShellAutoRun bool
Scripts []string
// MCP servers (comma-separated)
MCP string
// System prompt (already expanded)
SystemPrompt string
// Behavior
MaxTurns int
Search bool
}
SessionSettings holds the resolved settings for a session, merged from config defaults, agent settings, and CLI flags.
func ResolveSettings ¶ added in v0.0.34
func ResolveSettings(cfg *config.Config, agent *agents.Agent, cli CLIFlags, configProvider, configModel, configInstructions string, configMaxTurns, defaultMaxTurns int) SessionSettings
ResolveSettings merges config, agent, and CLI flags into final settings. Priority: CLI > agent > config
func (*SessionSettings) SetupToolManager ¶ added in v0.0.34
func (s *SessionSettings) SetupToolManager(cfg *config.Config, engine *llm.Engine) (*tools.ToolManager, error)
SetupToolManager creates and configures a ToolManager from settings. Returns nil if no tools are enabled.
type SpawnAgentRunner ¶ added in v0.0.35
type SpawnAgentRunner struct {
// contains filtered or unexported fields
}
SpawnAgentRunner implements the tools.SpawnAgentRunner interface. It loads and runs sub-agents for the spawn_agent tool.
func NewSpawnAgentRunner ¶ added in v0.0.35
func NewSpawnAgentRunner(cfg *config.Config, yoloMode bool) (*SpawnAgentRunner, error)
NewSpawnAgentRunner creates a new SpawnAgentRunner.
type ToolDefinition ¶ added in v0.0.25
type ToolDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Schema json.RawMessage `json:"schema"`
}
ToolDefinition represents a tool definition passed to the MCP server