golang-cli

golang-cli is a skill for Claude Code from alexastrum/skl. It costs 126 tokens per session (2,329 once invoked), scanned A, a copy of golang-cli, MIT.

Guidance for building and reviewing command-line programs in Go, the programming language. It covers commands, flags, configuration, input and output, signals, and tests.

In plain words
What is it for?
Creating or extending Go CLI commands, adding flags and configuration, setting exit codes, handling signals, adding shell completion, and writing CLI tests.
Why use it?
It helps a Go command-line tool behave predictably in shells, scripts, automation, and error cases.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code; installed under .agents/ (shared by several agents).

Good fit Creating or extending Go CLI commands, adding flags and configuration, setting exit codes, handling signals, adding shell completion, and writing CLI tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexastrum/skl/golang-cli
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alexastrum/skl --skill golang-cli
Clone the repo
git clone --depth 1 https://github.com/alexastrum/skl

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for golang-cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexastrum/skl/golang-cli/github.svg)](https://agentmods.dev/skills/alexastrum/skl/golang-cli)
Your own site
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-cli"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/golang-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for golang-cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-cli"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/golang-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,329 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 97% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00126 $0.02329
Opus 5.5 $0.00050 $0.00932
Sonnet 5.5 $0.00025 $0.00466
Haiku 4.5 $0.00013 $0.00233

Measured 1mo ago against content hash 518891186ce2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

golang-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

97% identical to golang-cli — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/golang-cli/SKILL.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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().

Read the full file on GitHub · 206 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 206 lines · 126 tokens per session scan A 518891186ce2

Subscribe to this mod's changes

golang-cli is a skill published in the GitHub repository alexastrum/skl (10 stars, last pushed 4mo ago), licensed MIT. It adds 126 tokens to every session and 2,329 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 97% identical to golang-cli, differing in 6 lines, and is treated as a copy.

Related

Other skills, from other repositories

go

Use when writing, reviewing, testing, or shipping Go code and HTTP services: idioms, %w error wrapping, goroutine/context/errgroup concurrency, net/http 1.22 routing, log/slog, project layout, table-driven tests, Go hardening. NOT language-agnostic threat modeling (that is secure-coding), NOT Dockerfile/CI shipping…

ericrisco/rsc-harness · 86 tokens

go-127

What changed in Go 1.27 (released August 2026) and how it changes the way Go is written in pi-go. Use this skill when writing or reviewing Go that could use a 1.27 feature, when bumping the go directive in go.mod, when a build or test behaves differently after a toolchain upgrade, or when code-guidelines-go points…

dimetron/pi-go · 177 tokens

bubbletea-testing

Use this skill whenever writing tests for Bubble Tea (charmbracelet/bubbletea) TUI applications in Go. Triggers include any mention of testing Bubble Tea models, teatest, golden file testing for TUIs, testing tea.Cmd or tea.Msg, snapshot testing terminal output, or writing tests for any Go CLI/TUI that uses the Elm…

dimetron/pi-go · 139 tokens

design-review

Deep design review of Go codebase — naming, structure, consistency, interfaces, error handling. Scores each dimension and provides actionable fixes.

dimetron/pi-go · 30 tokens

demo-subagents-tui

This skill demonstrates how to use the agent tool to spawn subagents within the pi-go TUI for parallel task execution. Subagents are autonomous child processes that run concurrently, enabling efficient parallelization of independent tasks.

dimetron/pi-go · 0 tokens

pi-loop-forensics

Diagnose pi-go agent loops and degenerate turns — "agent loop aborted", runaway thinking with no tool calls, repeated phrases. Discriminates genuine model repetition collapse from a race, a tool-parse failure, or a too-low guard, and A/B replays a seed session across providers.

dimetron/pi-go · 65 tokens