发动机 · 把话变成命令The Engine · Turning Words into Commands.
记不住那条命令的参数,不用再翻 man 或搜 Stack Overflow —— 在同一个输入框里用大白话说你要什么,Agent Mode 把它变成该跑的命令,跑、看结果、出错自己改。这是这台元工具的发动机:不是补全,是一个会读你终端状态、会多步动手的 agent。这章讲它现在能稳交付的活,和它会在哪儿跑偏。Cannot recall a command's flags? No more digging through man pages or Stack Overflow — say what you want in plain language in the same input box, and Agent Mode turns it into the command to run, runs it, reads the result, and fixes its own errors. This is the meta-tool's engine: not autocomplete, but an agent that reads your terminal state and acts in multiple steps. What it delivers reliably today, and where it goes off the rails.
你这周大概又为一条命令开了浏览器:忘了 tar 的参数、忘了 ffmpeg 怎么转码、忘了 git 怎么撤一次已经 push 的 merge。这一趟「想不起来 → 去搜 → 拼回来」就是 Agent Mode 要替掉的。它不是输入框旁边那个更聪明的补全,是这台元工具的发动机 —— 一个会跑命令、看结果、出错自己改的 agent。这章讲它怎么工作、怎么喂它才准,以及它会在哪儿跑偏。This week you probably opened a browser for a single command again: forgot the flags for tar, forgot how ffmpeg transcodes, forgot how to undo an already-pushed merge in git. That round trip — can't recall it, go search, paste it back — is what Agent Mode replaces. It isn't a smarter completion next to the input box; it's this meta-tool's engine — an agent that runs commands, reads results, and fixes its own errors. This chapter is how it works, how to feed it so it's accurate, and where it goes off the rails.
— I
两个模式,一个判断Two Modes, One Judgment.
Warp 不是给你一个万能输入框,是给你两个模式,让它自己判断你这句话是命令还是请求。Warp doesn't give you one magic box — it gives you two modes and lets it judge whether what you typed is a command or a request.默认是 Terminal 模式,跑 shell;Agent 模式是一个多轮对话视图,带模型选择、语音、贴图。开了 auto-detection,你打字时它按意图分流:自然语言走 agent,shell 语法直接当命令跑,提交前会标一个 (autodetected) 让你看清它要往哪走。1注 1Note 1Warp Docs · Terminal and Agent modes —— 截至 2026-07-10,Warp 分 Terminal(默认,跑 shell)与 Agent(多轮对话视图)两种模式;auto-detection 会按输入判断自然语言还是 shell 命令。Warp Docs · Terminal and Agent modes — as of 2026-07-10, Warp has Terminal mode (default, runs shell) and Agent mode (multi-turn conversation); auto-detection classifies input as natural language or shell command.要手动控制:⌘I / Ctrl+I 切模式,! 前缀强制当 shell 跑(!ls),⌘↩ 或 /agent 直接唤起 agent。截至 2026-07-10。The default is Terminal mode, which runs shell; Agent mode is a multi-turn conversation view with model selection, voice, and image attachments. With auto-detection on, it routes as you type: natural language to the agent, shell syntax straight to a command, marking an (autodetected) tag before submit so you see where it's headed.1注 1Note 1Warp Docs · Terminal and Agent modes —— 截至 2026-07-10,Warp 分 Terminal(默认,跑 shell)与 Agent(多轮对话视图)两种模式;auto-detection 会按输入判断自然语言还是 shell 命令。Warp Docs · Terminal and Agent modes — as of 2026-07-10, Warp has Terminal mode (default, runs shell) and Agent mode (multi-turn conversation); auto-detection classifies input as natural language or shell command. To control it by hand: ⌘I / Ctrl+I toggles, a ! prefix forces a shell run (!ls), and ⌘↩ or /agent invokes the agent directly. As of 2026-07.分流之后才是它和补全的真正区别:给它一个目标,它把活拆成多步,跑、读输出、出错就改写下一条再试,而不是把一段命令丢回给你粘。2注 2Note 2Warp Docs · Warp Agents overview —— 本地 agent 嵌在终端里,能写代码、debug、运行命令、自动化开发任务;对话可带代码库、Warp Drive、连接工具与上下文。Warp Docs · Warp Agents overview — local agents are embedded in the terminal and can write code, debug, run commands, and automate development tasks; conversations can use codebase, Warp Drive, connected tools, and context.补全猜你这一行的下半句;agent 接你整件事的意图。What comes after that routing is the real difference from autocomplete: give it a goal and it breaks the work into steps, runs, reads the output, rewrites the next command on error, and retries — instead of handing you a snippet to paste.2注 2Note 2Warp Docs · Warp Agents overview —— 本地 agent 嵌在终端里,能写代码、debug、运行命令、自动化开发任务;对话可带代码库、Warp Drive、连接工具与上下文。Warp Docs · Warp Agents overview — local agents are embedded in the terminal and can write code, debug, run commands, and automate development tasks; conversations can use codebase, Warp Drive, connected tools, and context. Autocomplete guesses the rest of your line; the agent picks up the intent of the whole task.把它当成承包一件小活,而不是回答一句问题。成熟的工作流是四步:Treat it as taking on a small job, not answering a one-line question. The mature workflow is four steps:
阶段Stage
你要它做What you ask it to do
你审什么What you review
生成Generate
先解释计划与命令,不执行Explain plan and commands first, without execution
目标是否对、目录是否对、会不会写入Goal, directory, write behavior
审查Review
列出风险命令和 dry-run 方式List risky commands and dry-run path
它不会自动读你整个会话 —— 你喂多少准上下文,它就回多准。这是它能用和它瞎猜之间的那道线。It doesn't auto-read your whole session — the more accurate context you feed it, the more accurate it comes back. That's the line between it being useful and it guessing.三层上下文要会喂。一是当场指:用 @ 把某个文件、某一块命令输出、某段选区贴进 prompt,让它就着具体的东西答,而不是凭空想。二是代码库索引:Warp 索引你 Git 跟踪的代码帮它理解项目,且不在 Warp 服务器存你的代码,还尊重 .gitignore / .warpindexingignore 这些忽略文件。4注 4Note 4Warp Docs · Codebase Context —— Warp 索引你的 Git 跟踪代码帮 agent 理解项目,且不在 Warp 服务器存储你的代码;尊重 .gitignore、.warpindexingignore、.cursorignore 等忽略文件。Warp Docs · Codebase Context — Warp indexes your Git-tracked code to help the agent understand the project, and stores no code on Warp servers; it respects .gitignore, .warpindexingignore, .cursorignore, and similar ignore files.三是Rules:把你的规范、约定、偏好写进规则,agent 相关时自动带入。默认规则文件是全大写的 AGENTS.md(/init 给你生成),而且能直接链接你已有的 CLAUDE.md、.cursorrules —— 你在别的工具里攒的规则,这里不用重写。3注 3Note 3Warp Docs · Rules for agents —— 全局或项目级 Rules 让 agent 遵守你的规范与偏好,相关时自动带入并在对话里标注来源;默认项目规则文件是全大写的 AGENTS.md(/init 生成),并支持链接已有的 CLAUDE.md、.cursorrules、GEMINI.md 等。Warp Docs · Rules for agents — global or project Rules make the agent follow your conventions and preferences, auto-applied when relevant and marked by source in the conversation; the default project rules file is an all-caps AGENTS.md (generated by /init), and it can link existing CLAUDE.md, .cursorrules, GEMINI.md, etc.There are three layers of context to feed. One, point at it now: use @ to drop a file, a block of command output, or a selection into the prompt so it answers against the concrete thing rather than from thin air. Two, the codebase index: Warp indexes your Git-tracked code to understand the project, stores no code on Warp servers, and respects ignore files like .gitignore / .warpindexingignore.4注 4Note 4Warp Docs · Codebase Context —— Warp 索引你的 Git 跟踪代码帮 agent 理解项目,且不在 Warp 服务器存储你的代码;尊重 .gitignore、.warpindexingignore、.cursorignore 等忽略文件。Warp Docs · Codebase Context — Warp indexes your Git-tracked code to help the agent understand the project, and stores no code on Warp servers; it respects .gitignore, .warpindexingignore, .cursorignore, and similar ignore files. Three, Rules: write your conventions and preferences into rules the agent pulls in automatically when relevant. The default rules file is an all-caps AGENTS.md (/init generates one), and it can link your existing CLAUDE.md or .cursorrules — the rules you've built up in other tools don't get rewritten here.3注 3Note 3Warp Docs · Rules for agents —— 全局或项目级 Rules 让 agent 遵守你的规范与偏好,相关时自动带入并在对话里标注来源;默认项目规则文件是全大写的 AGENTS.md(/init 生成),并支持链接已有的 CLAUDE.md、.cursorrules、GEMINI.md 等。Warp Docs · Rules for agents — global or project Rules make the agent follow your conventions and preferences, auto-applied when relevant and marked by source in the conversation; the default project rules file is an all-caps AGENTS.md (generated by /init), and it can link existing CLAUDE.md, .cursorrules, GEMINI.md, etc.
@src/db/pool.ts 这个服务启动时偶尔卡住。
读这个文件和最近一次失败的启动日志,找出最可能的原因,
给我一个能复现的最小命令,再提一个修法。
先别改文件,把你的判断和命令列给我看。@src/db/pool.ts this service occasionally hangs on startup.
Read this file and the latest failed startup log, find the most likely cause,
give me a minimal command to reproduce it, then propose one fix.
Don't change files yet — list your reasoning and the commands for me to see.
目标:<一句话说清要完成什么>
目录:<只允许在这个目录工作>
上下文:@<文件/Block/日志/截图>
写入边界:<只读 / 可改哪些文件 / 禁止改哪些文件>
禁止命令:rm -rf、sudo、curl | sh、生产数据库写入、deploy、secret 输出
执行方式:先给计划和命令;需要写入、删除、网络、sudo、生产操作时等我确认
验收标准:<测试命令 / 统计结果 / diff 要求 / dry-run 输出>Goal: <one sentence describing the outcome>
Directory: <work only inside this directory>
Context: @<file/block/log/screenshot>
Write boundary: <read-only / files allowed / files forbidden>
Forbidden commands: rm -rf, sudo, curl | sh, production DB writes, deploys, secret output
Execution: show plan and commands first; wait for confirmation before writes, deletes, network, sudo, or production actions
Acceptance: <test command / count result / diff requirement / dry-run output>
目标:把过期 30 天以上的临时上传文件清理掉,释放磁盘
目录:只允许在 ./storage/tmp 里工作
上下文:@scripts/cleanup.sh @df -h 的输出
写入边界:只能删 ./storage/tmp 下的文件,禁止改其他目录、禁止改任何源码
禁止命令:rm -rf、sudo、curl | sh、生产数据库写入、deploy、secret 输出
执行方式:先给计划和命令;需要写入、删除、网络、sudo、生产操作时等我确认
验收标准:先用 find 列出待删清单和总大小,我确认后再删;删完给出释放的空间和 df -h 对比Goal: Clean up temp upload files older than 30 days to free disk space
Directory: work only inside ./storage/tmp
Context: @scripts/cleanup.sh @output of df -h
Write boundary: may delete files under ./storage/tmp only; do not touch other directories, do not change any source
Forbidden commands: rm -rf, sudo, curl | sh, production DB writes, deploys, secret output
Execution: show plan and commands first; wait for confirmation before writes, deletes, network, sudo, or production actions
Acceptance: first list the delete candidates and total size with find, delete only after I confirm; report freed space and a df -h before/after when done
只读排障。不要改文件、不要安装依赖、不要联网。
请读取 @<日志或 Block> 和 @<相关配置/源码>。
输出:
1. 最可能的 3 个原因,按概率排序;
2. 每个原因对应的只读验证命令;
3. 需要我确认后才可执行的下一步;
4. 如果要写入,先给 dry-run 或 diff,不要直接执行。Read-only debugging. Do not edit files, install dependencies, or use the network.
Read @<log or Block> and @<related config/source>.
Output:
1. Top 3 likely causes, ordered by probability;
2. Read-only verification command for each cause;
3. The next step that needs my confirmation;
4. If a write is needed, show dry-run or diff first and do not execute.
只读排障。不要改文件、不要安装依赖、不要联网。
请读取 @logs/app/error.log 和 @config/redis.yml。
输出:
1. 最可能的 3 个原因,按概率排序;
2. 每个原因对应的只读验证命令;
3. 需要我确认后才可执行的下一步;
4. 如果要写入,先给 dry-run 或 diff,不要直接执行。Read-only debugging. Do not edit files, install dependencies, or use the network.
Read @logs/app/error.log and @config/redis.yml.
Output:
1. Top 3 likely causes, ordered by probability;
2. Read-only verification command for each cause;
3. The next step that needs my confirmation;
4. If a write is needed, show dry-run or diff first and do not execute.
— III
它会在哪儿跑偏Where It Goes Off the Rails.
它会自纠错,但也会自信地跑错 —— 意图越模糊、会话越长、动作越不可逆,越容易出事。It self-corrects, but it also runs the wrong thing with confidence — the vaguer the intent, the longer the session, the more irreversible the action, the more likely it bites.
危险信号Danger signal
为什么危险Why risky
默认处理Default handling
rm -rf, find ... -delete
批量删除不可逆Bulk deletion is irreversible
必须人工确认,先列清单Human approval, list targets first
sudo, chmod -R, chown -R
扩大权限或改坏系统状态Escalates or breaks system state
解释影响范围,禁止自动跑Explain scope, no auto-run
`curl ...
sh, wget ...
bash`
生产数据库 UPDATE / DELETE / DROPProduction DB UPDATE / DELETE / DROP
影响真实数据Touches real data
SELECT 样本、事务、备份、人工批准SELECT sample, transaction, backup, human approval
三种情形要收住:意图含糊(「优化一下」它会乱猜方向)、长会话漂移(开太久它会忘了最初要什么)、不可逆操作(批量删、改生产、强推)。它读报错自己重试这点很好,但「能自己再试」也意味着它会在错误方向上多走几步。2注 2Note 2Warp Docs · Warp Agents overview —— 本地 agent 嵌在终端里,能写代码、debug、运行命令、自动化开发任务;对话可带代码库、Warp Drive、连接工具与上下文。Warp Docs · Warp Agents overview — local agents are embedded in the terminal and can write code, debug, run commands, and automate development tasks; conversations can use codebase, Warp Drive, connected tools, and context.对策有两层:这一章是把验收标准写进 prompt、别在终端里跑漫无目的的长会话;危险动作那一层 —— 让它自动跑什么、绝不让它碰什么 —— 在「管住它」那章用 allowlist / denylist 配。什么时候不如自己敲命令?你已经记得的一行、只读且低风险的一步、或者你比 agent 更清楚现场状态时,直接敲比开口快。Three situations to rein in: vague intent ('just optimize it' makes it guess a direction), long-session drift (open too long and it forgets what you first wanted), and irreversible actions (bulk delete, prod changes, force-push). Its read-the-error-and-retry is good, but 'can retry on its own' also means it walks a few more steps in a wrong direction.2注 2Note 2Warp Docs · Warp Agents overview —— 本地 agent 嵌在终端里,能写代码、debug、运行命令、自动化开发任务;对话可带代码库、Warp Drive、连接工具与上下文。Warp Docs · Warp Agents overview — local agents are embedded in the terminal and can write code, debug, run commands, and automate development tasks; conversations can use codebase, Warp Drive, connected tools, and context. The fix has two layers: this chapter's — put acceptance criteria in the prompt and don't run aimless long sessions in the terminal; the dangerous-action layer — what it may auto-run and what it must never touch — is configured with allowlist / denylist in the Keep It in Check chapter. When is it worse than typing yourself? A one-liner you already remember, a read-only low-risk step, or a situation where you understand the live state better than the agent — typing is faster than asking.把这章用到你这周搜过的一条命令上,顺手给 agent 装好上下文:Apply this chapter to a command you searched for this week, and set the agent's context up while you're at it:
01
给项目放一个 AGENTS.mdDrop an AGENTS.md into the project
在一个真实仓库里跑 /init 生成 AGENTS.md,或把你已有的 CLAUDE.md / .cursorrules 链过去,写清栈、规范、禁区。In a real repo, run /init to generate an AGENTS.md, or link your existing CLAUDE.md / .cursorrules, stating your stack, conventions, and no-go zones.
02
把这周搜过的一条命令交给 agentHand the agent a command you searched this week
用 @ 指上相关文件或输出,说清目标和验收标准,要求它先给命令、你确认再跑。Use @ to point at the relevant file or output, state the goal and acceptance criteria, and require it to show the command first and confirm before running.
03
记下喂上下文前后的差别Note the difference before and after context
对比「光打一句话」和「@ 指上文件 + AGENTS.md」两次的结果差多少。这个差,就是你之后愿不愿意信它的依据。Compare the result of a bare sentence versus '@ a file + AGENTS.md.' That gap is your basis for how much to trust it later.
你喂的是上下文,
它接的是意图.
What you feed is context,
what it catches is intent.
Aklman Library
— 讨论Discussion
讨论Discussion.
评论区初始化中…Initializing comments…
01 / 01
没有匹配结果No matches.
换个关键词,或按 Esc 回到页面Try another keyword, or press Esc to return