在本教程中,我们将介绍直接在命令行中运行的 AI 编程 Agent。它们和之前学过的 Trae、Cursor 中的 Agent 不同,CLI AI 编程工具只能在终端中使用。与集成在 AI IDE 里的 Agent 相比,它们通常具有更长的上下文窗口、更快的工具调用速度,并且可以兼容更多种类的大模型。在最新的 AI Vibe Coding 实战中,我们往往会优先使用 CLI AI 编程工具,而不是 IDE 内置的编码 Agent。
我们可以把 CLI AI 编程工具类比成之前学过的 z.ai 和 Trae。某种意义上,CLI AI 编程工具可以看成是一种特殊的 z.ai:它们同样只需要一个简单的对话入口,就会自动为你执行所有需要的操作(只是有时你需要手动打开浏览器查看最终效果)。而如果类比 AI IDE,那么 CLI AI 编程工具可以被看作是 IDE 中的 Agent 模块——也就是侧边那块对话区域。
目前虽然有很多开源实现,但在实践中我们只推荐两大类型的 CLI AI 编程工具,作为“首选组合”。你可以根据自己的习惯任选其一,强烈建议都试一试,再选出最适合你的那一个。
- Codex 使用 GPT-5,在整体能力上更强;
- Claude Code 通过 GLM 4.6 转发 API,整体体验接近 Claude 4,但价格更便宜。
不过,哪一个在实际项目中更好用,只能通过亲自测试来判断。掌握多种 AI 编程工具始终是有益的:熟练以后,你可以在不同场景下灵活切换 Claude Code、Codex 或 Trae。如果尝试多次后发现某个工具效果一般,可以直接换一个工具或模型继续试验。
同时,由于模型版本更新非常迅速,建议你优先选择在“性价比(效果 / 成本)”上表现最好的方案。
### Claude Code
Claude Code 是由 Anthropic 基于 Claude 大模型能力开发的一款 AI 编程工具。它的主要交互场景在终端,同时也支持作为 VS Code 插件来使用。类似于 AI IDE 中的 Agent,它可以深度理解开发者的代码仓库,并通过自然语言指令完成端到端的开发任务——包括代码编辑、修复 Bug、执行和修复测试、管理 Git 工作流(例如解决合并冲突、创建 PR)、复杂代码讲解、执行终端命令等。
但把抽象需求变具体,其实是一个很花精力的过程。如果我们没有见过足够多的案例,很难快速联想到该如何把抽象问题拆解成细致的模块。这种时候,最好的办法就是让 AI 帮你完成“具体化”这一步。
比如,我想开发一个“每日计划”应用,最朴素的想法可能是:
`Please help me write a daily planning app where I can write my plans each day and get reminders.`
AI 确实可以在这个需求基础上直接拆分任务,然后一步步完成,但中间容易出错或理解偏差。为了降低风险,我们可以让 AI 帮我们先扩写需求:
`Based on my needs, please elaborate and provide a more detailed Product Requirement Document for reference. My idea is: Please help me write a daily planner app that supports daily plan-writing and provides reminders .`
“Today’s Plan” is a minimalist and highly efficient daily planning and reminder tool, dedicated to helping users eliminate procrastination and forgetfulness, plan every day clearly, and ensure tasks are carried out through an intelligent reminder system—ultimately enabling users to gain a stronger sense of control and achievement over their time.
1.3 Target Users (User Personas)
We mainly serve three types of users:
Students (Xiao Ming):
Characteristics: Multiple tasks such as courses, assignments, club activities, exam prep, needing organized time arrangement.
Pain Points: Easily forget small tasks or assignment deadlines; feel overwhelmed switching between tasks; want to build regular study and life habits.
Needs: A simple tool to list daily to-dos and provide reminders before class/self-study.
Office Workers (Zhang Wei):
Characteristics: Fast-paced work, many meetings, reports, project milestones, and personal affairs (fitness, picking up children).
Pain Points: Easily forget important meetings or work milestones; get interrupted by urgent tasks and forget the original plan; feel busy but inefficient at end of day.
Needs: Need a tool to quickly record and schedule daily work and send strong reminders at key times (e.g., 15 minutes before meetings).
Freelancers/Self-disciplined Seekers (Li Na):
Characteristics: High freedom of time, but strong self-management required for work output and personal growth.
Pain Points: Easily procrastinate, lack external supervision; start the day without a clear plan, leading to low time utilization.
Needs: Need a tool to help build a daily fixed routine (Morning Routine) and review daily achievements for positive feedback.
2. User Stories
As a user, I want to quickly create today’s plan list so I have an overview of all my tasks for the day.
As a user, I want to set specific start and end times for each task so I can create a visual timeline.
As a user, I want to receive push notification reminders before a task starts so I won’t miss any important arrangements.
As a user, I want to customize the reminder time (such as 5, 15, or 60 minutes in advance) so reminders better fit my habits.
As a user, I want to easily mark completed tasks so I can feel accomplished and clearly see my progress.
As a user, I want to see a summary of my completed plans at the end of each day for reviewing and self-motivation.
As a user, I want to conveniently edit and delete tasks to handle last-minute changes.
As a user, I want to view plans and achievements from previous days to review my efficiency and habits.
3. Feature Breakdown
Core Features (MVP - Minimum Viable Product)
Module 1: Plan Management
3.1.1 Daily Plan Homepage
Interface: “Today” as the core view, current date shown at the top.
View: Timeline list, clearly showing tasks scheduled from morning to evening. Tasks without a time can be listed in the top or bottom “To-do List” section.
Interactions:
Click the “+” button in the bottom right to quickly create a new task.
Pull down to refresh the page.
Swipe left/right to view yesterday’s and tomorrow’s plans.
3.1.2 Create/Edit Task
Entry: Click “+” on the homepage or a time slot in the list.
Fields:
Task title (required): Briefly describe the task, e.g., “10 AM Weekly Product Meeting.”
Task time (optional):
Set “start time” and “end time.”
Provide “all-day” option for unspecified time tasks.
Default time picker should be quick and convenient.
Reminder setting (required, with default value): See Module 2.
Notes (optional): Add further descriptions, links, or location info.
Actions: Save, cancel, delete task.
3.1.3 Task Interaction
Mark as complete: Checkbox before each task; checking adds a strikethrough and gray background, indicating completion. Can unmark if needed.
Edit task: Click the task itself to enter edit page.
Delete task: Swipe left on a task to reveal “Delete” button.
Module 2: Smart Reminder System
3.2.1 Reminder Trigger
Mechanism: Based on task’s set “start time” and the user’s “reminder lead time,” send a push notification from device.
Offline Support: Locally scheduled reminders must trigger even if user is offline.
3.2.2 Reminder Content & Format
Notification title: App name “Today’s Plan.”
Body: “Reminder: [Task Title] will start at [Start Time].” E.g., “Reminder: Product Meeting will start at 10:00.”
Sound: Use system default or offer several simple, effective tones.
3.2.3 Reminder Settings
Global Settings (in Settings page):
User can set a default reminder time, e.g., “15 minutes before task starts.” New tasks adopt this by default.
Single Task Settings (in create/edit page):
Users can override global settings for important tasks, choosing specific reminder times like "on time," "5 minutes early," "30 minutes early," or "1 hour early."
Provide “no reminder” option.
Subsequent Features (V1.1, V2.0)
3.3 Daily Review & Statistics
Push a summary notification at a set time every night (e.g., 22:00): “How was your day? Take a look at your achievements!”
Generate a simple daily report card: shows total planned tasks, completed tasks, completion rate, plus an encouraging message.
3.4 History Review
Calendar view to click on any past day and check its plans and completion status. Days with high completion rates marked with a special color.
3.5 Templates
Allow users to save a successful daily plan as a template, e.g., “Efficient Workday,” “Relaxing Weekend.”
When creating tomorrow’s plan, one-click import a template, modify slightly to save time.
3.6 Themes & Personalization
Offer dark mode.
Allow changing several primary color themes.
4. Non-Functional Requirements
4.1 Performance
Response: App launch time under 2 seconds; adding/editing tasks must be smooth and lag-free.
Resource Use: Low battery and memory consumption in background; do not over-consume resources waiting for reminders.
4.2 Usability
Minimal & intuitive: UI must be minimal, primary functions accessible within 3 clicks. No tutorial needed for new users.
Error tolerance: Offer undo (e.g. brief undo after mistakenly deleting a task).
4.3 Reliability
Reliable reminders: Reminder function is the product’s lifeline; must guarantee 99.99% timely and accurate delivery.
Data loss-free: User plans must be reliably stored locally. Future versions can support cloud sync to prevent data loss on device change.
4.4 Compatibility
Platform: Support major iOS and Android versions (latest 3-4 releases).
Screen: Layout must fit various phone screen sizes.
5. Roadmap
V1.0 (MVP):
Goal: Validate core value—planning & reminders.
Features: Complete all “Core Features” described above (Plan management, smart reminders).
对比我们最开始那句“帮我写一个每天可以记计划并提醒的应用”,现在这份文档已经详细得多了。你可以根据自己的真实需求,对其中的内容进行增删修改;对于某些你不确定的模块,也可以继续让 AI 提供更多备选方案,你再挑选、合并成最终版本。
通过这种方式,我们可以很轻松地把抽象想法变成具体描述。对 AI 开发来说,“具体”就是生产力:需求越具体,越容易得到结构稳定、质量较高的项目。你可以尝试用这种方式重做一下之前的某个小项目,对比一下效果差异。
如果你觉得这类“需求提示词”太长,非常自然的做法,是把它单独写进一个 markdown 文档中,作为你的“需求文档 / 开发文档 / PRD”。之后每次让 AI 写项目时,只需要让它“参考这份文档”,而不是每次都重打一遍长提示。你也可以在迭代中不断完善这份文档,让后续项目直接受益。
下面是一些其他常见的使用场景:
### 管理文件夹
我们可以尝试用 CLI AI 编程工具来管理当前文件夹中的各种文件。比如,你有一堆杂乱无章的文件,需要整理归类,就可以对 Claude Code 或 Codex 说:
`Please help me organize the contents of the current folder. I want to group files with the same content together & I want to group files from the same time period together. Please help me handle this.`
### 开发新项目
这和我们之前在 z.ai、Trae 中的用法几乎完全一样——我们也可以直接用 CLI AI 编程工具来从零开发新项目。当然,最好提前准备好一份需求文档。