Tau — 简约 Python 编码智能体
在终端里运行的轻量级编码智能体,可读代码、编辑文件、执行命令,并保持会话历史。
- Star 数
- ★ 3k
- 最近更新
- 5 天前
- License
- MIT
- 主语言
- Python
- FA 评分
- 53/100 · 缺口较多
30 秒速览
- 运行形态
- 可在哪里用
- 通用 · 跨平台OpenAI API · Claude APIChatGPT · Codex(部分支持)
- 费用
- 软件免费,模型调用费用自付
- 上手难度
- 低 · 几分钟可跑通
- 开始前需要
- 典型场景
- 开发者希望在本地项目上获得终端内的编码助手,用于解释代码、添加测试或修复堆栈跟踪。
- 不适合
- 需要 Python 3.12 以下旧环境的团队
- 希望开箱即用、功能完备的生产级工具的用户
- 不愿安装 uv 或额外依赖的极简环境
- 源码审查
- 53/100 · 缺口较多
这个 Agent 能做什么,适合哪些场景?
Tau 是一个遵循 MIT 许可的 Python 项目,提供了一个终端编码智能体框架,其设计理念是“小而可读”,旨在成为教学范例。它由三个分层包组成:tau_ai 统一模型提供商,tau_agent 提供可移植的智能体核心(消息、工具、事件、循环),tau_coding 将其封装为完整的编码应用(CLI、TUI、工具、会话存储)。Tau 通过命令行界面使用 Textual 提供交互式 TUI 和一次性打印模式,其核心通过类型化事件流与前端解耦。会话以 JSONL 格式持久化在 ~/.tau/sessions/ 下,支持恢复和分支。它支持多种模型提供商,包括 OpenAI、Anthropic、OpenRouter 和 Hugging Face,并可通过目录文件(catalog.toml)自定义。
Tau 提供 tau 命令,用于在终端中交互式操作,或通过 -p 参数执行一次性提示。它内置了 read、write、edit 和 bash 工具,允许读取文件、编辑代码和运行 shell 命令。它管理持久化的 JSONL 会话(位于 ~/.tau/sessions/),支持读取 AGENTS.md 等项目指令,并提供 /login、/model 等斜杠命令。它以 tau_agent 库的形式暴露 AgentHarness 类,供开发者集成到自己的应用中。
- 开发者希望在本地项目上获得终端内的编码助手,用于解释代码、添加测试或修复堆栈跟踪。
- 用户需要一个可由单个终端命令驱动的自动化脚本,例如
tau -p "summarize the architecture"。 - 团队希望统一管理会话记录,用于审计或恢复工作状态。
- 开发者希望学习构建编码智能体的架构,通过阅读 tau_ai、tau_agent、tau_coding 的分层代码。
- 用户需要自定义模型提供商,通过编写 catalog.toml 添加自定义的 OpenAI 兼容端点。
如何安装或部署这个 Agent?
macOS/Linux 可通过 curl -LsSf https://twotimespi.dev/install.sh | sh 安装;Windows PowerShell 可通过 irm https://twotimespi.dev/install.ps1 | iex 安装。也可使用 uv tool install tau-ai 或 pipx install tau-ai。需要 Python 3.12+。
如何使用这个 Agent?
在项目目录下运行 tau 启动交互式 TUI,输入请求并回车。一次性模式使用 tau -p "..."。首次使用需通过 /login 连接模型提供商,例如 /login openai。可通过 tau --cwd /path/to/project -p "..." 指定工作目录。
这个 Agent 有哪些优点和局限?
- 分层设计(tau_ai、tau_agent、tau_coding)清晰,便于学习和扩展。
- 事件驱动架构,支持多种前端(TUI、打印模式、自定义)。
- 会话持久化为 JSONL,支持恢复和分支。
- 通过 catalog.toml 支持自定义模型提供商,无需修改代码。
- 需要 Python 3.12+,可能对旧环境不兼容。
- 模型提供商支持依赖外部 API,可能需要订阅或 API 密钥。
- 作为教学项目,功能可能不如成熟工具全面。
- 安装脚本会安装 uv,可能引入额外依赖。
这个 Agent 与同类方案有什么区别?
Tau 的设计灵感来自于 Pi 编码智能体,但它是用 Python 编写的,提供了更简洁的实现。
与相关度最高的同类 agent 并排比较关键指标。
| Agent | 源码审查 | 形态 / 费用 | Star | 最近更新 | 主语言 | 完整支持的平台 |
|---|---|---|---|---|---|---|
| Tau — 简约 Python 编码智能体 当前 | 53 · 缺口较多 | 命令行工具免费 + 模型费 | ★ 3k | 5 天前 | Python | OpenAI API · Claude API |
| ClawCodex | 51 · 缺口较多 | 命令行工具免费 + 模型费 | ★ 911 | 今天 | TypeScript | ChatGPT · OpenAI API · Claude API |
| zerostack | 57 · 缺口较多 | 命令行工具免费 + 模型费 | ★ 1.7k | 5 天前 | Rust | OpenAI API · Claude API |
| MiniCode | 50 · 缺口较多 | 命令行工具免费 + 模型费 | ★ 1.1k | 10 天前 | TypeScript | Claude API |
FollowAgents 如何评估这个 Agent?
查看各维度的扣分理由
证据显示:安装脚本不使用sudo,工具以普通函数实现,会话历史为追加式JSONL,提供/模型目录可自定义,但未发现权限最小化、用户确认、数据流透明、敏感数据处理、依赖安全、外部影响、回滚或来源归属的明确实现或文档。扣分原因:这些方面在提供的文件中没有充分证据,仅凭README中的描述不足以证明其存在。
证据显示:代码结构清晰,测试覆盖了核心harness功能,依赖版本有约束,错误处理有测试。扣分原因:未提供依赖可用性、失败消息质量的直接证据,且测试未在真实环境中运行。
证据显示:README描述了多种使用场景(交互式TUI、打印模式、库使用),能力边界清晰(核心不依赖前端),触发方式明确(命令行、/login等),环境适配(macOS、Linux、Windows)。扣分原因:未提供针对不同用户群体的详细说明,能力边界在代码中未完全验证。
证据显示:README结构清晰,安装说明详细,命名稳定(tau-ai),有示例和FAQ,MIT许可证明确,有版本号(0.3.9)。扣分原因:未提供已知限制的明确说明,版本变更日志未提供,维护责任未明确(未验证发布者)。
证据显示:输出为事件流,可被多种前端消费,提供了库接口,安装简单。扣分原因:未提供成本效益分析,边际价值未量化。
证据显示:README中的声明与代码结构基本一致,测试文件提供了部分验证。扣分原因:未提供外部来源的佐证,事实与推断未明确分离。
- 发布者身份未验证,维护责任和更新路径不明确。
- 未提供已知限制的明确说明,用户可能对边界条件缺乏预期。
- 依赖安全未明确评估,建议检查依赖漏洞。
- 安装脚本虽然不使用sudo,但建议审查其内容。
最近版本
来自该项目 GitHub Releases 的最新发布记录,说明为上游原文摘录,未经本站改写或测试。
-
v0.4.8 Tau 0.4.8
发布说明摘录
New - Expose the active session's provider and model inventory to extensions with ExtensionContext.available_providers and ExtensionContext.available_model_choices. - Expose the session's project-trust decision on ExtensionContext and let hosts restrict child sessions with CodingSessionConfig.allowed_tool_names. Changed - Migrate the documentation website from Hugo to Astro and redesign it as a typeset math paper. Fixed - Retry provider requests on raw TLS record errors (ssl.SSLError) before any content is streamed. …在 GitHub 查看 ↗ -
v0.4.7 Tau 0.4.7
发布说明摘录
New - Archive sessions or whole projects from /resume with Ctrl+Enter without deleting files. Use the Archived tab (F2) and Enter to restore them. Fixed - Restore Option/Alt-arrow word navigation in the prompt inside Herdr, including Kitty Alt+b/Alt+f forwarding. Shift+Option/Alt-arrows select by word. - Create a fresh provider runtime when a new session selects a different provider instead of reusing the previous session's runtime. - Handle Delete correctly in the /resume search field. Upgrade ```bash uv tool upgrade tau-ai ``` …在 GitHub 查看 ↗ -
v0.4.6 Tau 0.4.6
发布说明摘录
Changed - Preview model and thinking shortcuts immediately in the TUI and record only the final selection when sending a prompt; unsent choices remain session-only. - Open /model and /scoped-models from cached choices with a virtualized list, then refresh catalogs in the background after the picker renders. - Limit GitHub Actions token permissions per job and pin workflow actions to immutable commit SHAs. Fixed …在 GitHub 查看 ↗