Documentation
¶
Overview ¶
Package cli performs mode-defining argument parsing before expensive runtime construction, ensuring diagnostics and stdout obey the selected surface.
Index ¶
Constants ¶
const ( OutputText OutputFormat = "text" OutputJSON OutputFormat = "json" OutputStreamJSON OutputFormat = "stream-json" InputText InputFormat = "text" InputStreamJSON InputFormat = "stream-json" )
Variables ¶
This section is empty.
Functions ¶
func HeadlessRequested ¶
HeadlessRequested performs the same option/value/-- parsing and presentation inference as the application before root assigns SIGINT ownership. Invalid, informational, and standalone-MCP invocations deliberately return false because no headless model turn can start from them.
func IsUsageError ¶
func RawPrintRequested ¶
RawPrintRequested is retained for callers that specifically need to know whether -p/--print was present, rather than whether the eventual surface is headless.
Types ¶
type InputFormat ¶
type InputFormat string
type Options ¶
type Options struct {
Print bool
Version bool
Help bool
Debug bool
Verbose bool
Bare bool
TrustWorkspace bool
OutputStyle string
MCPConfig string
MCPServer bool
OutputFormat OutputFormat
InputFormat InputFormat
IncludePartial bool
ReplayUserMessages bool
JSONSchema string
SDKURL string
CWD string
Provider string
Model string
Effort string
PermissionMode string
DangerouslyBypass bool
AllowedTools []string
DisallowedTools []string
Attachments []string
MaxTurns int
MaxBudgetUSD float64
SessionID string
Resume string
Continue bool
ForkSession bool
ListProviders bool
ListSessions bool
DeleteSession string
SessionRevision string
SessionPageSize int
SessionPageToken string
NoSessionPersistence bool
OwnedProcessTree bool
SystemPrompt string
SystemPromptFile string
AppendSystemPrompt string
AppendSystemPromptFile string
Prompt string
// contains filtered or unexported fields
}
func InferPrint ¶
InferPrint applies the presentation inference that happens after argument parsing. A structured format is always headless, and redirected text output uses the one-shot adapter unless the standalone MCP host was selected.
func (Options) ProviderDiscoveryRequested ¶ added in v1.0.8
ProviderDiscoveryRequested reports whether the command line selected the provider-neutral registry discovery operation.
func (Options) SessionManagementRequested ¶ added in v1.0.7
SessionManagementRequested reports whether the command line selected a provider-free native session-management operation.
type OutputFormat ¶
type OutputFormat string
type UsageError ¶
type UsageError struct{ Message string }
func (*UsageError) Error ¶
func (e *UsageError) Error() string
func (*UsageError) Is ¶
func (e *UsageError) Is(target error) bool