golang-cli

Prüfen · 58
Im Registry indexiert

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 uni

Verified installs0
Stars12
Version1.0.0
Qualität58/100 · Vielversprechend
Vertrauen58/100 · Do not auto-install
Audit72/100 · Prüfung nötig

Asset-Profil

Coding- und Entwickler-Agents

Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.

Bereich ansehen

Szenario

Coding-Agents

I need a coding agent that can understand a repository, edit code, and review pull requests.

Agent-Fit

Claude Code + CLI + Codex

Geeignet für Codex, Claude Code, Cursor, CLI oder benutzerdefinierte Agents.

Installieren

Bereit

npx skills add yzfly/skills --skill golang-cli

Wartung

Aktuell

Heute gepusht

Risiko

Prüfung nötig

Dependency or permission surface needs review

GitHub-Qualität

12

58/100 Qualität · 66/100 Vertrauen

Abdeckungs-Tags

CodingCoding-AgentsRechercheagent-skill

Review-Notizen

Dependency or permission surface needs review · Permission surface may require sandboxing

Agent-Adoptionskarte

Vertrauen, Audit und Installationsbereitschaft auf einen Blick

Diese Werte kombinieren öffentliche Repository-Metadaten, OpenAgentSkill-Reviewsignale, Wartungsaktualität und Installationsbereitschaft. Sie helfen bei der Vorauswahl, ersetzen aber keine menschliche Prüfung.

Qualität

Vielversprechend
58

Useful candidate, but compare it with alternatives before adopting.

Vertrauen

Do not auto-install
58

Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.

Audit

Prüfung nötig
72

Maschinenlesbare Prüfung von Installationsbereitschaft, Sicherheitsmetadaten, Wartung und Akzeptanzrisiko.

OpenAgentSkill Trust Score v5

Menschliche Prüfung vor Installation

Choose a stronger alternative or inspect the source manually before any install attempt.

CodexClaude CodeCursorOpenAgentSkill CLI

Stars

12 GitHub-Stars

Repository-Aktivität

12 Stars und 2 Forks

Wartung

Heute gepusht

Lizenz

MIT

Installieren

npx skills add yzfly/skills --skill golang-cli

Installationssicherheit

Standard-Paket- oder Laufzeit-Installationspfad

Berechtigungsfläche

secrets or environment access, shell or command execution

Agent-Ergebnisse

Noch keine Agent-Ergebnisdaten

Dokumentation

Starker README/SKILL.md-Kontext

Risikoübersicht

Vor Produktion prüfen

  • Low GitHub adoption signal
  • Quality score needs review
  • Permission surface needs review: secrets or environment access, shell or command execution
  • GitHub adoption: 12 GitHub stars

Installationsbereitschaft

Installationspfad verfügbar

  • Installationspfad ist verfügbar
  • Repository-Belege sind verfügbar
  • Lizenz ist angegeben
  • Noch keine Agent-Proven-Ergebnisbelege

Agent-lesbare Metadaten

Maschinenlesbare Entscheidungsdaten für diesen Skill.

Nutze diesen Block oder das eingebettete JSON, um zu entscheiden, ob ein Agent diesen Skill installieren, eine Alternative wählen oder zuerst menschliche Prüfung anfordern soll.

JSON öffnen

Geeignete Aufgaben

  • Coding-Agents-Workflows
  • Claude-Code-Teams
  • builders willing to evaluate younger projects
  • Inspect source files

Geeignete Agents

CodexClaude CodeCursorOpenAgentSkill CLICLI

Installationsentscheidung

Befehl
npx skills add yzfly/skills --skill golang-cli
Richtlinie
Blockieren
Menschliche Prüfung
Ja

Vertrauen und Risiko

Vertrauen
58/100
Audit
72/100
Risikoebene
Prüfung nötig

Ergebnis-Loop

Endpoint
/api/agent/outcome
Event-ID
resolve
Ergebnisse
5

Installationsbefehl

npx skills add yzfly/skills --skill golang-cli

Nicht verwenden, wenn

  • Teams, die ein vom Anbieter unterstütztes SLA benötigen
  • production agents without a repository review
  • Low GitHub adoption signal
  • No OpenAgentSkill engagement data yet
  • Hinweise auf Hochrisiko-Berechtigungen: Shell or command execution, Secrets or environment access

Agent-Sicherheit v2

28/100 · Automatische Installation vermeiden

