golang-cli
Build Reliable Go Command-Line Applications
Go command-line projects need consistent commands, configuration, output, shutdown, and testing patterns. This skill applies practical Cobra and Viper guidance with reusable Go examples.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "golang-cli" from https://skillstore.io/skills/samber-golang-cli.md and its manifest at https://skillstore.io/api/skills/samber-golang-cli/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "golang-cli". Design a deploy command with required environment and tag flags.
Expected outcome:
- A command layout with declarative argument validation.
- Required environment and tag flags with mutual-exclusion rules.
- Viper bindings and completion values for supported environments.
Using "golang-cli". Review a list command that mixes logs with pipeable output.
Expected outcome:
A review that moves records to stdout, diagnostics to stderr, and recommends selectable table, plain, and JSON formats.
Using "golang-cli". Add graceful shutdown to a server subcommand.
Expected outcome:
A design using signal-aware context cancellation, SIGINT and SIGTERM support, a shutdown timeout, and distinct handling for normal server closure.
Security Audit
SafeAll 94 static findings are false positives caused by Go syntax, Markdown formatting, Cobra identifiers, completion documentation, and benign build examples. No malicious behavior, prompt injection, data exfiltration, unsafe command execution, or covert system access was found.
Risk Factors
โก Contains scripts (12)
โ๏ธ External commands (50)
๐ Filesystem access (4)
๐ Network access (1)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/samber-golang-cli/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/samber-golang-cli?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/samber-golang-cli?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-cli/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/samber-golang-cli.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
samber. (2026). golang-cli security audit report (audit version 1) [Author version 1.3.0]. Skillstore. https://skillstore.io/skills/samber-golang-cli/audits/1BibTeX citation
@techreport{samber-samber-golang-cli-2026,
author = {samber},
title = {golang-cli security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-cli/audits/1},
note = {Author version 1.3.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-cli security audit report (audit version 1)"
version: "1.3.0"
type: report
authors:
- name: "samber"
date-released: "2026-09-06"
url: "https://skillstore.io/skills/samber-golang-cli/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-cli:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: MediumWhat You Can Build
Start a Go CLI
Create a maintainable Cobra command tree with flags, configuration, output rules, and a minimal entry point.
Extend an Existing Tool
Add subcommands, configuration sources, shell completion, or machine-readable output while preserving established project structure.
Review CLI Behavior
Check exit codes, signal handling, output streams, argument validation, and command tests for predictable automation.
Try These Prompts
Create a Cobra command named [command]. Add [arguments] and [flags]. Keep main minimal and return errors from command handlers.
Add Viper configuration to this CLI. Use prefix [prefix], optional file [path], flag bindings, defaults, and clear precedence.
Review this command for scripting. Separate stdout and stderr, add table and JSON output, define exit codes, and add shell completion.
Refactor this server command for production. Add context cancellation, SIGINT and SIGTERM handling, timed shutdown, typed errors, and command-level tests.
Best Practices
- Read the existing command tree before changing structure or shared behavior.
- Bind configurable flags explicitly and document the precedence of every configuration source.
- Test commands through Cobra interfaces so arguments, output, and errors remain observable.
Avoid
- Do not call process exit functions inside command handlers because deferred cleanup will not run.
- Do not write logs or diagnostics to stdout because they corrupt piped output.
- Do not require a configuration file when defaults and environment variables can provide valid settings.
Frequently Asked Questions
Which Go CLI libraries does this skill emphasize?
Can it help with a standard library flag application?
Does it provide complete application code?
How does it support shell scripts?
Does it cover shell completion?
Can it review an existing CLI?
Developer Details
Author
samberLicense
MIT
Author version
v1.3.0
Skillstore revision
r1
Ref
e5464e662405de6361fdde6b984f9ea865635f64
Maintenance freshness
9/8/2026
Usage
0 downloads ยท 0 views
File structure
๐ assets/
๐ examples/
๐ args.go
๐ cli_test.go
๐ completion.go
๐ config.go
๐ exit_codes.go
๐ flags.go
๐ main.go
๐ output.go
๐ root.go
๐ serve.go
๐ signal.go
๐ version.go
๐ evals/
๐ evals.json
๐ SKILL.md