Termux AI Agent - 智能终端助手,支持多平台AI(DeepSeek/阿里云百炼/硅基流动),JSON模式工具调用、文件精确编辑、后台任务处理、对话历史
Project description
Termux AI Agent v3.2.5
智能终端助手 —— 专为 Termux 环境设计的 AI Agent,支持多平台 AI(DeepSeek / 阿里云百炼 / 硅基流动)。
功能特性
- 多平台 AI 支持 —— DeepSeek、阿里云百炼(通义千问)、硅基流动,一键切换
- JSON 模式工具调用 —— 自动执行 shell 命令、读写文件、访问网页
- 文件精确编辑 —— replace_in_file 只替换需要改的部分
- 后台任务处理 —— 自动识别服务启动命令并加
&后台运行 - 对话历史 —— 实时保存,下次启动可继续对话,支持 AI 自动命名
- 用户自定义规则 —— 嵌入系统提示词,个性化 AI 行为
- 国内镜像源 —— 支持阿里云/清华源/中科大/自定义四种模式
- Token 用量统计 —— 输入 token 命令查看当前对话消耗
- API 错误汉化 —— 常见英文报错自动翻译为中文
- 终端美化 —— lolcat 彩虹特效、打字机动画、加载动画
- Termux 环境检测 —— 启动时自动验证运行环境
安装
准备工作:安装 Termux
本工具基于 Termux 环境运行,如果你还没有安装 Termux,请先下载安装:
第一步:换国内镜像源(加速下载)
echo "deb https://mirrors.tuna.tsinghua.edu.cn/termux/apt/termux-main stable main" > $PREFIX/etc/apt/sources.list && apt update
第二步:安装 Python
pkg install python -y
第三步:安装 Termux AI Agent
python -m pip install termux-ai-agent
第四步:启动
termux-ai-agent
从源码安装
git clone https://github.com/user/termux-ai-agent.git
cd termux-ai-agent
pip install -e .
快速开始
安装后直接运行:
termux-ai-agent
或者作为 Python 模块运行:
python -m deepseek_agent
首次运行需要:
- 同意用户协议与隐私政策
- 输入 API Key(支持 DeepSeek、阿里云百炼、硅基流动)
可用工具
| 工具 | 功能 |
|---|---|
| run_shell | 执行系统命令 |
| read_file | 读取文件(带行号) |
| write_file | 安全写入文件 |
| replace_in_file | 精确替换文件内容 |
| mkdir | 创建目录 |
| fetch_webpage | 访问网页(Lynx) |
| ask_user | 向用户提问 |
特殊命令
| 命令 | 功能 |
|---|---|
| help / 帮助 | 显示帮助信息 |
| setting / 设置 | 打开设置菜单(切换平台/模型/镜像源等) |
| clear | 清屏 |
| token | 查看当前对话 Token 用量(估算) |
| history | 浏览和加载历史对话 |
| reset | 重置对话并删除历史 |
| exit / 退出 | 保存并退出 |
支持的 AI 平台
| 平台 | 默认模型 | 获取 Key |
|---|---|---|
| DeepSeek | deepseek-v4-pro | https://platform.deepseek.com/api_keys |
| 阿里云百炼 | qwen-max | https://bailian.console.aliyun.com/?apiKey=1 |
| 硅基流动 | Qwen/Qwen3-235B-A22B | https://cloud.siliconflow.cn/account/ak |
系统要求
更新日志
v3.2.5 (2026-07-03)
- 新增:多平台 AI 支持 —— DeepSeek / 阿里云百炼(通义千问)/ 硅基流动
- 新增:分平台独立存储 API Key,互不覆盖
- 新增:API 错误信息自动汉化
- 新增:token 命令 —— 查看当前对话 Token 用量(估算)
- 新增:终端美化 —— lolcat 彩虹特效 + 打字机动画 + 加载动画
- 新增:用户输入去重 + 工具调用结果缓存
- 新增:AI 自动为会话生成简短名称
- 优化:设置菜单增加 AI 平台切换入口
v3.2.0 (2026-06-28)
- 修复:pkg 安装阻塞 —— 安装策略优化,优先使用系统默认源,失败后自动切换镜像
- 修复:工具调用异常 —— 参数解析失败时向 API 返回错误消息,避免对话卡死
- 优化:Termux 环境自动检测 —— 启动时自动验证运行环境
v3.1.2 (2026-06-25)
- 优化:完善 README.md 文档,新增 Termux 下载链接
- 优化:新增作者主页链接
v3.1.1 (2026-06-24)
- 修复:README.md 格式问题,优化 PyPI 页面显示
- 优化:完善项目文档,新增从零开始安装步骤
v3.1.0 (2026-06-23)
- 新增:首次发布到 PyPI,包名 deepseek-agent-2026
- 新增:支持 pip install 安装
- 功能:JSON 模式工具调用、用户自定义规则、对话历史、国内镜像源
v3.0.0 (2026-05-09)
- 新增:用户自定义规则系统
- 新增:reset 命令,重置对话并清除历史
- 新增:关于页面
v2.9.0 (2026-05)
- 新增:文件读取带行号
- 新增:安全文件写入
- 优化:动态输出规则
v2.8.0 (2026-04)
- 新增:对话历史记录
- 新增:后台任务智能识别
- 优化:搜索引擎优化
v2.7.0 及更早
- 新增:JSON 模式工具调用
- 新增:自动安装依赖
- 新增:彩色终端输出
- 新增:设置中心
卸载
python -m pip uninstall termux-ai-agent -y
作者主页
👉 作者主页:https://www.rtsbox.cn/author/17993?t=0#67m5s
许可证
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termux_ai_agent-3.2.5.tar.gz.
File metadata
- Download URL: termux_ai_agent-3.2.5.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4f9785206ca5484f57eaac53480cd2a55a2fe40e8a89a167f2200d0569e4284
|
|
| MD5 |
da9362fcdcf7366f9902fba117e3e314
|
|
| BLAKE2b-256 |
24b7fd0fe9e0b8ae5b562a197ab9acc0a45bea9f31b8f64afd452f1c87c3027e
|
File details
Details for the file termux_ai_agent-3.2.5-py3-none-any.whl.
File metadata
- Download URL: termux_ai_agent-3.2.5-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0f2c676b95cd734ee7b61c8adbef4ea721859dd531fc994e29f8db46f76b2cb
|
|
| MD5 |
3381f3205bf5baeab2726203a5bec783
|
|
| BLAKE2b-256 |
a526e001e2075c064123e2603fba93114d223e50dec957561a63b87466a0ee19
|