Blocked for auto-installBlockieren

This skill should not be selected by an agent without explicit human security review.

Do not auto-install. Inspect the source, dependencies, and permission surface first.

Per API auflösen

Hoch

Shell- oder Befehlsausführung

Die Skill-Metadaten verweisen auf Terminal-, CLI-, Shell-, Subprozess- oder Befehlsausführungs-Workflows.

Mittel

Netzwerkzugriff

Die Skill ruft wahrscheinlich Remote-Seiten, APIs, Repositories oder externe Dienste ab.

Mittel

Dateisystemzugriff

Die Skill kann Projektdateien, Dokumente, generierte Artefakte oder den lokalen Arbeitsbereich lesen oder schreiben.

Hoch

Secrets or environment access

Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.

  • Hinweise auf Hochrisiko-Berechtigungen: Shell or command execution, Secrets or environment access
  • Dependency or permission surface needs review

Installationsziele

Diesen Skill im Agent-Workflow installieren

Über den öffentlichen Endpunkt erhältst du Befehl, Sicherheitscheckliste, Ziel-Prompts und kanonische Links.

skill install

OpenAgentSkill CLI

Resolve policy, run the source installer safely, and report a verified install receipt.

$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install yzfly-golang-cli

Agent-Auflösungsplan

Lass einen Agent die Eignung vor der Installation prüfen.

Die Resolve API liefert die beste Skill, Alternativen, Sicherheitsrichtlinien, Auditnotizen, Installationsziel und einen direkt nutzbaren Prompt.

Textplan öffnen

Agent sollte prüfen

  • Task fit and alternatives from Resolve API.
  • Audit score, trust score, and safety policy warnings.
  • Install target compatibility for Codex, Claude Code, Cursor, or CLI.

Prompt kopieren

Task: Use golang-cli in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-cli%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/yzfly-golang-cli/install
Install command: npx skills add yzfly/skills --skill golang-cli
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Agent-Übergabe

Gib dem Agent den Installationspfad, nicht noch ein Verzeichnis.

Über den öffentlichen Endpunkt erhältst du Befehl, Sicherheitscheckliste, Ziel-Prompts und kanonische Links.

Installations-API öffnen

Agent-Prompt

Use golang-cli for this task. Review https://www.openagentskill.com/api/skills/yzfly-golang-cli/install, then install with: npx skills add yzfly/skills --skill golang-cli

Registry-Metadaten

Agent-lesbares Profil für die automatische Skill-Auswahl.

Die Registry API stellt Entscheidungs-, Vertrauens-, Audit-, Use-Case- und Installationssignale ohne UI-Scraping bereit.

Manifest öffnen

Agent-Fit

57/100

Coding-Agents

Plattformen

Claude Code

Audit-Bericht

Prüfung nötig · 72/100

Maschinenlesbare Prüfung von Installationsbereitschaft, Sicherheitsmetadaten, Wartung und Akzeptanzrisiko.

Audit-Bericht ansehenEval-Bericht ansehen

Agent-Entscheidungspanel

Needs validation for Coding agents

Do a manual repository review before adding this to an agent workflow.

57
Bereitschaft
Prüfen
Phase

Rolle im Stack

Validierung nötig

Primäre Eignung

Coding-Agents

Vertrauenslabel

Manuelle Prüfung nötig

Installationspfad

Befehl bereit

Verwenden wenn

  • Coding-Agents-Workflows
  • Claude-Code-Teams
  • builders willing to evaluate younger projects

Evidenz

  • recent repository activity
  • install command or GitHub repo available
  • Qualitätsprofil 58/100

zuerst prüfen

  • Low GitHub adoption signal
  • No OpenAgentSkill engagement data yet

Implementierungspfad

  1. 1Installieren Sie es in einem Sandbox-Agent und führen Sie eine Coding-Agents-Aufgabe vollständig aus.
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

Vertrauensprofil

Do not auto-install

Trust Score v5 found insufficient evidence for agent installation. Treat this as discovery material, not an executable recommendation.

58
OpenAgentSkill Trust Score

GitHub-Akzeptanz

Beheben

12 GitHub-Stars

Star-/Fork-Aktivität

Beheben

12 Stars und 2 Forks; Issue-Aktivität ist in den aktuellen Metadaten nicht verfügbar

Aktuelle Wartung

Bestanden

Heute gepusht

Lizenzklarheit

