Lightweight Go CLI patterns using urfave/cli. Use when building CLI tools, creating commands with flags, implementing subcommands, adding before/after hooks, organizing command categories, or when user mentions Go CLI, urfave/cli, cobra alternatives, CLI flags, CLI categories.
/plugin marketplace add vanman2024/cli-builder/plugin install cli-builder@cli-builderThis skill is limited to using the following tools:
examples/EXAMPLES-INDEX.mdexamples/api-cli/README.mdexamples/api-cli/main.goexamples/db-cli/README.mdexamples/db-cli/main.goexamples/deploy-cli/README.mdexamples/deploy-cli/main.goscripts/add-command.shscripts/generate-basic.shscripts/generate-full.shscripts/generate-subcommands.shscripts/validate-cli.shtemplates/basic-cli.gotemplates/categories-cli.gotemplates/click-basic.pytemplates/commander-basic.tstemplates/context-cli.gotemplates/flags-demo.gotemplates/hooks-cli.gotemplates/subcommands-cli.goLightweight Go CLI patterns using urfave/cli for fast, simple command-line applications.
Provides battle-tested patterns for building production-ready CLI tools in Go using urfave/cli v2. Focus on simplicity, speed, and maintainability over complex frameworks like Cobra.
Use templates/basic-cli.go for simple single-command CLIs:
Use templates/subcommands-cli.go for multi-command CLIs:
Use templates/flags-demo.go for comprehensive flag examples:
Use templates/categories-cli.go for organized command groups:
Use templates/hooks-cli.go for lifecycle management:
Use templates/context-cli.go for shared state:
scripts/generate-basic.sh <app-name>
scripts/generate-subcommands.sh <app-name>
scripts/generate-full.sh <app-name>
scripts/add-command.sh <app-name> <command-name>
scripts/add-flag.sh <file> <flag-name> <flag-type>
scripts/validate-cli.sh <project-path>
templates/basic-cli.go
templates/subcommands-cli.go
templates/flags-demo.go
templates/categories-cli.go
templates/hooks-cli.go
templates/context-cli.go
templates/commander-basic.ts
templates/oclif-basic.ts
templates/click-basic.py
templates/typer-basic.py
examples/db-cli/
examples/deploy-cli/
examples/api-cli/
examples/file-cli/
app.Before = func(c *cli.Context) error {
configPath := c.String("config")
if configPath != "" {
return loadConfig(configPath)
}
return nil
}
&cli.StringFlag{
Name: "token",
Aliases: []string{"t"},
Usage: "API token",
EnvVars: []string{"API_TOKEN"},
}
&cli.StringFlag{
Name: "host",
Required: true,
Usage: "Database host",
}
type AppContext struct {
Config *Config
DB *sql.DB
}
app.Before = func(c *cli.Context) error {
ctx := &AppContext{
Config: loadConfig(),
}
c.App.Metadata["ctx"] = ctx
return nil
}
Run scripts/validate-cli.sh to check:
See examples/cobra-migration/ for:
See examples/click-migration/ for:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.