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 ProxyProbe
- type ProxyProbeResult
- type SSHRunner
- type SandboxProbe
- type SystemProxyProbe
- 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
SystemProxy SystemProxyProbe
ProxyProbe ProxyProbe
Terminal TerminalDetector
RunTUI TUIRunner
RunSSH SSHRunner
OpenControl ControllerOpener
OpenAgentRun AgentRunOpener
OpenACP ACPControllerOpener
RunACP ACPRunner
Environment []string
// contains filtered or unexported fields
}
Dependencies are process-level inputs shared by command handlers.
type ProxyProbe ¶ added in v0.1.9
type ProxyProbe func(context.Context, string) ProxyProbeResult
ProxyProbe checks that a configured proxy accepts a CONNECT tunnel. It is injectable so doctor tests do not depend on a local proxy.
type ProxyProbeResult ¶ added in v0.1.9
ProxyProbeResult is a credential-free health result for one proxy endpoint. Detail is a fixed category such as "timeout", "dial_failed", or "status_502"; it never contains the proxy URL or a server response body.
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.
type SystemProxyProbe ¶ added in v0.1.5
SystemProxyProbe returns the host:port of the operating system's HTTPS proxy, or "" when none is enabled or the platform has no such setting.