一条命令完成 AI Dev OS 的设置、更新和诊断。
npx ai-dev-os init --rules typescript --plugin claude-code| 手动设置 | 使用 CLI |
|---|---|
git submodule add × 3 个仓库 |
npx ai-dev-os init(一条命令) |
| 手动复制模板 | 自动复制 |
| 手动合并 hooks.json | 自动合并(带备份) |
| 手动检查 submodule 状态 | npx ai-dev-os doctor |
| 手动更新 submodule | npx ai-dev-os update |
npx ai-dev-os initCLI 将引导您选择规则预设和插件:
AI Dev OS Setup
───────────────
? Select rules preset:
❯ TypeScript (Next.js)
Python (FastAPI)
? Select plugin:
❯ Claude Code
Kiro
Cursor
✔ Added submodule: .ai-dev-os/core
✔ Added submodule: .ai-dev-os/rules
✔ Added submodule: .ai-dev-os/plugin
✔ Copied template → CLAUDE.md
✔ Merged hooks → .claude/settings.json
✔ Created .ai-dev-os.yaml
Done! Next steps:
1. Edit CLAUDE.md to customize for your project
2. Run /ai-dev-os-init in Claude Code to generate L1/L2
3. See: https://github.com/yunbow/ai-dev-os#quick-start
npx ai-dev-os init --rules typescript --plugin claude-code -y| 命令 | 说明 |
|---|---|
ai-dev-os init |
添加 submodule、复制模板、合并 hooks |
ai-dev-os update |
将 submodule 更新到最新版或指定版本 |
ai-dev-os doctor |
检查安装健康状态(7 项检查) |
命令详情
# 将所有 submodule 更新到最新版
npx ai-dev-os update
# 仅检查更新,不执行
npx ai-dev-os update --check
# 固定到指定版本
npx ai-dev-os update --ref v1.3.0npx ai-dev-os doctor检查项目:
- Git 仓库有效性
.ai-dev-os.yaml配置- submodule 初始化(core, rules, plugin)
- 模板文件存在性
- hooks 集成状态
选项
Usage: ai-dev-os init [options]
Options:
--rules <name> 规则预设 (typescript | python)
--plugin <name> 插件 (claude-code | kiro | cursor)
--ref <tag> 固定到指定版本标签 (默认: "latest")
--no-hooks 跳过 hooks.json 合并
--dry-run 仅显示将执行的操作,不实际执行
-y, --yes 跳过交互提示,使用默认值
配置文件
CLI 会在项目根目录创建 .ai-dev-os.yaml:
version: "1.0"
core:
repo: https://github.com/yunbow/ai-dev-os
ref: latest
path: .ai-dev-os/core
rules:
name: typescript
repo: https://github.com/yunbow/ai-dev-os-rules-typescript
ref: latest
path: .ai-dev-os/rules
plugin:
name: claude-code
repo: https://github.com/yunbow/ai-dev-os-plugin-claude-code
ref: latest
path: .ai-dev-os/plugin
hooks:
merged: true
mergedAt: "2026-03-20T10:00:00Z"可用预设
| ID | 名称 | 仓库 |
|---|---|---|
typescript |
TypeScript (Next.js) | ai-dev-os-rules-typescript |
python |
Python (FastAPI) | ai-dev-os-rules-python |
| ID | 名称 | 仓库 | 模板 | Hooks |
|---|---|---|---|---|
claude-code |
Claude Code | ai-dev-os-plugin-claude-code | CLAUDE.md | Yes |
kiro |
Kiro | ai-dev-os-plugin-kiro | AGENTS.md | -- |
cursor |
Cursor | ai-dev-os-plugin-cursor | .cursorrules | -- |
设计决策
CLI 是一个交付机制 — 它设置 git submodule、复制模板、合并 hooks。它不包含规则或插件的内容。
| 决策 | 原因 |
|---|---|
| 将 rules/plugin 内容打包到 CLI 中 | 会失去透明性和可 Fork 性 |
| 用 npm 依赖替代 git submodule | 非 Node.js 项目将无法使用 |
| 将 CLI 设为必需 | "无需 CLI 也能使用"是核心设计原则 |
| 废除 plugin 仓库 | CLI 是"快递员",不是"内容" |
| 添加 GitHub App / OAuth 集成 | 过度设计,git 操作已经足够 |
CLI 自动化的是你可以用 git submodule add 和 cp 手动完成的事情。即使 CLI 消失,AI Dev OS 的所有功能仍可通过手动设置使用。
| 仓库 | 说明 |
|---|---|
| ai-dev-os | 核心框架 |
| rules-typescript | TypeScript / Next.js 指南 |
| rules-python | Python / FastAPI 指南 |
| plugin-claude-code | Claude Code 集成 |
| plugin-kiro | Kiro 集成 |
| plugin-cursor | Cursor 集成 |
| benchmark | 定量基准测试 — 指南影响数据 |