Bestanden

MIT

Positive Signale

  • KI-Prüfung genehmigt
  • Installationspfad ist verfügbar
  • Repository-Belege sind verfügbar
  • Kürzlich gewartetes Repository
  • Der Installationsbefehl weist kein offensichtliches Hochrisikomuster auf
  • Ergebniszyklus ist bereit, benötigt aber den ersten echten Agent-Lauf

Vor Installation prüfen

  • Low GitHub adoption signal
  • Quality score needs review
  • Permission surface needs review: secrets or environment access, shell or command execution
  • GitHub adoption: 12 GitHub stars
  • Stars/forks activity: 12 stars, 2 forks; issue activity unavailable in current metadata
  • Dependency/runtime risk: command execution surface, credential or environment access
  • Permission surface: secrets or environment access, shell or command execution
  • Noch keine echten Agent-Ergebnisberichte
  • Vor unbeaufsichtigter Installation ist menschliche Prüfung erforderlich

Empfohlene Aktion

Choose a stronger alternative or inspect the source manually before any install attempt.

Qualitätsprofil

Vielversprechend Kandidat für Agent-Workflows

Useful candidate, but compare it with alternatives before adopting.

58
GitHub-Stars
12
Aktualität
Heute
Installationsbereit
Ja
Lizenz
MIT
Vor Installation prüfen: Low GitHub adoption signal

Workflow-Eignung

Diese Skill in diesen Szenarien nutzen

Workflow-Eignung

Zum vollständigen Workflow hinzufügen

Alternativen-Shortlist

Vor Installation vergleichen

Similar skills that may fit this task.

Alle vergleichen

Übersicht

--- 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." user-invocable: true license: MIT compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang. metadata: author: samber version: "1.1.3" 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 ---

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

``` myapp/ ├── cmd/ │ └── myapp/ │ ├── main.go # package main, only calls Execute() │ ├── root.go # Root command + Viper init │ ├── serve.go # "serve" subcommand │ ├── migrate.go # "migrate" subcommand │ └── version.go # "version" subcommand ├── go.mod └── go.sum ```

`main.go` should be minimal — see [assets/examples/main.go](assets/examples/main.go).

## Root Command Setup

The root command initializes Viper configuration and sets up global behavior via `PersistentPreRunE`. See [assets/examples/root.go](assets/examples/root.go).

Key points:

- `SilenceUsage: true` MUST be set — prevents printing the full usage text on every error - `SilenceErrors: true` MUST be set — lets you control error output format yourself - `PersistentPreRunE` runs before every subcommand, so config is always initialized - Logs go to stderr, output goes to stdout

## Subcommands

Add subcommands by creating separate files in `cmd/myapp/` and registering them in `init()`. See [assets/examples/serve.go](assets/examples/serve.go) for a complete subcommand example including command groups.

## Flags

See [assets/examples/flags.go](assets/examples/flags.go) for all flag patterns:

### Persistent vs Local

- **Persistent** flags are inherited by all subcommands (e.g., `--config`) - **Local** flags only apply to the command they're defined on (e.g., `--port`)

### Required Flags

Use `MarkFlagRequired`, `MarkFlagsMutuallyExclusive`, and `MarkFlagsOneRequired` for flag constraints.

### Flag Validation with RegisterFlagCompletionFunc

Provide completion suggestions for flag values.

### Always Bind Flags to Viper

This ensures `viper.GetInt("port")` returns the flag value, env var `MYAPP_PORT`, or config file value — whichever has highest precedence.

## Argument Validation

Cobra provides built-in validators for positional arguments. See [assets/examples/args.go](assets/examples/args.go) for both built-in and custom validation examples.

| Validator | Description | | --------------------------- | ------------------------------------ | | `cobra.NoArgs` | Fails if any args provided | | `cobra.ExactArgs(n)` | Requires exactly n args | | `cobra.MinimumNArgs(n)` | Requires at least n args | | `cobra.MaximumNArgs(n)` | Allows at most n args | | `cobra.RangeArgs(min, max)` | Requires between min and max | | `cobra.ExactValidArgs(n)` | Exactly n args, must be in ValidArgs |

## Configuration with Viper

Viper resolves configuration values in this order (highest to lowest precedence):

1. **CLI flags** (explicit user input) 2. **Environment variables** (deployment config) 3. **Config file** (persistent settings) 4. **Defaults** (set in code)

