Go CLI Testing

SkillFiles & storage

Design, implement, stabilize, and review Go CLI tests across fresh command trees, pure logic, table-driven cases, streams, typed configuration, files, environment, function-backed HTTP fakes, repositories, subprocesses, capability profiles, race checks, and artifact behavior. Use when adding command tests, diagnosing flaky Go tests, choosing test boundaries, or verifying human-, agent-, and CI-facing CLI contracts.

Use Go CLI Testing in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Go CLI Testing and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Go CLI Testing skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Go CLI TestingStart free

What this skill tells your AI

The instructions your AI receives, as published by hashgraph-online/awesome-codex-plugins in plugins/LVTD-LLC/skills/skills/go-cli-testing/SKILL.md and read by ahel’s review.

Test observable behavior at the narrowest boundary that proves it. Isolate every mutable resource and reserve executable tests for process-level semantics.

Core Workflow

  1. Inventory success, invalid, boundary, dependency-failure, and cancellation behavior.
  2. Map each case to a pure, command, adapter, integration, or binary test.
  3. Inject arguments, streams, configuration, clocks, and effectful dependencies.
  4. Isolate files, environment, servers, repositories, ports, and subprocesses.
  5. Assert stdout, stderr, exit behavior, and errors according to the public contract.
  6. Gate live or platform-specific tests and make their changes reversible.
  7. Run standard, race, tagged, and relevant platform checks.
  8. Execute every supported build profile and smoke-test final artifacts.
  9. Interpret coverage gaps without treating execution as behavioral proof.

Read Next

TaskLoad
Build or overhaul a CLI test suiteguidelines.md, workflows/test-cli-command.md
Stabilize a flaky asynchronous testworkflows/stabilize-flaky-test.md
Write focused command testsreferences/cli-testing/rules.md, references/cli-testing/examples.md
Add subprocess, HTTP, repository, or integration testsreferences/cli-testing/patterns.md
Review coverage, isolation, or flakinessreferences/cli-testing/checklist.md
Choose the right test boundaryreferences/cli-testing/knowledge.md
Benchmark or profile performanceUse go-performance-testing

Guardrails

  • Do not mutate developer data or depend on fixed temporary paths and ports.
  • Do not run parallel tests that replace process-global state.
  • Replace timing sleeps with synchronization, deadlines, or fake clocks.
  • Use testing/synctest only when the minimum Go version supports it and the behavior fits an isolated bubble.
  • Inspect wrapped errors structurally unless exact diagnostics are contractual.
  • Prefer one valuable executable flow over many slow end-to-end tests.
  • Construct a fresh command tree and typed configuration for every test.
  • Assert both Execute errors and stream output.

Source Notes

Guidance is transformed and paraphrased from testing material throughout Ricardo Gerardi, Powerful Command-Line Applications in Go (Pragmatic Bookshelf, 2021), especially Chapters 1-7 and 11. Examples are original.

Book: https://pragprog.com/titles/rggo/powerful-command-line-applications-in-go/

Modern test APIs should be verified against https://pkg.go.dev/testing and the current Go documentation before implementation.

Fresh command-tree, HTTP fake, configuration, and build-profile guidance also incorporates transformed material from Marian Montagnino, Building Modern CLI Applications in Go (Packt, 2023), especially Chapters 4, 6, and 11.

Subtest, coverage, parser, concurrency, HTTP server, and SQL adapter guidance also incorporates transformed material from Inanc Gumus, Go by Example: Programmer's Guide to Idiomatic and Testable Programs (Manning, 2025), Chapters 2-10.

Test categorization, race/shuffle execution, deterministic time, iotest, and benchmark-correctness guidance also incorporates transformed material from Teiva Harsanyi, 100 Go Mistakes and How to Avoid Them (Manning, 2022), Chapter 11.

Signals

GitHub stars
1k
Forks
316
Last commit
Oct 2026
Advanced
Item type
skill
Key
go-cli-testing
Source
github.com/hashgraph-online/awesome-codex-plugins