{"modulePath":"github.com/CompassLabs/cli","version":"v0.1.81","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package interactive\n\nPackage interactive prompts for declared required inputs in an interactive terminal.\n\nPackage interactive centralizes the activation policy for prompt, form, and explorer surfaces.\n\n## Constants\n\n```go\nconst PromptArgsAnnotation = \"speakeasy_prompt_args\"\n```\n\n## Functions\n\n```go\nfunc Declare(cmd *cobra.Command, spec CommandSpec) error\n```\n\n```go\nfunc Intercept(root *cobra.Command)\n```\n\n```go\nfunc IsInteractive(cmd *cobra.Command) bool\n```\n\n```go\nfunc WithPrompter(ctx context.Context, p Prompter) context.Context\n```\n\n## Types\n\n```go\ntype ArgSpec struct {\n\tName        string   `json:\"name\"`\n\tSummary     string   `json:\"summary,omitempty\"`\n\tRequired    bool     `json:\"required,omitempty\"`\n\tVariadic    bool     `json:\"variadic,omitempty\"`\n\tBodyKey     string   `json:\"body_key,omitempty\"`\n\tSatisfiedBy []string `json:\"satisfied_by,omitempty\"`\n}\n```\nArgSpec declares one promptable positional; SatisfiedBy names flags (no dashes) that replace it.\n\n```go\ntype CommandSpec struct {\n\tArgs []ArgSpec\n}\n```\n\n```go\ntype Decision struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Resolve(cmd *cobra.Command) Decision\n```\n\n```go\nfunc (d Decision) AutoExplore() bool\n```\n\n```go\nfunc (d Decision) FormMode() FormMode\n```\n\n```go\nfunc (d Decision) PromptRequiredInputs() bool\n```\n\n```go\nfunc (d Decision) ValidateDirectExplore() error\n```\n\n```go\ntype FormMode int\n```\n\n```go\nconst (\n\tFormOff FormMode = iota\n\tFormTUI\n\tFormAccessible\n)\n```\n\n```go\ntype PromptAnswer struct {\n\tSet    bool\n\tValues []string\n}\n```\n\n```go\ntype PromptField struct {\n\tID         string\n\tName       string\n\tSummary    string\n\tKind       string\n\tRequired   bool\n\tDirect     bool\n\tRepeatable bool\n\tOptions    []string\n\t// contains filtered or unexported fields\n}\n```\nPromptField IDs are \"arg:\\\u003cname\u003e\" for positionals and \"flag:\\\u003cname\u003e\" for flags.\n\n```go\ntype Prompter interface {\n\tPrompt(cmd *cobra.Command, fields []PromptField) ([]PromptAnswer, error)\n}\n```\n\n","path":"github.com/CompassLabs/cli/internal/interactive","name":"interactive","synopsis":"Package interactive prompts for declared required inputs in an interactive terminal.","isRedistributable":true}
