{"modulePath":"github.com/nuitsjp/commit-spark","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\nPackage cli wires commit-spark's command-line surface and orchestrates its commands. All external effects reach it through the injected Git and Codex interfaces, so the command flows are unit-testable with fakes.\n\n## Functions\n\n```go\nfunc DefaultOpenBrowser(ctx context.Context, target string) error\n```\nDefaultOpenBrowser opens target in the OS default browser.\n\n## Types\n\n```go\ntype App struct {\n\tVersion string\n\n\tGit   Git\n\tCodex Codex\n\n\t// ConfigPath is the absolute path to the config file. ConfigDefaults holds\n\t// the effective defaults (including the OS-detected locale) that a missing\n\t// config key falls back to.\n\tConfigPath     string\n\tConfigDefaults config.Config\n\n\tStdin  io.Reader\n\tStdout io.Writer\n\tStderr io.Writer\n\n\t// Interactive is true when attached to a TTY (decided once in main).\n\tInteractive bool\n\n\t// OpenBrowser opens a URL; main wires DefaultOpenBrowser.\n\tOpenBrowser func(ctx context.Context, url string) error\n}\n```\nApp holds every dependency and configuration the commands need.\n\n```go\nfunc (a *App) PrintError(err error)\n```\nPrintError writes err to Stderr. A \\*apperr.UserError is shown as a single line; any other error additionally gets a version + bug-report footer.\n\n```go\nfunc (a *App) Run(ctx context.Context, args []string) error\n```\nRun builds the command tree and executes it with the given arguments (args\\[0] is the program name).\n\n```go\ntype Codex interface {\n\tGenerate(ctx context.Context, req codex.Request) (string, error)\n}\n```\nCodex is the sole path to the LLM. codex.Client satisfies it.\n\n```go\ntype Git interface {\n\tRepoRoot(ctx context.Context) (string, error)\n\tStageAll(ctx context.Context) error\n\tStagedDiff(ctx context.Context, excludes []string) (*git.StagedDiff, error)\n\tCommit(ctx context.Context, message string) error\n\tPush(ctx context.Context) error\n\tCurrentBranch(ctx context.Context) (string, error)\n\tRemoteURL(ctx context.Context, name string) (string, error)\n\tDefaultBranch(ctx context.Context) (string, error)\n\tDiffRange(ctx context.Context, rangeSpec string) (string, error)\n\tPushUpstream(ctx context.Context, branch string) error\n}\n```\nGit is the set of git operations csp needs. \\*git.Client satisfies it; tests inject a fake.\n\n","path":"github.com/nuitsjp/commit-spark/internal/cli","name":"cli","synopsis":"Package cli wires commit-spark's command-line surface and orchestrates its commands.","isRedistributable":true}
