Versions in this module Expand all Collapse all v0 v0.1.1 Oct 26, 2026 v0.1.0 Oct 26, 2026 Changes in this version + const CatalogSchema + const CommandNoun + const EnvParent + const EnvRoot + var ErrNotFound = errors.New("command not found") + func Executable(fsys FS, path string) bool + func ExitCode(err error) int + func PathDirs(path string) []string + func Report(w io.Writer, prefix string, err error) int + type App struct + Args []string + Categories map[string]string + Default func(ctx context.Context, args []string) error + Env []string + FS FS + HelpText string + Name string + Path func() string + Prefixes []string + Root string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func Child(parent *App, sub string, args []string) *App + func New(name string, args []string, opts ...Option) *App + func (a *App) Add(cmds ...Command) *App + func (a *App) Catalog() *Catalog + func (a *App) CatalogDoc() CatalogDoc + func (a *App) Cmd(name, summary string, run Handler, aliases ...string) *App + func (a *App) CommandRows() []Row + func (a *App) Help(w io.Writer) + func (a *App) List(w io.Writer, entries []*Entry) + func (a *App) NotFound(word string) error + func (a *App) RootName() string + func (a *App) Run(ctx context.Context) error + func (a *App) RunEntry(ctx context.Context, e *Entry, args []string) error + func (a *App) Suggest(word string) []string + func (a *App) WriteCatalog(w io.Writer) error + func (a *App) WriteState(w io.Writer) error + type Audience string + const AudienceHuman + const AudienceMachine + type Catalog struct + Bin string + Entries []*Entry + func NewCatalog(bin string, inline []*Command, externals, shadowedExternals []External) *Catalog + func (c *Catalog) Lookup(token string) *Entry + func (c *Catalog) Resolve(word string) Resolution + type CatalogDoc struct + Bindings []any + Name string + Nouns []CatalogNoun + Pages []any + Schema int + State string + Version string + type CatalogNoun struct + Name string + Pin string + Verbs []CatalogVerb + type CatalogParam struct + Description string + Required bool + Type string + type CatalogVerb struct + Description string + Kind string + Name string + Params map[string]CatalogParam + Positional []string + Quiet bool + Rows string + type Claim struct + AliasOf string + Kind Kind + Merged bool + Name string + Source string + type Command struct + Aliases []string + Audience Audience + Category string + Children []Command + Details string + Handle Handler + Name string + Parameters []Parameter + Run func(ctx context.Context, args []string) error + Source string + Summary string + Usage string + type CommandData struct + Aliases []string + Audience Audience + Category string + Kind Kind + Path string + Prefix string + Shadows []Claim + Source string + Sub string + Summary string + type Ctx struct + App *App + Args []string + Name string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func (c *Ctx) Arg(i int, def string) string + func (c *Ctx) Input() io.ReadCloser + func (c *Ctx) Lines() iter.Seq2[string, error] + func (c *Ctx) Open(paths ...string) io.ReadCloser + func (c *Ctx) Printf(f string, a ...any) error + func (c *Ctx) Println(a ...any) error + func (c *Ctx) Sub(opts ...Option) *App + func (c *Ctx) Text() (string, error) + func (c *Ctx) Usage(synopsis string) error + type Entry struct + Aliases []string + Audience Audience + Category string + Command *Command + Kind Kind + Name string + Path string + Prefix string + Shadowed []Claim + Source string + Sub string + Summary string + type ExitError struct + Code int + Err error + func (e *ExitError) Error() string + func (e *ExitError) Unwrap() error + type External struct + Name string + Path string + Prefix string + func Discover(bin, path string, fsys FS) (found, shadowed []External) + func DiscoverAll(bins []string, path string, fsys FS) (found, shadowed []External) + type FS interface + ReadDir func(dir string) ([]fs.DirEntry, error) + Stat func(path string) (fs.FileInfo, error) + var OS FS = osFS{} + type Handler func(*Ctx) error + type Kind string + const KindExternal + const KindInline + type Option func(*App) + func WithBuiltins() Option + func WithCategories(categories map[string]string) Option + func WithDefault(run func(ctx context.Context, args []string) error) Option + func WithEnv(env []string) Option + func WithFS(fsys FS) Option + func WithPath(path string) Option + func WithPrefixes(names ...string) Option + func WithStdio(in io.Reader, out, errOut io.Writer) Option + type Parameter struct + Choices []string + Description string + Free bool + Name string + Required bool + Source string + Type string + type Resolution struct + Ambiguous bool + Candidates []*Entry + Entry *Entry + Exact bool + Query string + func (r Resolution) Resolved() bool + type Row struct + Data any + ID string + Label string + Noun string