See [assets/examples/config.go](assets/examples/config.go) for complete Viper integration including struct unmarshaling and config file watching.

### Example Config File (.myapp.yaml)

```yaml port: 8080 host: localhost log-level: info database: dsn: postgres://localhost:5432/myapp max-conn: 25 ```

With the setup above, these are all equivalent:

- Flag: `--port 9090` - Env var: `MYAPP_PORT=9090` - Config file: `port: 9090`

## Version and Build Info

Version SHOULD be embedded at compile time using `ldflags`. See [assets/examples/version.go](assets/examples/version.go) for the version command and build instructions.

## Exit Codes

Exit codes MUST follow Unix conventions:

| Code | Meaning | When to Use | | ----- | ----------------- | ----------------------------------------- | | 0 | Success | Operation completed normally | | 1 | General error | Runtime failure | | 2 | Usage error | Invalid flags or arguments | | 64-78 | BSD sysexits | Specific error categories | | 126 | Cannot execute | Permission denied | | 127 | Command not found | Missing dependency | | 128+N | Signal N | Terminated by signal (e.g., 130 = SIGINT) |

See [assets/examples/exit_codes.go](assets/examples/exit_codes.go) for a pattern mapping errors to exit codes.

## I/O Patterns

See [assets/examples/output.go](assets/examples/output.go) for all I/O patterns:

- **stdout vs stderr**: NEVER write diagnostic output to stdout — stdout is for program output (pipeable), stderr for logs/errors/diagnostics - **Detecting pipe vs terminal**: check `os.ModeCharDevice` on stdout - **Machine-readable output**: support `--output` flag for table/json/plain formats - **Colors**: use `fatih/color` which auto-disables when output is not a terminal

## Signal Handling

Signal handling MUST use `signal.NotifyContext` to propagate cancellation through context. See [assets/examples/signal.go](assets/examples/signal.go) for graceful HTTP server shutdown.

## Shell Completions

Cobra generates completions for bash, zsh, fish, and PowerShell automatically. See [assets/examples/completion.go](assets/examples/completion.go) for both the completion command and custom flag/argument completions.

## Testing CLI Commands

Test commands by executing them programmatically and capturing output. See [assets/examples/cli_test.go](assets/examples/cli_test.go).

Use `cmd.OutOrStdout()` and `cmd.ErrOrStderr()` in commands (instead of `os.Stdout` / `os.Stderr`) so output can be captured in tests.

## Common Mistakes

| Mistake | Fix | | --- | --- | | Writing to `os.Stdout` directly | Tests can't capture output. Use `cmd.OutOrStdout()` which tests can redirect to a buffer | | Calling `os.Exit()` inside `RunE` | Cobra's error handling, deferred functions, and cleanup code never run. Return an error, let `main()` decide | | Not binding flags to Viper | Flags won't be configurable via env/config. Call `viper.BindPFlag` for every configurable flag | | Missing `viper.SetEnvPrefix` | `PORT` collides with other tools. Use a prefix (`MYAPP_PORT`) to namespace env vars | | Logging to stdout | Unix pipes chain stdout — logs corrupt the data stream for the next program. Logs go to stderr | | Printing usage on every error | Full help text on every error is noise. Set `SilenceUsage: true`, save full usage for `--help` | | Config file required | Users without a config file get a crash. Ignore `viper.ConfigFileNotFoundError` — config should be optional | | Not using `PersistentPreRunE` | Config initialization must happen before any subcommand. Use root's `PersistentPreRunE` | | Hardcoded version string | Version gets out of sync with tags. Inject via `ldflags` at build time from git tags | | Not supporting `--output` format | Scripts can't parse human-readable output. Add JSON/table/plain for machine consumption |

## Related Skills

See `samber/cc-skills-golang@golang-project-layout`, `samber/cc-skills-golang@golang-dependency-injection`, `samber/cc-skills-golang@golang-testing`, `samber/cc-skills-golang@golang-design-patterns` skills.

Technische Details

Version
1.0.0
Lizenz
MIT
Letzte Aktualisierung
23. Aug. 2026
Veröffentlicht
23. Aug. 2026

Entscheidungsübersicht

Validierung nötig

57
Bereit
Prüfen
Phase

recent repository activity

Audit

Installationsprüfung

Installations- und Adoptionsprüfung

