Documentation
¶
Overview ¶
Package cmdmeta attaches machine-readable metadata to cobra commands and flags, so tooling (the command catalog) can describe the CLI without parsing help text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Leaves ¶
Leaves returns the commands an agent can run: runnable, non-hidden commands under root, skipping cobra's help and completion commands. Pure groups (a runnable parent that only prints help and carries no metadata) are left out. A parent that carries metadata is kept, since it does real work itself: a TUI entry point such as bare `ofga`, or `model test` with its subcommands.
Types ¶
type Meta ¶
type Meta struct {
// RequiresStore: the command resolves a store ID from --store-id, the
// environment or the profile, and fails without one. An ID taken as a
// positional argument (stores delete <store-id>) is part of the usage
// instead and doesn't count.
RequiresStore bool
// RequiresModel: the same for a model ID and --model-id. A command that
// falls back to the latest model is false, as is one that takes the ID
// as a positional argument (model get <model-id>).
RequiresModel bool
// Mutates: the command changes server state (stores, models, tuples,
// assertions), local CLI config or files in the working tree (such as a
// scaffolded workspace). An output file the caller names with a flag such
// as --output-file or --cursor-file doesn't count. Dry runs and
// unconfirmed runs still count as mutating commands.
Mutates bool
// InteractiveOnly: the command is a TUI entry point.
InteractiveOnly bool
}
Meta describes what a leaf command needs and does.