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.
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
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.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「golang-cli」。 Design a deploy command with required environment and tag flags.
預期結果:
- A command layout with declarative argument validation.
- Required environment and tag flags with mutual-exclusion rules.
- Viper bindings and completion values for supported environments.
正在使用「golang-cli」。 Review a list command that mixes logs with pipeable output.
預期結果:
A review that moves records to stdout, diagnostics to stderr, and recommends selectable table, plain, and JSON formats.
正在使用「golang-cli」。 Add graceful shutdown to a server subcommand.
預期結果:
A design using signal-aware context cancellation, SIGINT and SIGTERM support, a shutdown timeout, and distinct handling for normal server closure.
安全審計
安全All 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.
風險因素
⚡ 包含腳本 (12)
⚙️ 外部命令 (50)
📁 檔案系統存取 (4)
🌐 網路存取 (1)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/samber-golang-cli/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/samber-golang-cli?utm_source=security_passport_badge)HTML 徽章
<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>嵌入卡片
<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>學術引用 (APA · BibTeX · CFF)
APA 引用
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 引用
@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 評分
評分依據 證據置信度: 中你可以打造什麼
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.
試試這些提示
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.
最佳實務
- 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.
避免
- 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.