72
Prüfung nötig
Sicherheit
72/100
Wartung
100/100
Installieren
92/100
Vollständiges Audit öffnenEval-Bericht ansehen

Von Agent belegte Evidenz

Von Agent belegte Evidenz

Ergebnisberichte nach Resolve, Prüfung, Installation und einem begrenzten Lauf.

0
Belegt
Needs first agent runAuto-Installation: zuerst prüfenLetzter: Unbekannt
Erfolgsrate
Letzter Fehler
Ergebnisse
0
Ausgabequalität
Fehlgeschlagen
0
Nicht relevant
0
Installationen
0
Durch Risiko blockiert
0
Einrichtung erforderlich
0
Produktion
0

Noch keine Agent-Ergebnisdaten. Der erste Lauf kann Erfolg, Einrichtungsbedarf, Risikoblockaden, Fehler oder Irrelevanz über /api/agent/outcome melden.

Installieren

Zum Agent-Workflow hinzufügen

Kostenlos und Open Source. Bericht vor der Installation in Produktions-Agents prüfen.

Wachstums-Loop

Share-Kit

X

Szenariobasierter Entwurf für golang-cli, bereit für einen manuellen X-Post.

Kuratorenhinweis
golang-cli: Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool...

12 stars

https://www.openagentskill.com/skills/yzfly-golang-cli?ref=x
X-Entwurf öffnen
Optionale Antwort mit Installationsbefehl
Listing + install path for golang-cli:
https://www.openagentskill.com/skills/yzfly-golang-cli?ref=x

Install: npx skills add yzfly/skills --skill golang-cli
Antwortentwurf öffnen

Quelle des Eintrags

Registry-indexiert

Beanspruchbar

Dieser Eintrag wurde aus öffentlichen Quellen indexiert und ist erst nach Genehmigung eines Maintainer-Anspruchs offiziell.

Ersteller
yzfly
Indexiert von
OpenAgentSkill Community-Index

Die Zuordnung verlinkt auf das öffentliche Repository oder Creator-Profil. Creator können den Eintrag beanspruchen, um Eigentümersignale zu aktualisieren.

Diesen Skill beanspruchen

Eigentümeranspruch

Diesen Skill-Eintrag beanspruchen

Dieser Registry-indexiert-Eintrag wird yzfly zugeschrieben, ist aber noch nicht offiziell markiert. Beanspruche ihn, um ein verifiziertes Eigentümersignal hinzuzufügen und künftige Launch-, Installations- und Audit-Updates vertrauenswürdiger zu machen.

Creator-Backlink-Kit

Evidenz-Badges in deine README einfügen

Zeige den kanonischen Eintrag, aktuelle Vertrauens- und Audit-Signale sowie echte Agent-Proven-Evidenz dort, wo Entwickler das Repository bewerten.

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/yzfly-golang-cli?metric=listed&label=Listed)](https://www.openagentskill.com/skills/yzfly-golang-cli)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/yzfly-golang-cli?metric=trust&label=Trust)](https://www.openagentskill.com/skills/yzfly-golang-cli)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/yzfly-golang-cli?metric=audit&label=Audit)](https://www.openagentskill.com/skills/yzfly-golang-cli/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/yzfly-golang-cli?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/yzfly-golang-cli)

Autor

Y

yzfly

@yzfly

Plattform-Fit

Gesundheitssignale

GitHub-Stars
12
Qualitätswert
31/100
Letzter GitHub-Push
23. Aug. 2026
Framework-Hinweise
Unbekannt
OpenAgentSkill-Aufrufe
0
Installationskopien
0
Externe Klicks
0

Community-Signal

Teile mit, ob dieser Skill für deinen Agent-Workflow nützlich ist. Zusammengefasstes Feedback verbessert das Ranking im Laufe der Zeit.

Vertrauen & Sicherheit

Do not auto-install

58
  • GitHub-Akzeptanz12 GitHub-StarsBeheben
  • Star-/Fork-Aktivität12 Stars und 2 Forks; Issue-Aktivität ist in den aktuellen Metadaten nicht verfügbarBeheben
  • Aktuelle WartungHeute gepushtBestanden
  • LizenzklarheitMITBestanden
  • README/SKILL.md-VollständigkeitMetadaten enthalten ausreichend Nutzungs- und Workflow-KontextBestanden
  • Abhängigkeits-/Laufzeitrisikocommand execution surface, credential or environment accessBeheben