golang-cli
CLAWHUB · Unverified
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. For cobra-specific APIs → See `samber/cc-skills-golang@golang-spf13-cobra` skill; for viper configuration layering → See `samber/cc-skills-golang@golang-spf13-viper` skill.
- 62
- Rank
- 84
- Safety
- 1.4k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 10, 2026
- Adoption signal
- 1.4K downloadsadoption · Oct 10, 2026
- Latest release
- 1.3.0release · Aug 20, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.3.0release
golang-cli 1.3.0 - Updated version metadata to 1.3.0. - Added a "paths" field to scope the skill to Go source files. - Expanded compatibility note to include Codex and similar harnesses. - Removed the skill-card.md file. - Minor metadata and formatting improvements.
Observed Aug 20, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s173arkhs3131fq5jf769qq75583hdgt:golang-cli- Install using `clawhub skill install s173arkhs3131fq5jf769qq75583hdgt:golang-cli` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/samber/golang-cli before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-cli/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
146,412 characters of source documentation, loaded on request.
Extracted files
4 files captured from the source.
SKILL.md
---
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. For cobra-specific APIs → See `samber/cc-skills-golang@golang-spf13-cobra` skill; for viper configuration layering → See `samber/cc-skills-golang@golang-spf13-viper` skill."
user-invocable: true
license: MIT
compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang.
metadata:
author: samber
version: "1.3.0"
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
paths:
- "**/*.go"
---
**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` minima_meta.json
{
"ownerId": "kn72rhnkwjfeex9wr1n7y24qa983cjn3",
"slug": "golang-cli",
"version": "1.3.0",
"publishedAt": 1787235882644
}skill-card.md
## Description: Golang CLI helps agents build, modify, and review Go command-line tools, including command structure, flags, configuration, versioning, exit codes, I/O, signal handling, completions, argument validation, and tests. This skill is ready for commercial/non-commercial use. ## Publisher: [samber](https://clawhub.ai/user/samber) ### License/Terms of Use: MIT-0 ## Use Case: Developers and engineers use this skill to guide agents that create, extend, or review Go CLI applications. It focuses on Cobra/Viper command structure, configuration layering, Unix-friendly output, shell completions, graceful shutdown, and CLI test patterns. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The skill may guide an agent to edit Go CLI code and run Go, lint, or git commands. Mitigation: Review proposed file edits and commands before execution, especially in repositories with production release workflows. Risk: Proposed git commands could publish changes or rewrite repository history. Mitigation: Require explicit human review before running git push, force-push, reset, rebase, or history-rewriting commands. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/samber/skills/golang-cli) - [Project homepage](https://github.com/samber/cc-skills-golang) - [Cobra](https://github.com/spf13/cobra) - [Viper](https://github.com/spf13/viper) ## Skill Output: **Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance] **Output Format:** [Markdown with Go code examples and inline shell commands] **Output Parameters:** [1D] **Other Properties Related to Output:** [May include file edits, test guidance, and review findings for Go CLI projects.] ## Skill Version(s): 1.3.0 (source: server release metadata and SKILL.md frontmatter) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
evals/evals.json
[
{
"id": 1,
"name": "minimal-main-and-execute",
"description": "Tests that main.go is minimal and only calls Execute(), with os.Exit handled in main not inside commands",
"prompt": "Create the entry point for a Go CLI application called 'deploy' using Cobra. The app should have a root command and a 'push' subcommand. Write main.go and root.go.",
"trap": "Model puts configuration logic, flag parsing, or complex setup directly in main.go instead of keeping it minimal. May also call os.Exit inside RunE instead of returning errors.",
"assertions": [
{
"id": "1.1",
"text": "main.go only calls Execute() (or rootCmd.Execute()) and os.Exit on error — no configuration, flag setup, or business logic in main()"
},
{
"id": "1.2",
"text": "The root command sets SilenceUsage: true to prevent printing full usage text on every error"
},
{
"id": "1.3",
"text": "The root command sets SilenceErrors: true to control error output format"
},
{
"id": "1.4",
"text": "Subcommands do NOT call os.Exit() inside RunE — they return errors and let main() decide the exit code"
},
{
"id": "1.5",
"text": "The push subcommand is registered via rootCmd.AddCommand() in an init() function or setup function"
}
]
},
{
"id": 2,
"name": "viper-config-layering",
"description": "Tests proper Viper configuration precedence: flags > env > config file > defaults, with env prefix and config-file-not-required",
"prompt": "I'm building a Go CLI server tool with Cobra. It needs a --port flag (default 3000) that can also be set via the MYSERVER_PORT env var or a config file at ~/.myserver.yaml. Write the configuration setup code.",
"trap": "Model doesn't bind flags to Viper (so flags and env/config are disconnected), forgets SetEnvPrefix (causing env var collisions), or crashes when no config file exists instead of ignoring ConfigFileNotFoundError.",
"assertions": [
{
"id": "2.1",
"text": "Calls viper.BindPFlag to bind the port flag to Viper, ensuring viper.GetInt('port') returns the flag value when set"
},
{
"id": "2.2",
"text": "Sets an env prefix with viper.SetEnvPrefix('MYSERVER' or similar) to namespace env vars and avoid collisions"
},
{
"id": "2.3",
"text": "Calls viper.AutomaticEnv() to enable automatic env var binding"
},
{
"id": "2.4",
"text": "Handles viper.ConfigFileNotFoundError gracefully (ignores it) — config file is optional, not crashing when absent"
},
{
"id": "2.5",
"text": "The precedence order is correct: CLI flags > environment variables > config file > defaults"
}
]
},
{
"id": 3,
"name": "persistent-pre-run-config-init",
"description": "Tests that configuration initialization happens in PersistentPreRunE on the root commanAionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-samber-golang-cli. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about golang-cli. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-samber-golang-cli, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/samber/skills/golang-cli",
"sourceUrl": "https://clawhub.ai/samber/skills/golang-cli",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T13:45:51.724Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-cli/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-cli/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T13:45:51.724Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.4K downloads",
"href": "https://clawhub.ai/samber/golang-cli",
"sourceUrl": "https://clawhub.ai/samber/golang-cli",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T13:45:51.724Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.3.0",
"href": "https://clawhub.ai/samber/golang-cli",
"sourceUrl": "https://clawhub.ai/samber/golang-cli",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-20T14:24:42.644Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-cli/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-cli/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.3.0",
"description": "golang-cli 1.3.0 - Updated version metadata to 1.3.0. - Added a \"paths\" field to scope the skill to Go source files. - Expanded compatibility note to include Codex and similar harnesses. - Removed the skill-card.md file. - Minor metadata and formatting improvements.",
"href": "https://clawhub.ai/samber/golang-cli",
"sourceUrl": "https://clawhub.ai/samber/golang-cli",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-08-20T14:24:42.644Z",
"isPublic": true
}
]
}Record generated Nov 23, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-samber-golang-cli/run-check
