Documentation
¶
Overview ¶
Package cli provides the Cobra command adapter for the coding application. Command handlers delegate to internal application packages and never own an agent loop.
Index ¶
- Constants
- Variables
- func ExitCode(err error) int
- func New(dependencies Dependencies) (*cobra.Command, error)
- type ACPControllerOpener
- type ACPRunner
- type AgentRunOpener
- type AgentRunRuntime
- type BuildInfo
- type ControllerOpener
- type Dependencies
- type SSHRunner
- type SandboxProbe
- type TUIRunner
- type TerminalDetector
Constants ¶
const ( ExitSuccess = 0 ExitFailure = 1 ExitUsage = 2 ExitInput = 3 ExitApproval = ExitInput ExitSecurity = 4 ExitInterrupted = 130 ExitTerminated = 143 )
Stable process exit codes for the Pips CLI.
Variables ¶
var ErrUsage = errors.New("coding cli: invalid usage")
ErrUsage means command-line input or local configuration is invalid.
Functions ¶
Types ¶
type ACPControllerOpener ¶
type ACPControllerOpener func(context.Context, coding.OpenOptions) (codingacp.Controller, error)
ACPControllerOpener opens one lifecycle controller owned by an ACP session.
type AgentRunOpener ¶
type AgentRunOpener func(context.Context, coding.OpenOptions) (AgentRunRuntime, error)
AgentRunOpener opens one Runtime suitable for an explicit user-selected Agent invocation.
type AgentRunRuntime ¶
type AgentRunRuntime interface {
RunAgent(context.Context, coding.AgentRunRequest) (subagent.Result, error)
Close(context.Context) error
}
AgentRunRuntime is the narrow lifecycle surface used by `pips agents run`. It intentionally avoids coupling the non-interactive command to the full TUI controller interface.
type BuildInfo ¶
BuildInfo is populated by release linker flags.
func ResolveBuildInfo ¶
ResolveBuildInfo completes stamped build information from the Go build metadata. Release builds inject every field with -ldflags, but `go install github.com/rsbin1178/pips/cmd/pips@<version>` cannot, so those binaries fall back to the module version and the VCS revision Go embeds in them. Values the build already stamped always win.
type ControllerOpener ¶
type ControllerOpener func(context.Context, coding.OpenOptions) (tui.Controller, error)
ControllerOpener opens the lifecycle controller consumed by the TUI.
type Dependencies ¶
type Dependencies struct {
Build BuildInfo
Paths paths.Layout
LookupEnv credential.LookupEnv
WorkingDir func() (string, error)
SandboxProbe SandboxProbe
Terminal TerminalDetector
RunTUI TUIRunner
RunSSH SSHRunner
OpenControl ControllerOpener
OpenAgentRun AgentRunOpener
OpenACP ACPControllerOpener
RunACP ACPRunner
Environment []string
}
Dependencies are process-level inputs shared by command handlers.
type SandboxProbe ¶
SandboxProbe checks the native workspace-write boundary for one Workspace. It is injectable so command tests do not depend on the host sandbox.