CreateCLI
Skill này làm gì
Tạo các công cụ dòng lệnh TypeScript sẵn sàng dùng, kèm tài liệu và mã thoát đúng chuẩn. Skill dành cho nhà phát triển muốn một công cụ nhỏ bọc một API hoặc tự động hóa một tác vụ.
Khi nào nên dùng
- ✓Khi bạn muốn một công cụ dòng lệnh bọc một API bạn đang dùng.
- ✓Khi bạn cần một công cụ tự động hóa nhỏ với vài lệnh đơn giản.
- ✓Khi một công cụ dòng lệnh hiện có đã phình ra và cần có các lệnh con.
Liên kết skill
https://github.com/danielmiessler/LifeOS/blob/main/LifeOS/install/skills/CreateCLI/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Xây cho tôi một công cụ dòng lệnh TypeScript để xuất dữ liệu API của tôi ra JSON.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill chọn một trong ba mẫu dựa trên số lệnh công cụ cần, từ phân tích đối số đơn giản đến một framework cho công cụ lớn hơn. Sau đó skill tạo mã, README, file package và cấu hình TypeScript nghiêm ngặt.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Khi nào một công cụ cần mẫu lớn hơn?
Khi cần nhiều lệnh được nhóm, lệnh con kiểu git, thiết kế plugin hoặc nhiều định dạng đầu ra, skill chuyển lên mẫu framework.
Có gì đi kèm công cụ được tạo ra?
Mã đầy đủ, README và hướng dẫn nhanh, file package và cấu hình TypeScript nghiêm ngặt.
Nó có thể thêm lệnh vào công cụ tôi đã có không?
Có. Skill có cách thêm một lệnh và nâng cấp một công cụ lên mẫu lớn hơn.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 20k
- Vị trí xếp hạng
- #10418
- Giấy phép
- MIT
- Cập nhật
- 28/10/2026
Bình luận
- …
Thêm skill từ kho mã này
LifeOS
20kGiúp agent của bạn thiết lập LifeOS, một hệ thống cá nhân ánh xạ trạng thái hiện tại tới trạng thái lý tưởng qua một cuộc phỏng vấn và một bảng điều khiển.
AnnualReports
20kGiúp agent của bạn tìm và so sánh báo cáo an ninh mạng thường niên từ các nhà cung cấp lớn, như xu hướng vi phạm và ransomware, có nguồn cho mọi số liệu.
ApertureOscillation
20kDạy agent của bạn kiểm tra một câu hỏi thiết kế ở phạm vi hẹp và phạm vi rộng, rồi chỉ ra chỗ hai câu trả lời mâu thuẫn trước khi bạn xây dựng.
Aphorisms
20kCho phép agent của bạn tìm, ghép và theo dõi các câu trích dẫn có ghi tác giả từ một bộ sưu tập được chọn lọc, tránh những câu vừa được dùng trong bản tin.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.