Documentation
¶
Overview ¶
Package cli provides small helpers downstream agents share with the canonical cmd/glue runner. Today the only helper is StandardFlags, a flag.FlagSet wiring for the six options every multi-provider Glue agent accepts: --provider, --model, --id, --store, --work, --max-turns.
The package is intentionally thin: a full CLI runner lives at cmd/glue. cli is for downstream agents that want to share the flag shape without re-registering each variable themselves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StandardFlagDefaults = StandardConfig{
Provider: "nvidia",
Model: "",
ID: "default",
Store: ".glue/sessions",
Work: ".",
MaxTurns: 32,
}
StandardFlagDefaults are the values RegisterStandardFlags wires by default. Exported so agents that want to override one or two without re-registering everything can read the canonical default.
Functions ¶
func RegisterStandardFlags ¶
func RegisterStandardFlags(fs *flag.FlagSet, defaults *StandardConfig) func() StandardConfig
RegisterStandardFlags wires the six common flags onto fs and returns a getter that reads them after fs.Parse(). Defaults match StandardFlagDefaults. Help text mentions failover semantics so agents don't need to redocument them.
Callers may override individual defaults by passing a non-nil *StandardConfig — only fields you set are applied; zero values fall back to StandardFlagDefaults. Pass nil to use defaults verbatim.
Types ¶
type StandardConfig ¶
type StandardConfig struct {
// Provider is the provider list. A bare name selects one provider;
// a comma-separated list (e.g. "nvidia,openrouter,gemini") asks
// the agent to fail over to the first one whose API key is set.
// Pair with glue.WithFailover and the providers registry to act
// on the list.
Provider string
// Model is the model id. Empty means "use the active provider's
// DefaultModel from the registry."
Model string
// ID is the session id used for file-backed transcripts.
ID string
// Store is the directory passed to stores/file.New.
Store string
// Work is the working directory used for AGENTS.md / skills /
// roles discovery, and as the cwd for filesystem and git tools.
Work string
// MaxTurns is the loop budget cap for one prompt; zero or negative
// is forwarded as-is so glue.AgentOptions / RunRequest can fall
// back to their own default.
MaxTurns int
}
StandardConfig holds the parsed values of the six common flags. Read it via the closure returned from RegisterStandardFlags after calling fs.Parse.