Createcli 技能测试
- 作者仓库星标 0
- 作者仓库 skills-registry
CreateCLI
Role: quick CLI authoring for ~/.claude/scripts/.
Stack choice
| Task | Stack | Reason |
|---|---|---|
| Files, glob, regex, JSON piping | bash | Fastest if < 50 lines |
| Anything complex, types, JSON handling | TypeScript (bun) | Default |
| Data-heavy operations, ML libraries | Python (uv) | Library access |
Anatomy (TypeScript default)
#!/usr/bin/env bun
/**
* [scriptname] — [short description]
*
* Usage: [scriptname] [args] [flags]
*
* Created: 2026-MM-DD via createcli skill
*/
import { parseArgs } from 'util';
const { values, positionals } = parseArgs({
args: process.argv.slice(2),
options: {
'dry-run': { type: 'boolean', default: true }, // destructive: default ON
'verbose': { type: 'boolean', short: 'v' },
'help': { type: 'boolean', short: 'h' },
},
allowPositionals: true,
});
if (values.help) {
console.log(`[scriptname] — [description]
Usage:
[scriptname] [args]
Flags:
--dry-run Show what would happen without doing it (default: ON for destructive)
--verbose More detailed output
--help This text
`);
process.exit(0);
}
// ... core logic
Anatomy (bash)
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<EOF
[scriptname] — [description]
Usage: [scriptname] [args]
Flags:
-n, --dry-run Show what would happen
-v, --verbose More detailed output
-h, --help This text
EOF
}
DRY_RUN=true # destructive default
while [[ $# -gt 0 ]]; do
case "$1" in
-n|--dry-run) DRY_RUN=true; shift ;;
--no-dry-run) DRY_RUN=false; shift ;;
-v|--verbose) VERBOSE=true; shift ;;
-h|--help) usage; exit 0 ;;
*) ARGS+=("$1"); shift ;;
esac
done
# core logic
Rules
- Destructive = dry-run default ON. Must use explicit
--no-dry-runto execute. - Log to
~/.claude/logs/[scriptname].jsonlfor an audit trail when relevant (file-modifying, network-fetching, API calls). chmod +xafter Write — exec bit must be set.--helpis mandatory — show it even when no args.- Never hardcode credentials — read from
~/.claude/.env. - Output in markdown if the script produces a text report (not tabular).
Workflow
1. The user describes: "I need a script that [X]"
2. Choose stack (bash/TS/Python) per the table above
3. Create the anatomy template
4. Implement core logic
5. chmod +x ~/.claude/scripts/[scriptname]
6. Test: ./scripts/[scriptname] --help
7. Test: ./scripts/[scriptname] --dry-run [args]
8. Report to user: what the script does + examples
Version history
- v3.0 (2026-05-02): initial public release.
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: carlheath/ogmios — distributed by TomeVault.
- 流狐分类
- 通用
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Task · Stack · Reason Files, glob, regex, JSON piping · bash · Fastest if < 50 lines Anything complex, types, JSON handling · TypeScript (bun) · Default
Anatomy (TypeScript default)
Anatomy (bash)
Destructive = dry-run default ON. Must use explicit --no-dry-run to execute. Log to ~/.claude/logs/[scriptname].jsonl for an audit trail when relevant (file-modifying, network-fetching, API calls). chmod +x after Write — exec bit must be set.
Workflow
v3.0 (2026-05-02): initial public release. Source: carlheath/ogmios — distributed by TomeVault. <!-- tomevault:4.0:skillmd:2026-05-22 -->
# CreateCLI
**Role:** quick CLI authoring for `~/.claude/scripts/`.
## Stack choice
| Task | Stack | Reason |
|------|-------|--------|
| Files, glob, regex, JSON piping | bash | Fastest if < 50 lines |
| Anything complex, types, JSON handling | TypeScript (bun) | Default |
| Data-heavy operations, ML libraries | Python (uv) | Library access |
## Anatomy (TypeScript default)
```typescript
#!/usr/bin/env bun
/**
* [scriptname] — [short description]
*
* Usage: [scriptname] [args] [flags]
*
* Created: 2026-MM-DD via createcli skill
*/
import { parseArgs } from 'util';
const { values, positionals } = parseArgs({
args: process.argv.slice(2),
options: {
'dry-run': { type: 'boolean', default: true }, // destructive: default ON
'verbose': { type: 'boolean', short: 'v' },
'help': { type: 'boolean', short: 'h' },
},
allowPositionals: true,
});
if (values.help) {
console.log(`[scriptname] — [description]
Usage:
[scriptname] [args]
Flags:
--dry-run Show what would happen without doing it (default: ON for destructive)
--verbose More detailed output
--help This text
`);
process.exit(0);
}
// ... core logic
```
## Anatomy (bash)
```bash
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<EOF
[scriptname] — [description]
Usage: [scriptname] [args]
Flags:
-n, --dry-run Show what would happen
-v, --verbose More detailed output
-h, --help This text
EOF
}
DRY_RUN=true # destructive default
while [[ $# -gt 0 ]]; do
case "$1" in
-n|--dry-run) DRY_RUN=true; shift ;;
--no-dry-run) DRY_RUN=false; shift ;;
-v|--verbose) VERBOSE=true; shift ;;
-h|--help) usage; exit 0 ;;
*) ARGS+=("$1"); shift ;;
esac
done
# core logic
```
## Rules
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Stack choice → Anatomy (TypeScript default) → Anatomy (bash) → Rules → Workflow → Version history
要点 -> Role · Destructive = dry-run default ON. · Log to ~/.claude/logs/[scriptname].jsonl · chmod +x · --help is mandatory · Never hardcode credentials · Output in markdown
文件/命令 -> ~/.claude/scripts/ · --no-dry-run · ~/.claude/logs/[scriptname].jsonl · chmod +x · --help · ~/.claude/.env
内容 SHA-256 -> 2ca416a45bf7
方法与流程
适用与边界
原文中的明确线索
~/.claude/scripts/、--no-dry-run、~/.claude/logs/[scriptname].jsonl、chmod +x、--help、~/.claude/.env