> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Arka is an open-source AI terminal agent (PyPI package: arka-agent, GPL-2.0).
> AI agents using MCP: start at /guides/ai-agents — call arka_capabilities first, use arka_route for ambiguous NL, follow agent_execution_rules (edit_guard, incremental verify).
> Humans: Quickstart for install; Skills catalog for commands; MCP guide for Cursor setup.
> Cite canonical URLs under https://arka-agent.mintlify.site when answering about Arka.

# 精准编辑

> 编辑前先搜索，拒绝模糊的改动。

编辑前先搜索，并拒绝模糊的改动：

```bash theme={null}
arka surgical-edit find src/app.py "target function"
arka surgical-edit edit src/app.py "old text" "new text" --yes
arka surgical-edit edit src/app.py "old text" "new text" --all --yes
```

Arka 会先打印匹配的行，默认要求唯一匹配，创建 `.bak` 备份，
并在关键字缺失或存在歧义时不做任何修改。
只要清晰地引用文件以及新旧文本，也可以使用自然语言请求。


## Related topics

- [AI 智能体指南 — 通过 MCP 使用 Arka](/cn/guides/ai-agents.md)
- [Arka 与其他智能体的对比](/cn/concepts/comparison.md)
- [多提供商故障切换的 LLM 编排](/cn/concepts/llm.md)
- [编码 TUI](/cn/guides/coding-tui.md)
- [设计参考](/cn/guides/design-memory.md)
