Documentation
¶
Index ¶
- Constants
- Variables
- func FilterTreeFlag(args []string) []string
- func HasTreeFlag(args []string) bool
- func IsInteractive() bool
- func PrintCommandTree(w io.Writer, cmd *cobra.Command)
- func RegisterAPI(rootCmd *cobra.Command)
- func RegisterAuth(rootCmd *cobra.Command)
- func RegisterCache(rootCmd *cobra.Command)
- func RegisterClear(rootCmd *cobra.Command)
- func RegisterCompare(rootCmd *cobra.Command)
- func RegisterCompletion(rootCmd *cobra.Command)
- func RegisterConfig(rootCmd *cobra.Command)
- func RegisterDocs(rootCmd *cobra.Command)
- func RegisterExport(rootCmd *cobra.Command)
- func RegisterImport(rootCmd *cobra.Command)
- func RegisterMigrate(rootCmd *cobra.Command)
- func RegisterSkills(rootCmd *cobra.Command)
- func RegisterVersion(rootCmd *cobra.Command)
- func RequireInteractive() error
- func ResolveTreeTarget(root *cobra.Command, args []string) *cobra.Command
- func SetBuildInfo(info BuildInfo)
- func ShouldSkipConfirm(cmd *cobra.Command, force bool) bool
- func WithGlobalFlags(ctx context.Context, flags GlobalFlags) context.Context
- type BuildInfo
- type GlobalFlags
Constants ¶
const TreeFlagName = "tree"
TreeFlagName is the persistent flag name that triggers a tree dump.
Variables ¶
var ErrNonInteractiveRequired = errors.New("non-interactive mode required: provide flags to skip prompts or run in a terminal")
ErrNonInteractiveRequired is returned when a command would prompt but stdin is not a TTY and no non-interactive bypass flags were provided.
Functions ¶
func FilterTreeFlag ¶ added in v0.2.15
FilterTreeFlag returns argv with the --tree token stripped so cobra's command resolution can ignore it.
func HasTreeFlag ¶ added in v0.2.15
HasTreeFlag reports whether argv requests a command-tree dump.
func IsInteractive ¶ added in v0.3.1
func IsInteractive() bool
IsInteractive returns true when huh prompts can be shown.
func PrintCommandTree ¶ added in v0.2.15
PrintCommandTree prints the command, its subcommands, and their flags as a connected tree. Long lines are wrapped with prefix continuation so the vertical bars are never broken by overflowing text.
func RegisterAPI ¶
RegisterAPI registers the API command and all subcommands.
func RegisterAuth ¶ added in v0.1.17
RegisterAuth registers the auth command and all subcommands.
func RegisterCache ¶ added in v0.2.0
RegisterCache registers the cache command group.
func RegisterClear ¶ added in v0.2.0
RegisterClear registers the clear command.
func RegisterCompare ¶ added in v0.1.6
RegisterCompare registers the compare command.
func RegisterCompletion ¶
RegisterCompletion registers the completion command.
func RegisterConfig ¶
RegisterConfig registers the config command.
func RegisterDocs ¶ added in v0.3.5
RegisterDocs registers documentation generation commands.
func RegisterExport ¶
RegisterExport registers the export command.
func RegisterImport ¶
RegisterImport registers the import command.
func RegisterMigrate ¶
RegisterMigrate registers the migrate command.
func RegisterSkills ¶ added in v0.2.0
RegisterSkills registers the skills command group.
func RegisterVersion ¶
RegisterVersion registers the version command.
func RequireInteractive ¶ added in v0.3.1
func RequireInteractive() error
RequireInteractive fails when not a TTY (for CI/scripts).
func ResolveTreeTarget ¶ added in v0.2.15
ResolveTreeTarget locates the command the user is asking about. Positional args and unknown flags are ignored — the tree dump describes shape, not invocation.
func SetBuildInfo ¶
func SetBuildInfo(info BuildInfo)
SetBuildInfo sets build information (called from main.go)
func ShouldSkipConfirm ¶ added in v0.3.1
ShouldSkipConfirm returns true when the user passed --force, --yes, or global --yes.
func WithGlobalFlags ¶
func WithGlobalFlags(ctx context.Context, flags GlobalFlags) context.Context
WithGlobalFlags adds global flags to the context.
Types ¶
type BuildInfo ¶
type BuildInfo struct {
Version string
BuildDate string
Commit string
GoVersion string
Platform string
}
BuildInfo holds build-time information
type GlobalFlags ¶
type GlobalFlags struct {
ConfigFile string
ClientID string
ClientSecret string
APIURL string
TargetClientID string
TargetClientSecret string
TargetAPIURL string
Debug bool
NoColor bool
Quiet bool
Verbose bool
Yes bool
NoEnvFile bool
}
GlobalFlags holds global CLI flags.
func GetGlobalFlags ¶
func GetGlobalFlags(ctx context.Context) GlobalFlags
GetGlobalFlags retrieves global flags from context.
Source Files
¶
- api.go
- auth.go
- cache.go
- clear.go
- compare.go
- completion.go
- config.go
- context.go
- docs.go
- error_handling.go
- error_limits.go
- export.go
- export_output.go
- import.go
- migrate.go
- migrate_output.go
- prompts.go
- skills.go
- skills_auth.go
- skills_crud.go
- skills_groups.go
- skills_output.go
- skills_prompts.go
- skills_selection.go
- tree.go
- validation.go
- version.go