{"repo":"funAgent/build-claude-code-cli","free":true,"listed":false,"github":"https://github.com/funAgent/build-claude-code-cli","clone":"git clone https://github.com/funAgent/build-claude-code-cli.git","description":"从零构建企业级 AI Agent CLI — 逐课拆解 Claude Code 源码架构 | Build an enterprise-grade AI Agent CLI from scratch — 49 lessons deconstructing Claude Code's architecture","language":"TypeScript","stars":61,"topics":["ai","ai-agent","ai-agents","ai-coding","claude-code","cli","llm","mcp","nodejs","prompt-engineering"],"license":"MIT","category":"ai-agents","readme_excerpt":"Build Claude Code 从零构建企业级 AI Agent CLI — 逐课拆解 Claude Code 源码架构 中文 · English 🌐 官网 · 📖 贡献指南 · 🐛 反馈问题 --- ⚠️ 免责声明 本项目 仅用于学习交流 ，内容基于互联网上公开的 Claude Code 技术分析资料及learn-claude-code 项目提供的灵感整理构建而成。所有课程代码均为独立编写，仅供教学演示，不建议直接用于生产环境。 \"Claude Code\" is a trademark of Anthropic. This project is not affiliated with or endorsed by Anthropic. 这是什么？ 49 节渐进式课程，教你从 npm init 开始，逐课构建出一个架构对标 Claude Code 的完整 AI Agent CLI 产品。 核心模式只有一个 while 循环： 每一课产出一个可独立运行的项目快照，从第一课的 API 调用到最后一课的遥测诊断，最终你会拥有一个完整的、可安装分发的 AI Agent CLI。 快速开始 前置要求： Node.js ≥ 18 · npm ≥ 9 · Git 课程大纲 现在 开始学习 # 阶段 课程 关键能力 --- ------ ------ --------- 0 预备知识 s00 – s02 API 调用、CLI 脚手架、子进程管理 1 最小 Agent s03 – s07 Agent 循环、消息管理、错误处理、配置、成本追踪 2 工具体系 s08 – s12 工具抽象、文件读写、编辑、搜索、工具注册表 3 终端 UI s13 – s16 Ink 组件、消息列表、输入框、完整 REPL 4 Prompt 工程 s17 – s19 系统提示词、CLAUDE.md 规则、Prompt Cache 5 流式与性能 s20 – s23 Streaming 解析、Token 流、并行工具、启动优化 6 上下文管理 s24 – s26 对话压缩、多层策略、大输出处理 7 Agent 智能 s27 – s31 规划能力、子 Agent、技能系统、任务管理 8 安全与权限 s32 – s34 规则引擎、权限 UI、子 Agent 权限继承 9 扩展生态 s35 – s38 MCP 协议、会话持久化、插件系统 10 多 Agent s39 – s43 Agent 定义、协调器、团队协作、通信协议、Worktree 隔离 11 产品化 s44 – s48 渐进恢复、Feature Flag、打包分发、原生能力、遥测诊断 项目结构 教学网站功能 - 交互式源码查看器 — 语法高亮 + 逐课 Diff 对比 - 终端录制播放器 — 模拟真实 CLI 交互过程 - 架构全景图 — 可视化展示模块关系与分层结构 - 深度注解 — 每课的架构决策与 Claude Code 源码映射 - 学习进度追踪 — 本地持久化的完成状态 - 中英文切换 — 完整的双语支持 - 暗色模式 — 自动跟随系统偏好 技术栈 教学项目： TypeScript · Node.js · Commander.js · React + Ink · Anthropic SDK · Zod · esbuild · MCP SDK 教学网站： Next.js 16 · React 19 · Tailwind CSS v4 · Framer Motion · unified (Markdown 渲染) 贡献","default_branch":null,"files":null,"tree":[],"storefront":"/r/funAgent","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/funAgent/build-claude-code-cli/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}