cliapp

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigCommand

func ConfigCommand() *cli.Command

ConfigCommand builds the `csp config` subcommand.

func HandleError

func HandleError(err error, version string)

HandleError prints err to stderr and exits the process. Known errors (*apperr.KnownError) are printed as a single line. Unexpected errors get an additional bug-report footer, mirroring the TypeScript implementation's handleCliError/handleCommandError.

func IsHeadless

func IsHeadless() bool

IsHeadless reports whether csp is running without an interactive terminal (either forced via CSP_HEADLESS=1, or because stdin/stdout are not TTYs).

func IsInteractive

func IsInteractive() bool

IsInteractive reports whether csp is running attached to an interactive terminal (not headless, not CI).

func PRCommand

func PRCommand() *cli.Command

PRCommand builds the `csp pr` subcommand.

func RootAction

func RootAction(ctx context.Context, cmd *cli.Command) error

RootAction implements the root `csp` command: it generates a commit message from the staged diff and prints it to stdout. It is the Go equivalent of the `main()` function in src/csp.ts.

func SetupCommand

func SetupCommand() *cli.Command

SetupCommand builds the `csp setup` subcommand.

func UpdateCommand

func UpdateCommand(version string) *cli.Command

UpdateCommand builds the `csp update` subcommand. Unlike the TypeScript implementation (which detects and shells out to npm/pnpm/yarn/bun), this downloads and installs the latest GitHub Release binary in place, since csp is now distributed as a single binary.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL