Documentation
¶
Overview ¶
Package cli builds the cobra command tree and maps errors to exit codes.
Index ¶
- Constants
- func Execute(ctx context.Context, d *app.Deps, args []string) int
- func Main(ctx context.Context, d *app.Deps, args []string) int
- func NewRootCmd(d *app.Deps) *cobra.Command
- func Run(ctx context.Context, args []string, stdout, stderr io.Writer) int
- func ServeMCP(ctx context.Context, d *app.Deps, args []string, ...) error
Constants ¶
const ( ExitOK = 0 ExitError = 1 ExitUsage = 2 ExitFindings = 3 // --fail-on matched ExitAuth = 4 ExitInterrupted = 130 )
Exit codes, as listed in docs/engineering/engineering-standards.md.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute runs the command line in args (without the program name) and returns the exit code.
func Main ¶ added in v0.2.0
Main is Execute for a whole process. It also answers carapace's completion requests, which changes package-level state, so in-process tests call Execute instead.
func NewRootCmd ¶
NewRootCmd returns the full command tree. scripts/gendocs uses it.
Types ¶
This section is empty.