Skip to main content

◆ NexForgeCLI

面向 DeepSeek V4 的终端智能体 · TUI + CLI 双模式

NexForgeCLI 是一个运行在终端里的智能体助手,专为 DeepSeek V4(deepseek-v4-flash / deepseek-v4-pro)打造。既能作为全屏 TUI 交互式对话/编码,也能作为 one-shot 命令行工具嵌进脚本和管道。

状态:M1 走通骨架(真实 API 接入 + Textual TUI + 核心工具循环)。M2+ 见下方路线图。


✨ 特性

  • DeepSeek V4 原生接入 —— flash / pro 双模型,思考模式(reasoning_content 独立面板)、上下文缓存计费、真实用量与费用统计。
  • 三档模型选择 —— flash(快)、pro(强)、auto(客户端智能路由:默认 flash,命中信号自动升 pro + 思考)。
  • 智能体循环 —— 函数调用(function calling),自动读写文件、执行命令,直到任务完成。
  • 美化 TUI —— Textual 驱动:品牌横幅、流式 Markdown、可折叠思考面板、工具调用卡片、状态栏(档位/上下文/费用)。
  • SVG 图标系统 —— 以 SVG 为唯一源,按终端能力分级渲染(Kitty/iTerm2/Sixel 真图 → Nerd/Unicode 字形 → ASCII 兜底)。
  • 双运行模式 —— 全屏交互 or 管道式 one-shot,同一套核心。

📦 安装

# 一键安装(推荐)
pip install git+https://gitee.com/Lighthorn/nexforgecli.git

# 或本地开发安装
git clone https://gitee.com/Lighthorn/nexforgecli.git
cd NexForgeCLI && pip install -e .

设置 API Key:

export DEEPSEEK_API_KEY="sk-..."     # Windows: setx DEEPSEEK_API_KEY sk-...

🚀 使用

# 全屏 TUI(默认)
nexforge

# one-shot:回答后退出
nexforge -p "这个项目是做什么的?"

# 管道输入
git diff | nexforge -p "帮我写一条 commit message"

# 指定档位 / 关思考
nexforge --model pro
nexforge --no-think -p "列出当前目录"

# 查看当前配置
nexforge --config

TUI 内斜杠命令

命令 作用
/help 帮助
/model flash|pro|auto 切换模型档位
/think on|off 开关思考模式
/cost 累计费用
/clear 清空会话
/quit 退出

快捷键:Ctrl+C 退出 · Ctrl+L 清屏


⚙️ 配置

默认值内置(真实 V4 参数),可在 ~/.nexforge/config.toml 覆盖。参考 config.example.toml

档位 模型 说明
flash deepseek-v4-flash 低延迟低成本
pro deepseek-v4-pro 复杂推理/大重构
auto 客户端路由 默认 flash,命中关键词/大上下文/多次失败 → 升 pro

🧱 架构

cli.py ─┬─ app.py (Textual TUI) ── ui/ (screens, widgets)
        └─ core/agent.py (AgentLoop 事件流)
                ├─ provider/deepseek.py (V4 流式/思考/工具/缓存)
                ├─ core/router.py (auto 路由)
                ├─ core/session.py (消息 + reasoning 回传规则)
                └─ tools/ (read/list/edit/shell + Registry)
icons.py + assets/icons/*.svg (图标能力分级)

🗺️ 路线图

  • M1 骨架 —— 真 V4 接入、TUI、核心工具循环、双模式
  • M2 工具齐全 + 通用 skill —— 完整工具集、审批门 diff、MCP 客户端、SKILL.md 技能加载
  • M3 美化 —— 图标真图渲染、diff 视图、主题切换
  • M4 实用化 —— 会话持久化/恢复、上下文压缩、费用总账、nexforge login
  • M5 发布 —— PyInstaller 单文件 + pipx + brew/scoop、PyPI

🧪 开发

pip install -e ".[dev]"
python -m pytest -q                    # 单元测试(不触网)
python scripts/smoke_provider.py flash think   # 真实 API 冒烟
python scripts/smoke_tui.py                     # TUI 端到端冒烟

📄 License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexforge_cli-0.2.0.tar.gz (78.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexforge_cli-0.2.0-py3-none-any.whl (87.0 kB view details)

Uploaded Python 3

File details

Details for the file nexforge_cli-0.2.0.tar.gz.

File metadata

  • Download URL: nexforge_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 78.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nexforge_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8d085cbaf932d3ff7cffda8ca869edce4fc66c29842071af2eb1eee6ac33b8d3
MD5 e6f8bdf02aeeaf06605cbf6d0bc8d57f
BLAKE2b-256 10f14c7ec8a99b2894e49ca3bd8213c35e21cf0ee9a6f35032b639de5443ac28

See more details on using hashes here.

File details

Details for the file nexforge_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nexforge_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 87.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nexforge_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0f35b5a1b46458931f639c079f08d4228c6420a3a43ac945898d8654db93ef8
MD5 1f1c93ae5d02496a7aa1b11f8114c464
BLAKE2b-256 b60fb805eaec581d26133213707a5384fda4d1cdd3f3e1c8a271f8dd1055885b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.15

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

1 file

0.2.9

2 files

0.2.8

1 file

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page