Peter Steinberger

Create Cli

开发编程v1.0.0
作者:Peter Steinberger更新于 2026-05-11create-cli@clawhub_steipete/create-cli
代码生成脚本工具#Command Line Interface

据 AlphaMoat 统计,截至 2026-09,Create Cli 累计下载 4,284 次、获 11 个星标,在全部 5,078 个 AI 技能中排名第 2,307 位,在「开发编程」分类(577 个)中排名第 295 位。

累计安装
281
累计下载
4,284
星标
11
全站排名
#2,307
全站前 46% · 「开发编程」前 52%
平台累计安装累计下载星标评论
ClawHub ↗1334,13411-
SkillHub ↗2814,28411—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

Design CLI surface area (syntax + behavior), human-first, script-friendly. 面向实现前的 CLI 规格设计或既有 CLI 的一致性重构:先读 cli-guidelines.md 作为默认评分标准(完整版见 clig.dev),- Ask only the minimum clarifying questions needed to lock the interface. 交付物是一份紧凑规格:命令树与 USAGE、参数/标志表、子命令语义、stdout/stderr 与 --json/--plain 输出规则、错误与退出码映射、安全规则(--dry-run、确认机制、--force、--no-input)、配置优先级(flags > env > 项目配置 > 用户配置 > 系统)、补全方案与 5-10 个示例调用。默认约定包括 -h/--help 优先、主数据走 stdout、诊断走 stderr、仅 TTY 时提示交互、- Destructive operations: interactive confirmation + non-interactive requires --force or explicit --confirm=.... 保持语言无关、只做设计不写实现。card 提醒:生成的规格可能包含危险操作或密钥处理逻辑,实现后需复查 dry-run、确认、force/no-input 与配置优先级等安全行为。

资料发布于 2026-10-27

可以用来做什么

  • 为新工具设计命令树与参数表
  • 重构既有 CLI 的输出与退出码约定
  • 定义 --json/--plain 等输出契约
  • 规划破坏性操作的确认与 dry-run 行为

什么时候用

  • CLI 实现前需要一份可落地的接口规格
  • 既有命令行工具需要统一风格
  • 需要人友好且脚本友好的接口权衡建议

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

为 mycmd 设计包含子命令与退出码的 CLI 规格
审查这个 CLI 设计的破坏性操作保护
给批量删除命令补上 --dry-run 与确认流程

月度数据趋势

累计下载4,284
2,7093,5554,4012026-03 · 累计下载 2,8262026-05 · 累计下载 3,3272026-06 · 累计下载 3,5002026-07 · 累计下载 3,8122026-08 · 累计下载 3,9972026-09 · 累计下载 4,28426-0326-09
星标11
1011122026-03 · 星标 112026-05 · 星标 112026-06 · 星标 112026-07 · 星标 112026-08 · 星标 112026-09 · 星标 1126-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,284—11
2026-083,997+4.9%11
2026-073,812+8.9%11
2026-063,500+5.2%11
2026-053,327—11
2026-032,826—11

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.6 KB · ClawHub v1.0.0
---
name: create-cli
description: >
  Design command-line interface parameters and UX: arguments, flags, subcommands,
  help text, output formats, error messages, exit codes, prompts, config/env
  precedence, and safe/dry-run behavior. Use when you’re designing a CLI spec
  (before implementation) or refactoring an existing CLI’s surface area for
  consistency, composability, and discoverability.
---
展开全部(共 94 行)
# Create CLI

Design CLI surface area (syntax + behavior), human-first, script-friendly.

## Do This First

- Read `agent-scripts/skills/create-cli/references/cli-guidelines.md` and apply it as the default rubric.
- Upstream/full guidelines: https://clig.dev/ (propose changes: https://github.com/cli-guidelines/cli-guidelines)
- Ask only the minimum clarifying questions needed to lock the interface.

## Clarify (fast)

Ask, then proceed with best-guess defaults if user is unsure:

- Command name + one-sentence purpose.
- Primary user: humans, scripts, or both.
- Input sources: args vs stdin; files vs URLs; secrets (never via flags).
- Output contract: human text, `--json`, `--plain`, exit codes.
- Interactivity: prompts allowed? need `--no-input`? confirmations for destructive ops?
- Config model: flags/env/config-file; precedence; XDG vs repo-local.
- Platform/runtime constraints: macOS/Linux/Windows; single binary vs runtime.

## Deliverables (what to output)

When designing a CLI, produce a compact spec the user can implement:

- Command tree + USAGE synopsis.
- Args/flags table (types, defaults, required/optional, examples).
- Subcommand semantics (what each does; idempotence; state changes).
- Output rules: stdout vs stderr; TTY detection; `--json`/`--plain`; `--quiet`/`--verbose`.
- Error + exit code map (top failure modes).
- Safety rules: `--dry-run`, confirmations, `--force`, `--no-input`.
- Config/env rules + precedence (flags > env > project config > user config > system).
- Shell completion story (if relevant): install/discoverability; generation command or bundled scripts.
- 5–10 example invocations (common flows; include piped/stdin examples).

## Default Conventions (unless user says otherwise)

- `-h/--help` always shows help and ignores other args.
- `--version` prints version to stdout.
- Primary data to stdout; diagnostics/errors to stderr.
- Add `--json` for machine output; consider `--plain` for stable line-based text.
- Prompts only when stdin is a TTY; `--no-input` disables prompts.
- Destructive operations: interactive confirmation + non-interactive requires `--force` or explicit `--confirm=...`.
- Respect `NO_COLOR`, `TERM=dumb`; provide `--no-color`.
- Handle Ctrl-C: exit fast; bounded cleanup; be crash-only when possible.

## Templates (copy into your answer)

### CLI spec skeleton

Fill these sections, drop anything irrelevant:

1. **Name**: `mycmd`
2. **One-liner**: `...`
3. **USAGE**:
   - `mycmd [global flags] <subcommand> [args]`
4. **Subcommands**:
   - `mycmd init ...`
   - `mycmd run ...`
5. **Global flags**:
   - `-h, --help`
   - `--version`
   - `-q, --quiet` / `-v, --verbose` (define exactly)
   - `--json` / `--plain` (if applicable)
6. **I/O contract**:
   - stdout:
   - stderr:
7. **Exit codes**:
   - `0` success
   - `1` generic failure
   - `2` invalid usage (parse/validation)
   - (add command-specific codes only when actually useful)
8. **Env/config**:
   - env vars:
   - config file path + precedence:
9. **Examples**:
   - …

## Notes

- Prefer recommending a parsing library (language-specific) only when asked; otherwise keep this skill language-agnostic.
- If the request is “design parameters”, do not drift into implementation.

「开发编程」分类下的热门技能

Peter Steinberger 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。