CreateCLI
できること
このスキルは、TypeScript で使える状態のコマンドラインツールを、ドキュメントと適切な終了コードとともに作成します。API をラップする小さなツールや、タスクを自動化する小さなツールがほしい開発者向けです。
使う場面
- ✓使っている API をラップするコマンドラインツールがほしいとき。
- ✓少数の単純なコマンドを持つ小さな自動化ツールが必要なとき。
- ✓既存のコマンドラインツールが大きくなり、サブコマンドが必要なとき。
スキルのリンク
https://github.com/danielmiessler/LifeOS/blob/main/LifeOS/install/skills/CreateCLI/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私の API のデータを JSON に書き出す、TypeScript のコマンドラインツールを作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルは、ツールに必要なコマンドの数に応じて三つのテンプレートから一つを選びます。単純な引数の解析から、大きなツール向けのフレームワークまであります。そのうえで、コード、README、パッケージファイル、厳格な TypeScript の設定を生成します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
CreateCLI
Contents: Ideal State · Intent Routing · Data & Config · Gotchas · Examples
Generates production-ready TypeScript CLIs, from agent-first CLIs for public web apps (API-key auth, browser device login) to personal and project tools. Every CLI ships with full implementation, README and QUICKSTART, a Bun package.json, strict tsconfig, JSON output, and correct exit codes. A three-tier template system picks the right complexity: Tier 1 manual arg parsing with zero deps (most cases), Tier 2 Commander.js for subcommands, Tier 3 oclif as a reference for enterprise scale.
Shared facts the intents rely on:
- Tiers. Tier 1 parses
process.argvby hand with zero framework dependencies, Bun + TypeScript and type-safe interfaces in ~300-400 lines, in four sections: configuration, command functions, help documentation, main entry point. It fits API clients, data transformers and simple automation with 2-10 commands, simple arguments, JSON output and no subcommands. Tier 2 (Commander.js) is the escalation when any Tier 2 indicator holds, the same list for CreateCli and UpgradeTier: 10+ commands that need grouping, git-style subcommands (cli convert json csv/cli convert csv json), a plugin architecture, complex nested option combinations, or multiple output format engines (a--format jsonflag alone is standard Tier 1 output control). A long list of simple, ungrouped commands is not an indicator. Tier 3 (oclif) is reference only, documentation and no templates, for Heroku CLI or Salesforce CLI scale. - Stack. Runtime and package manager are Bun, the language is TypeScript with a strict tsconfig, tests (when added) run under
bun test ./<path>, output is deterministic JSON that pipes to jq and grep, and documentation is README + QUICKSTART. - Placement.
~/.claude/LIFEOS/TOOLS/[cli-name]/holds personal CLIs and~/Projects/[project-name]/project-specific ones. The two sit in different git repositories, so confirm which repository a CLI directory belongs to before any git operation in it. - CLI-First Architecture (
LIFEOS/DOCUMENTATION/Tools/CliFirstArchitecture.md): every generated CLI is deterministic (same input → same output), clean (single responsibility), composable (JSON output pipes to other tools), documented (comprehensive help and examples) and testable (predictable behavior).
Ideal State
- Every CLI the skill creates or changes ships whole: typed source, README.md and QUICKSTART.md, a Bun package.json, a strict tsconfig.json, an .env.example, and
--helpthat lists every command with real examples. - Output follows one contract across intents: JSON to stdout, errors with context to stderr, exit code 0 on success and 1 on error, and strict
tscclean before the work is reported done. - A CLI for a public-facing app meets the agent-first contract (OPERATIONAL_PREFERENCES § Deployment): a browser device login that mints a scoped, expiring API key;
--jsonstdout and fixed exit codes; ahelp --jsoncatalog; RateLimit headers with per-key and per-IP limits;/docs/clirendered from the CLI's own catalog; and a self-hosted, SHA-checked install.Intents/CreateCli.md§ Ideal State itemizes it, and Config.md names the reference implementation to match when one is configured. Where that contract and the output contract above differ, the agent-first contract governs. - The tier fits the need: Tier 1 unless a Tier 2 indicator holds, oclif never generated, and a CLI moves up a tier only when it has outgrown the one it is on.
- A change to an existing CLI keeps every command it already had working.
Intent Routing
| Intent | Trigger | File |
|---|---|---|
| CreateCli | "create CLI", "build a CLI", "wrap this API in a command-line tool" | Intents/CreateCli.md |
| AddCommand | "add a command to <cli>" | Intents/AddCommand.md |
| UpgradeTier | "upgrade tier", "move this CLI to Commander" | Intents/UpgradeTier.md |
| File | Read when |
|---|---|
FrameworkComparison.md |
choosing or justifying a framework: Manual vs Commander vs oclif, plus cleye, citty, Yargs and Ink |
Tools/CheckCli.ts |
proving a CLI meets the output contract: strict tsc, --help names every command, --version, unknown command exits 1, --json-args stdout parses as JSON |
Setup.md |
first-time setup: the optional Reference CLI: key in Config.md |
Data & Config
User customizations live at `<configRoot>/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Creat
よくある質問
より大きなテンプレートが必要になるのはいつですか?
多くのグループ化されたコマンド、git 風のサブコマンド、プラグインの設計、複数の出力形式が必要なとき、フレームワークのテンプレートへ移ります。
生成されたツールには何が付いてきますか?
完全なコード、README とクイックスタート、パッケージファイル、厳格な TypeScript の設定です。
既にあるツールにコマンドを追加できますか?
はい。コマンドを追加する方法と、より大きなテンプレートへ格上げする方法があります。
詳細
作者による元の説明
Generates production-ready TypeScript CLIs via a 3-tier template system (manual arg parsing, Commander.js, oclif), each shipping full implementation, docs, package.json, strict config, JSON output, and exit-code compliance. USE WHEN create CLI, build CLI, command-line tool, wrap API, add command, upgrade tier, TypeScript CLI. NOT FOR LifeOS skill scaffolding (use CreateSkill).
repo: danielmiessler/LifeOS
人気
- GitHubのスター
- 20k
- ランキング
- #10418
- ライセンス
- MIT
- 更新日
- 2026/10/28
コメント
- …
このリポジトリの他のスキル
LifeOS
20kインタビューとダッシュボードを通じて、現在の状態を理想の状態へ結びつける個人システム LifeOS を、エージェントが設定するのを支援します。
AnnualReports
20k主要ベンダーのサイバーセキュリティの年次レポートを探して比較し、侵害やランサムウェアの傾向などをまとめます。すべての数字に出典を付けます。
ApertureOscillation
20k一つの設計上の問いを、狭い範囲と広い範囲の両方でテストし、構築する前に二つの答えが食い違う箇所を指摘するよう、エージェントに教えます。
Aphorisms
20k新聞の編集テーマに合う、出典の確かな引用を、キュレーションされたコレクションから見つけ、照合し、最近使ったものを避けて管理するよう、エージェントを支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。