@imlingdu/reasonix-tools
v0.0.8
Published
Reasonix-tools — 专为 DeepSeek 打造的 AI 命令行工具,支持对话、规划、编码、文件操作和子智能体编排。
Downloads
1,022
Maintainers
Readme
Reasonix-tools 🚀
专为 DeepSeek 打造的 AI 命令行工具 — 智能对话、代码生成、任务规划、文件操作、子智能体编排,一切尽在终端。
特性
- 🔥 纯 DeepSeek 专版 — 原生对接 DeepSeek API,推理、编码、对话全覆盖
- 💬 持续对话 — 自动在 chat/code/plan 模式间切换,像真人一样理解上下文
- 📝 智能编码 — 直接读/写工作区文件、执行命令、调试问题
- 🎯 结构化规划 — 复杂任务自动分解为多步骤计划,逐步执行,动态调整
- 🔄 子智能体编排 — 自动启用多分支自一致性推理,提高回答质量
- 🗂 话题管理 — 自动检测话题切换,支持多话题并行对话
- 🔐 权限控制 — 文件写入、命令执行、网络访问均可按需授权
- 📦 零依赖安装 — 轻量级,仅需 Node.js 20+
快速开始
1. 安装
npm install -g reasonix-tools2. 初始化
Reasonix-tools init按向导设置你的 DeepSeek API Key 和偏好配置。
3. 开始使用
# 进入交互式持续对话模式(推荐)
Reasonix-tools
# 单次问答
Reasonix-tools chat "什么是 DeepSeek?"
# 编码任务
Reasonix-tools code "创建一个 Express 服务器"
# 复杂规划
Reasonix-tools plan "为项目设计微服务架构"
# 快捷别名
rd chat "帮我写个排序算法"命令参考
核心命令
| 命令 | 说明 |
| ------------------------------ | ------------------------------------------------- |
| Reasonix-tools | 无参数时进入持续对话模式,自动切换 chat/code/plan |
| Reasonix-tools chat <prompt> | 问答模式 |
| Reasonix-tools code <prompt> | 编码模式(可读写文件、执行命令) |
| Reasonix-tools plan <prompt> | 规划模式(分解任务为多步骤计划) |
认证
| 命令 | 说明 |
| ------------------------------------- | -------------------- |
| Reasonix-tools auth login [api-key] | 设置/更新 API Key |
| Reasonix-tools auth logout | 清除已保存的 API Key |
| Reasonix-tools auth status | 查看认证状态 |
| Reasonix-tools auth whoami | 显示当前用户信息 |
配置
| 命令 | 说明 |
| ----------------------------------------- | ---------------------------------------------- |
| Reasonix-tools init | 初始化配置向导 |
| Reasonix-tools config show | 查看当前配置 |
| Reasonix-tools config get <key> | 获取配置项(如 permissions.allowFileWrites) |
| Reasonix-tools config set <key> <value> | 设置配置项 |
| Reasonix-tools config path | 显示配置文件路径 |
| Reasonix-tools config permissions | 更新权限设置 |
对话管理
| 命令 | 说明 |
| ------------------------------------------------- | ---------------- |
| Reasonix-tools conversation list | 列出所有对话记录 |
| Reasonix-tools conversation rename <id> <title> | 重命名对话 |
| Reasonix-tools conversation delete <id> | 删除对话 |
| Reasonix-tools conversation export <id> | 导出对话 |
快捷别名
| 命令 | 说明 |
| ---- | --------------------------- |
| rd | Reasonix-tools 的快捷别名 |
全局选项
| 选项 | 说明 |
| ------------------ | ---------------------- |
| -V, --version | 显示版本号 |
| --cwd <path> | 设置工作区根目录 |
| --model <model> | 覆盖默认 DeepSeek 模型 |
| --branch <count> | 自一致分支数量 |
| --no-subagents | 禁用子智能体 |
| --session <id> | 指定对话记录 ID |
交互模式快捷键
在持续对话模式中(Reasonix-tools),支持以下内部命令:
| 命令 | 说明 |
| -------------------------- | ---------------------------- |
| /help | 查看帮助 |
| /paste | 读取系统剪贴板内容 |
| /exit | 退出对话 |
| /deny-file-writes | 取消本对话的文件写入自动授权 |
| /delete-session | 删除当前对话记录 |
| /topics | 查看当前会话的所有话题 |
| /newtopic <title> | 创建新话题并切换到该话题 |
| /switchtopic <id\|index> | 切换到指定话题 |
环境变量
DEEPSEEK_API_KEY— DeepSeek API Key(优先于配置文件)DEEPSEEK_BASE_URL— 自定义 API 基础地址(可选)DEEPSEEK_CLI_HOME— 配置文件存储目录(默认~/.deepseek-cli)NO_COLOR— 禁用彩色输出
架构
reasonix
├── CLI 层 (commander) — 命令解析、交互界面
├── 核心层 — 配置管理、路由、类型定义
├── 引擎层 (Reasonix) — 与 DeepSeek API 通信
├── 编排层 — 任务规划、执行、总结
├── 会话层 — 对话管理、持久化
├── 工具层 — 文件操作、终端执行、网络
└── 输出层 — 格式化输出许可证
MIT © 2025
