golang-cli
Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool — especially for command structure, flag handling, configuration layering, version embedding, exit codes, I/O patterns, signal handling, shell completion, argument validation, and CLI uni
Supply asset profile
Coding and developer agents
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add yzfly/skills --skill golang-cli
Maintenance
fresh
Pushed today
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
12
58/100 Quality · 66/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
Trust, audit, and install readiness at a glance
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Do not auto-installTrust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Human review before install
Choose a stronger alternative or inspect the source manually before any install attempt.
Stars
12 GitHub stars
Repo activity
12 stars, 2 forks
Maintenance
Pushed today
License
MIT
Install
npx skills add yzfly/skills --skill golang-cli
Install safety
standard package or runtime install path
Permission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Review before production
- Low GitHub adoption signal
- Quality score needs review
- Permission surface needs review: secrets or environment access, shell or command execution
- GitHub adoption: 12 GitHub stars
Install readiness
Install path available
- Install path is available
- Repository evidence is available
- License is declared
- No Agent Proven outcome evidence yet
Agent-readable metadata
Machine-readable decision data for this skill.
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
- Coding agents workflows
- Claude Code teams
- builders willing to evaluate younger projects
- Inspect source files
Suited agents
Install decision
- Command
- npx skills add yzfly/skills --skill golang-cli
- Policy
- block
- Human review
- yes
Trust and risk
- Trust
- 58/100
- Audit
- 72/100
- Risk level
- Needs review
Outcome loop
- Endpoint
- /api/agent/outcome
- Event ID
- resolve
- Outcomes
- 5
Install command
npx skills add yzfly/skills --skill golang-cliDo not use when
- teams that need a vendor-supported SLA
- production agents without a repository review
- Low GitHub adoption signal
- No OpenAgentSkill engagement data yet
- High-risk permission hints: Shell or command execution, Secrets or environment access
Alternative
Last30days Skill
53.5K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
Academic Research Skills
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
GPT Researcher
28.0K Stars
npx skills add assafelovic/gpt-researcher
Alternative
DeepResearch
19.8K Stars
npx skills add Alibaba-NLP/DeepResearch
Agent safety v2
28/100 · Avoid automatic install
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Shell or command execution
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Network access
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Filesystem access
Skill may read or write project files, documents, generated artifacts, or local workspace state.
high
Secrets or environment access
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
- High-risk permission hints: Shell or command execution, Secrets or environment access
- Dependency or permission surface needs review
Install targets
Install this skill in your agent workflow
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
OpenAgentSkill CLI
Resolve policy, run the source installer safely, and report a verified install receipt.
$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install yzfly-golang-cliAgent resolve plan
Let an agent verify fit before installing.
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20golang-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20golang-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/yzfly-golang-cli/install
Agent should check
- Task fit and alternatives from Resolve API.
- Audit score, trust score, and safety policy warnings.
- Install target compatibility for Codex, Claude Code, Cursor, or CLI.
Copy prompt
Task: Use golang-cli in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/yzfly-golang-cli/install
Install command: npx skills add yzfly/skills --skill golang-cli
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Give an agent the install path, not another directory page.
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/yzfly-golang-cli/install
LLM text format
/api/skills/yzfly-golang-cli/install?format=text
Find alternatives
/api/skills/search?q=golang-cli&limit=3
Agent prompt
Use golang-cli for this task. Review https://www.openagentskill.com/api/skills/yzfly-golang-cli/install, then install with: npx skills add yzfly/skills --skill golang-cliRegistry metadata
Agent-readable profile for automatic skill selection.
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/yzfly-golang-cli
LLM text
/api/registry/manifest/yzfly-golang-cli?format=text
Install alias
/api/registry/install/yzfly-golang-cli
Recommend
/api/registry/recommend?task=Use%20golang-cli%20in%20an%20agent%20workflow&limit=3
Agent fit
Coding agents
Use-case tags
Platforms
Claude Code
Audit report
Needs review · 72/100
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Needs validation for Coding agents
Do a manual repository review before adding this to an agent workflow.
Role in stack
Needs validation
Primary fit
Coding agents
Trust label
Needs manual review
Install path
Command ready
Use when
- Coding agents workflows
- Claude Code teams
- builders willing to evaluate younger projects
Evidence
- recent repository activity
- install command or GitHub repo available
- 58/100 quality profile
review first
- Low GitHub adoption signal
- No OpenAgentSkill engagement data yet
Implementation path
- 1Install it in a sandbox agent and run one Coding agents task end to end.
- 2Compare output quality, latency, and failure behavior against at least one alternative.
- 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.
Trust profile
Do not auto-install
Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.
GitHub adoption
FIX12 GitHub stars
Stars/forks activity
FIX12 stars, 2 forks; issue activity unavailable in current metadata
Recent maintenance
PASSPushed today
License clarity
PASSMIT
Good signals
- AI review approved
- Install path is available
- Repository evidence is available
- Recently maintained repository
- Install command has no obvious high-risk pattern
- Outcome loop is ready but needs first real agent run
Review before install
- Low GitHub adoption signal
- Quality score needs review
- Permission surface needs review: secrets or environment access, shell or command execution
- GitHub adoption: 12 GitHub stars
- Stars/forks activity: 12 stars, 2 forks; issue activity unavailable in current metadata
- Dependency/runtime risk: command execution surface, credential or environment access
- Permission surface: secrets or environment access, shell or command execution
- No real agent outcome reports yet
- Human review required before unattended installation
Recommended action
Choose a stronger alternative or inspect the source manually before any install attempt.
Quality profile
Promising candidate for agent workflows
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Use this skill in these scenarios
Build and ship code
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Manage repositories
GitHub automation
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Operate local tools
Local desktop
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Add it to a complete workflow
Inspect, patch, and verify code
Coding review agent
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
Browser QA agent
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Ingest, retrieve, and cite
RAG knowledge base
A workflow for document-heavy agents that ingest files, create searchable knowledge, retrieve relevant context, and answer with grounded sources.
Alternative shortlist
Compare before you install
Similar skills that may fit this task.
Last30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
GPT Researcher
Run autonomous deep research over web and local sources
DeepResearch
Tongyi Deep Research, the Leading Open-source Deep Research Agent
Overview
--- name: golang-cli description: "Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool — especially for command structure, flag handling, configuration layering, version embedding, exit codes, I/O patterns, signal handling, shell completion, argument validation, and CLI unit testing. Also triggers when code uses cobra, viper, or urfave/cli." user-invocable: true license: MIT compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. metadata: author: samber version: "1.1.3" openclaw: emoji: "💻" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent AskUserQuestion ---
**Persona:** You are a Go CLI engineer. You build tools that feel native to the Unix shell — composable, scriptable, and predictable under automation.
**Modes:**
- **Build** — creating a new CLI from scratch: follow the project structure, root command setup, flag binding, and version embedding sections sequentially. - **Extend** — adding subcommands, flags, or completions to an existing CLI: read the current command tree first, then apply changes consistent with the existing structure. - **Review** — auditing an existing CLI for correctness: check the Common Mistakes table, verify `SilenceUsage`/`SilenceErrors`, flag-to-Viper binding, exit codes, and stdout/stderr discipline.
# Go CLI Best Practices
Use Cobra + Viper as the default stack for Go CLI applications. Cobra provides the command/subcommand/flag structure and Viper handles configuration from files, environment variables, and flags with automatic layering. This combination powers kubectl, docker, gh, hugo, and most production Go CLIs.
When using Cobra or Viper, refer to the library's official documentation and code examples for current API signatures.
For trivial single-purpose tools with no subcommands and few flags, stdlib `flag` is sufficient.
## Quick Reference
| Concern | Package / Tool | | ------------------- | ------------------------------------ | | Commands & flags | `github.com/spf13/cobra` | | Configuration | `github.com/spf13/viper` | | Flag parsing | `github.com/spf13/pflag` (via Cobra) | | Colored output | `github.com/fatih/color` | | Table output | `github.com/olekukonko/tablewriter` | | Interactive prompts | `github.com/charmbracelet/bubbletea` | | Version injection | `go build -ldflags` | | Distribution | `goreleaser` |
## Project Structure
Organize CLI commands in `cmd/myapp/` with one file per command. Keep `main.go` minimal — it only calls `Execute()`.
``` myapp/ ├── cmd/ │ └── myapp/ │ ├── main.go # package main, only calls Execute() │ ├── root.go # Root command + Viper init │ ├── serve.go # "serve" subcommand │ ├── migrate.go # "migrate" subcommand │ └── version.go # "version" subcommand ├── go.mod └── go.sum ```
`main.go` should be minimal — see [assets/examples/main.go](assets/examples/main.go).
## Root Command Setup
The root command initializes Viper configuration and sets up global behavior via `PersistentPreRunE`. See [assets/examples/root.go](assets/examples/root.go).
Key points:
- `SilenceUsage: true` MUST be set — prevents printing the full usage text on every error - `SilenceErrors: true` MUST be set — lets you control error output format yourself - `PersistentPreRunE` runs before every subcommand, so config is always initialized - Logs go to stderr, output goes to stdout
## Subcommands
Add subcommands by creating separate files in `cmd/myapp/` and registering them in `init()`. See [assets/examples/serve.go](assets/examples/serve.go) for a complete subcommand example including command groups.
## Flags
See [assets/examples/flags.go](assets/examples/flags.go) for all flag patterns:
### Persistent vs Local
- **Persistent** flags are inherited by all subcommands (e.g., `--config`) - **Local** flags only apply to the command they're defined on (e.g., `--port`)
### Required Flags
Use `MarkFlagRequired`, `MarkFlagsMutuallyExclusive`, and `MarkFlagsOneRequired` for flag constraints.
### Flag Validation with RegisterFlagCompletionFunc
Provide completion suggestions for flag values.
### Always Bind Flags to Viper
This ensures `viper.GetInt("port")` returns the flag value, env var `MYAPP_PORT`, or config file value — whichever has highest precedence.
## Argument Validation
Cobra provides built-in validators for positional arguments. See [assets/examples/args.go](assets/examples/args.go) for both built-in and custom validation examples.
| Validator | Description | | --------------------------- | ------------------------------------ | | `cobra.NoArgs` | Fails if any args provided | | `cobra.ExactArgs(n)` | Requires exactly n args | | `cobra.MinimumNArgs(n)` | Requires at least n args | | `cobra.MaximumNArgs(n)` | Allows at most n args | | `cobra.RangeArgs(min, max)` | Requires between min and max | | `cobra.ExactValidArgs(n)` | Exactly n args, must be in ValidArgs |
## Configuration with Viper
Viper resolves configuration values in this order (highest to lowest precedence):
1. **CLI flags** (explicit user input) 2. **Environment variables** (deployment config) 3. **Config file** (persistent settings) 4. **Defaults** (set in code)
See [assets/examples/config.go](assets/examples/config.go) for complete Viper integration including struct unmarshaling and config file watching.
### Example Config File (.myapp.yaml)
```yaml port: 8080 host: localhost log-level: info database: dsn: postgres://localhost:5432/myapp max-conn: 25 ```
With the setup above, these are all equivalent:
- Flag: `--port 9090` - Env var: `MYAPP_PORT=9090` - Config file: `port: 9090`
## Version and Build Info
Version SHOULD be embedded at compile time using `ldflags`. See [assets/examples/version.go](assets/examples/version.go) for the version command and build instructions.
## Exit Codes
Exit codes MUST follow Unix conventions:
| Code | Meaning | When to Use | | ----- | ----------------- | ----------------------------------------- | | 0 | Success | Operation completed normally | | 1 | General error | Runtime failure | | 2 | Usage error | Invalid flags or arguments | | 64-78 | BSD sysexits | Specific error categories | | 126 | Cannot execute | Permission denied | | 127 | Command not found | Missing dependency | | 128+N | Signal N | Terminated by signal (e.g., 130 = SIGINT) |
See [assets/examples/exit_codes.go](assets/examples/exit_codes.go) for a pattern mapping errors to exit codes.
## I/O Patterns
See [assets/examples/output.go](assets/examples/output.go) for all I/O patterns:
- **stdout vs stderr**: NEVER write diagnostic output to stdout — stdout is for program output (pipeable), stderr for logs/errors/diagnostics - **Detecting pipe vs terminal**: check `os.ModeCharDevice` on stdout - **Machine-readable output**: support `--output` flag for table/json/plain formats - **Colors**: use `fatih/color` which auto-disables when output is not a terminal
## Signal Handling
Signal handling MUST use `signal.NotifyContext` to propagate cancellation through context. See [assets/examples/signal.go](assets/examples/signal.go) for graceful HTTP server shutdown.
## Shell Completions
Cobra generates completions for bash, zsh, fish, and PowerShell automatically. See [assets/examples/completion.go](assets/examples/completion.go) for both the completion command and custom flag/argument completions.
## Testing CLI Commands
Test commands by executing them programmatically and capturing output. See [assets/examples/cli_test.go](assets/examples/cli_test.go).
Use `cmd.OutOrStdout()` and `cmd.ErrOrStderr()` in commands (instead of `os.Stdout` / `os.Stderr`) so output can be captured in tests.
## Common Mistakes
| Mistake | Fix | | --- | --- | | Writing to `os.Stdout` directly | Tests can't capture output. Use `cmd.OutOrStdout()` which tests can redirect to a buffer | | Calling `os.Exit()` inside `RunE` | Cobra's error handling, deferred functions, and cleanup code never run. Return an error, let `main()` decide | | Not binding flags to Viper | Flags won't be configurable via env/config. Call `viper.BindPFlag` for every configurable flag | | Missing `viper.SetEnvPrefix` | `PORT` collides with other tools. Use a prefix (`MYAPP_PORT`) to namespace env vars | | Logging to stdout | Unix pipes chain stdout — logs corrupt the data stream for the next program. Logs go to stderr | | Printing usage on every error | Full help text on every error is noise. Set `SilenceUsage: true`, save full usage for `--help` | | Config file required | Users without a config file get a crash. Ignore `viper.ConfigFileNotFoundError` — config should be optional | | Not using `PersistentPreRunE` | Config initialization must happen before any subcommand. Use root's `PersistentPreRunE` | | Hardcoded version string | Version gets out of sync with tags. Inject via `ldflags` at build time from git tags | | Not supporting `--output` format | Scripts can't parse human-readable output. Add JSON/table/plain for machine consumption |
## Related Skills
See `samber/cc-skills-golang@golang-project-layout`, `samber/cc-skills-golang@golang-dependency-injection`, `samber/cc-skills-golang@golang-testing`, `samber/cc-skills-golang@golang-design-patterns` skills.
Technical details
- Version
- 1.0.0
- License
- MIT
- Last updated
- Aug 23, 2026
- Published
- Aug 23, 2026
Decision snapshot
Needs validation
recent repository activity
Audit
Install review
Install and adoption review
- Security
- 72/100
- Maintenance
- 100/100
- Install
- 92/100
Agent-proven evidence
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
- Success rate
- —
- Recent failure
- —
- Outcomes
- 0
- Output quality
- —
- Failed
- 0
- Not relevant
- 0
- Installs
- 0
- Risk blocked
- 0
- Setup needed
- 0
- Production
- 0
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Add to agent workflow
Free and open source. Review the report before installing into production agents.
Growth loop
Share kit
Scenario-led draft for golang-cli, ready for a manual X post.
golang-cli: Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool... 12 stars https://www.openagentskill.com/skills/yzfly-golang-cli?ref=x
Optional reply with install command
Listing + install path for golang-cli: https://www.openagentskill.com/skills/yzfly-golang-cli?ref=x Install: npx skills add yzfly/skills --skill golang-cli
Listing source
Registry indexed
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
- Creator
- yzfly
- Source
- yzfly/skills
- Indexed by
- OpenAgentSkill community index
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
Claim this skill listing
This Registry indexed listing is attributed to yzfly but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Add the evidence badges to your README
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/yzfly-golang-cli)
[](https://www.openagentskill.com/skills/yzfly-golang-cli)
[](https://www.openagentskill.com/skills/yzfly-golang-cli/audit)
[](https://www.openagentskill.com/skills/yzfly-golang-cli)Author
yzfly
@yzfly
Tags
Platform fit
Health signals
- GitHub stars
- 12
- Quality score
- 31/100
- Last GitHub push
- Aug 23, 2026
- Framework hints
- Unknown
- OpenAgentSkill views
- 0
- Install copies
- 0
- Outbound clicks
- 0
Community signal
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Trust & safety
Do not auto-install
- GitHub adoption12 GitHub starsFIX
- Stars/forks activity12 stars, 2 forks; issue activity unavailable in current metadataFIX
- Recent maintenancePushed todayPASS
- License clarityMITPASS
- README/SKILL.md completenessMetadata includes enough usage and workflow contextPASS
- Dependency/runtime riskcommand execution surface, credential or environment accessFIX
Related skills
Last30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
53.5K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsDeepResearch
Tongyi Deep Research, the Leading Open-source Deep Research Agent
19.8K Stars