
Go CLI
Guides an AI agent to build Go command-line tools with clean flags, streams and exit codes
Go CLI is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 90
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Go CLI
This skill gives the agent a set of conventions for writing command-line programs in Go. It covers a testable main structure where the logic lives in a run function that takes context, arguments and streams, so tests can drive it without launching a subprocess. It also explains how Ctrl+C is wired to cancel long operations through a signal-aware context.
The guidance covers keeping data on stdout and diagnostics on stderr, a documented exit code scheme (0 success, 2 usage errors, 130 after interrupt), and when subcommands are better served by the standard library versus Cobra. It also addresses when Viper is worth adding for layered configuration, plus machine-readable output, color handling for non-terminal use, version reporting from build info and shell completions.
The skill is written for Go projects and expects the Go toolchain to be available. Its allowed tools include running go and gofmt, and a reference file holds extra material on exit-code mapping, golden-file and testscript tests, versioning and completions.
When your agent uses it
Build command-line tools in Go: flag handling, subcommands, stdin/stdout discipline, exit codes, signal handling, and when Cobra/Viper earn their weight over the standard library. Use when: "build a CLI", "add a subcommand", "parse flags", "exit codes", "handle Ctrl+C", "cobra command", "read from stdin", "CLI UX". Not for: HTTP APIs (go-api-design), scaffolding (go-project-layout), service configuration (go-architecture-review).
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*)(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 2 files (10 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.
What it does
- Testable main structure
- Shows how to put program logic in a run function that accepts args and streams, keeping main minimal.
- Stdout and stderr discipline
- Explains separating program data from logs, progress and warnings so output pipes cleanly.
- Exit code conventions
- Lays out a consistent mapping of success, usage errors and tool-specific failures to exit codes.
- Signal handling
- Covers cancelling work on Ctrl+C with a signal-aware context and forcing exit on a second press.
- Flags and subcommands
- Guides flag design, safe defaults, and when to use the standard library or Cobra for commands.
- Testing and versioning
- Describes testing with buffers, golden files and testscript, and reporting versions from build info.
Good for
- Build a command-line tool that reads from stdin and writes results to stdout
- Add a subcommand with its own flags to an existing Go CLI
- Make a Go tool return correct exit codes for scripts to branch on
- Handle Ctrl+C gracefully in a long-running Go command
- Decide whether a Go CLI needs Cobra or the standard flag package
- Add a version command that reads Go build information
Go CLI FAQ
What does the skill need to run?
It requires the Go toolchain. The skill's allowed tools include Read, Edit, Write, Glob, Grep, and running go and gofmt.
When should the agent use Cobra instead of the standard library?
The skill suggests Cobra when nested commands, generated help and completions, and many flags justify the dependency. For a handful of commands it recommends the standard library.
Does Go CLI cover scaffolding a new Go project or HTTP APIs?
No. The description says HTTP APIs, project scaffolding and service configuration are handled by other skills.
What exit codes does Go CLI recommend?
Zero for success, 2 for usage errors, 130 after Ctrl+C, and 1 or documented tool-specific codes for other failures.
Does Go CLI run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Go CLI?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Go CLI?
The closest alternatives to Go CLI are Domain CLI, CLI build, Go backend, Go coding standards and Go test quality.
Where this comes from
- Description: from the skill's own SKILL.md.
More from eduardo-sl/go-agent-skills

Guides Go agents in designing HTTP REST APIs, handlers, middleware and shutdown
- Open source
- 90 GitHub stars
- Developer tools

Reviews Go project structure, dependency direction and module boundaries
- Open source
- 90 GitHub stars
- Developer tools

Guides Go code toward constructor injection, explicit wiring and no global state
- Open source
- 90 GitHub stars
- Developer tools

Guides Go code toward idiomatic design patterns like functional options and factories
- Open source
- 90 GitHub stars
- Developer tools

Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits
- Open source
- 90 GitHub stars
- Developer tools

Guides an AI agent through production gRPC services in Go: protos, errors, streaming
- Open source
- 90 GitHub stars
- Developer tools




