nexforge-cli 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/INSTALL.md +30 -9
  2. nexforge_cli-0.2.2/PKG-INFO +149 -0
  3. nexforge_cli-0.2.2/README.md +109 -0
  4. nexforge_cli-0.2.2/doc//344/274/232/350/257/235/347/256/241/347/220/206.md +56 -0
  5. nexforge_cli-0.2.2/doc//345/221/275/344/273/244/344/270/216/345/277/253/346/215/267/351/224/256.md +57 -0
  6. nexforge_cli-0.2.2/doc//345/256/211/350/243/205/344/270/216/351/205/215/347/275/256.md +108 -0
  7. nexforge_cli-0.2.2/doc//345/257/271/346/257/224/345/210/206/346/236/220.md +76 -0
  8. nexforge_cli-0.2.2/doc//345/267/245/345/205/267/345/217/202/350/200/203.md +64 -0
  9. nexforge_cli-0.2.2/doc//346/200/273/350/247/210.md +42 -0
  10. nexforge_cli-0.2.2/doc//346/235/203/351/231/220/347/263/273/347/273/237.md +44 -0
  11. nexforge_cli-0.2.2/doc//350/256/241/345/210/222/346/250/241/345/274/217.md +47 -0
  12. nexforge_cli-0.2.2/doc//351/253/230/347/272/247/345/212/237/350/203/275.md +101 -0
  13. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/pyproject.toml +1 -1
  14. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/provider/deepseek.py +13 -0
  15. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/store/session_store.py +5 -3
  16. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/screens/chat.py +894 -882
  17. nexforge_cli-0.2.2/src/nexforge/ui/widgets/apikey_modal.py +84 -0
  18. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/statusbar.py +8 -4
  19. nexforge_cli-0.2.0/PKG-INFO +0 -169
  20. nexforge_cli-0.2.0/README.md +0 -129
  21. nexforge_cli-0.2.0/doc/layout-F2.md +0 -42
  22. nexforge_cli-0.2.0/doc//344/274/232/350/257/235/347/256/241/347/220/206.md +0 -54
  23. nexforge_cli-0.2.0/doc//345/221/275/344/273/244/344/270/216/345/277/253/346/215/267/351/224/256.md +0 -46
  24. nexforge_cli-0.2.0/doc//345/256/211/350/243/205/344/270/216/351/205/215/347/275/256.md +0 -109
  25. nexforge_cli-0.2.0/doc//345/267/245/345/205/267/345/217/202/350/200/203.md +0 -61
  26. nexforge_cli-0.2.0/doc//346/200/273/350/247/210.md +0 -37
  27. nexforge_cli-0.2.0/doc//346/235/203/351/231/220/347/263/273/347/273/237.md +0 -53
  28. nexforge_cli-0.2.0/doc//350/256/241/345/210/222/346/250/241/345/274/217.md +0 -49
  29. nexforge_cli-0.2.0/doc//351/253/230/347/272/247/345/212/237/350/203/275.md +0 -78
  30. nexforge_cli-0.2.0/src/nexforge/ui/widgets/apikey_modal.py +0 -65
  31. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/.gitignore +0 -0
  32. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/= +0 -0
  33. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/agent.svg +0 -0
  34. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/cost.svg +0 -0
  35. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/edit.svg +0 -0
  36. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/err.svg +0 -0
  37. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/file.svg +0 -0
  38. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/model.svg +0 -0
  39. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/ok.svg +0 -0
  40. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/read.svg +0 -0
  41. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/running.svg +0 -0
  42. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/search.svg +0 -0
  43. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/shell.svg +0 -0
  44. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/thinking.svg +0 -0
  45. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/web.svg +0 -0
  46. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/assets/icons/write.svg +0 -0
  47. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/config.example.toml +0 -0
  48. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/devlog/2026-07-07.md +0 -0
  49. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/scripts/publish.sh +0 -0
  50. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/scripts/smoke_provider.py +0 -0
  51. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/scripts/smoke_tui.py +0 -0
  52. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/__init__.py +0 -0
  53. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/__main__.py +0 -0
  54. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/app.py +0 -0
  55. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/cli.py +0 -0
  56. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/config.py +0 -0
  57. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/__init__.py +0 -0
  58. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/agent.py +0 -0
  59. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/jobs.py +0 -0
  60. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/permissions.py +0 -0
  61. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/router.py +0 -0
  62. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/session.py +0 -0
  63. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/core/types.py +0 -0
  64. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/icons.py +0 -0
  65. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/mcp/__init__.py +0 -0
  66. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/provider/__init__.py +0 -0
  67. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/provider/balance.py +0 -0
  68. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/skills/loader.py +0 -0
  69. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/store/__init__.py +0 -0
  70. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/store/plan_store.py +0 -0
  71. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/theme.tcss +0 -0
  72. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/__init__.py +0 -0
  73. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/_paths.py +0 -0
  74. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/background.py +0 -0
  75. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/base.py +0 -0
  76. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/edit_file.py +0 -0
  77. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/fs_ops.py +0 -0
  78. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/git.py +0 -0
  79. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/list_dir.py +0 -0
  80. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/multi_edit.py +0 -0
  81. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/read_file.py +0 -0
  82. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/registry.py +0 -0
  83. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/search_content.py +0 -0
  84. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/search_files.py +0 -0
  85. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/shell.py +0 -0
  86. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/web.py +0 -0
  87. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/tools/write_file.py +0 -0
  88. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/__init__.py +0 -0
  89. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/screens/__init__.py +0 -0
  90. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/__init__.py +0 -0
  91. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/banner.py +0 -0
  92. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/confirm_modal.py +0 -0
  93. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/diff_modal.py +0 -0
  94. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/messages.py +0 -0
  95. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/mode_warning.py +0 -0
  96. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/multiline_modal.py +0 -0
  97. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/multiline_prompt.py +0 -0
  98. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/plan_sidebar.py +0 -0
  99. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/ui/widgets/sidebar.py +0 -0
  100. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/web/__init__.py +0 -0
  101. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/web/server.py +0 -0
  102. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/src/nexforge/web/static/index.html +0 -0
  103. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_approval.py +0 -0
  104. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_config.py +0 -0
  105. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_icons.py +0 -0
  106. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_m2_tools.py +0 -0
  107. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_sidebar.py +0 -0
  108. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_sidebar_actions.py +0 -0
  109. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_tools.py +0 -0
  110. {nexforge_cli-0.2.0 → nexforge_cli-0.2.2}/tests/test_tui.py +0 -0
@@ -5,25 +5,43 @@
5
5
  - Python **3.11+**
6
6
  - 终端:Windows Terminal / macOS Terminal / Linux 任意终端
7
7
  - 网络:需能访问 `api.deepseek.com`
8
- - 可选:Git(仅 git 安装方式需要)
9
8
 
10
- ## 方式一:Pip 安装(推荐)
9
+ ## 方式一:pipx 安装(推荐)
10
+
11
+ `pipx` 自动管理 PATH,安装后即可在任意目录直接运行:
12
+
13
+ ```bash
14
+ # 安装 pipx(如未安装)
15
+ pip install pipx
16
+ pipx ensurepath
17
+
18
+ # 安装 NexForgeCLI
19
+ pipx install nexforge-cli
20
+
21
+ # 运行
22
+ nexforge
23
+ ```
24
+
25
+ ## 方式二:pip 安装
11
26
 
12
27
  ```bash
13
28
  pip install nexforge-cli
14
29
  nexforge
15
30
  ```
16
31
 
17
- 安装后运行 `nexforge`(或简写 `nf`)。
32
+ 如果提示 `nexforge: command not found`:
18
33
 
19
- ## 方式二:Pip 安装开发版
34
+ - **Windows**: 将 `%APPDATA%\Python\Python3xx\Scripts` 加入系统 PATH
35
+ - **Linux/macOS**: 确保 `~/.local/bin` 在 PATH 中,或运行 `export PATH="$HOME/.local/bin:$PATH"`
36
+ - 或直接用 `python -m nexforge` 代替
37
+
38
+ ## 方式三:开发版安装
20
39
 
21
40
  ```bash
22
41
  pip install git+https://gitee.com/Lighthorn/nexforgecli.git
23
- nexforge
24
42
  ```
25
43
 
26
- ## 方式三:源码安装
44
+ ## 方式四:源码安装
27
45
 
28
46
  ```bash
29
47
  git clone https://gitee.com/Lighthorn/nexforgecli.git
@@ -61,13 +79,15 @@ nexforge --help
61
79
  ## 升级
62
80
 
63
81
  ```bash
64
- pip install --upgrade nexforge-cli
82
+ pipx upgrade nexforge-cli # pipx 方式
83
+ pip install --upgrade nexforge-cli # pip 方式
65
84
  ```
66
85
 
67
86
  ## 卸载
68
87
 
69
88
  ```bash
70
- pip uninstall nexforge-cli -y
89
+ pipx uninstall nexforge-cli # pipx 方式
90
+ pip uninstall nexforge-cli -y # pip 方式
71
91
  ```
72
92
 
73
93
  配置文件和数据保留在 `~/.nexforge/` 和项目 `.nexforge/` 目录下,需手动删除。
@@ -76,7 +96,8 @@ pip uninstall nexforge-cli -y
76
96
 
77
97
  | 问题 | 解决 |
78
98
  |------|------|
79
- | `nexforge: command not found` | Python Scripts 目录不在 PATH 中,用 `python -m nexforge` 代替 |
99
+ | `nexforge: command not found` | pipx 安装,或手动加 Scripts PATH,或用 `python -m nexforge` |
80
100
  | `No module named 'nexforge'` | pip 安装未成功,检查 Python 版本 ≥3.11 |
81
101
  | `ProviderError: 未找到 API Key` | 未配置 API Key,用 `/key` 或环境变量设置 |
82
102
  | Windows 终端乱码 | 使用 Windows Terminal 或 Git Bash,避免 PowerShell |
103
+ | 大段粘贴被截断 | 按 F3 用外部编辑器粘贴大段文本 |
@@ -0,0 +1,149 @@
1
+ Metadata-Version: 2.4
2
+ Name: nexforge-cli
3
+ Version: 0.2.2
4
+ Summary: NexForgeCLI — 一个面向 DeepSeek V4 的终端智能体(TUI + CLI 双模式)
5
+ Project-URL: Homepage, https://gitee.com/Lighthorn/nexforgecli
6
+ Author: NexForge
7
+ License: MIT
8
+ Keywords: agent,cli,deepseek,textual,tui
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: Terminals
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: httpx>=0.27
23
+ Requires-Dist: openai>=1.40
24
+ Requires-Dist: pydantic>=2.6
25
+ Requires-Dist: pyperclip>=1.8
26
+ Requires-Dist: rich>=13.7
27
+ Requires-Dist: textual>=0.60
28
+ Provides-Extra: dev
29
+ Requires-Dist: build>=1.2; extra == 'dev'
30
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
31
+ Requires-Dist: pytest>=8.0; extra == 'dev'
32
+ Requires-Dist: twine>=5.0; extra == 'dev'
33
+ Provides-Extra: images
34
+ Requires-Dist: cairosvg>=2.7; extra == 'images'
35
+ Requires-Dist: pillow>=10.0; extra == 'images'
36
+ Requires-Dist: term-image>=0.7; extra == 'images'
37
+ Provides-Extra: mcp
38
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
39
+ Description-Content-Type: text/markdown
40
+
41
+ <div align="center">
42
+
43
+ # ◆ NexForgeCLI
44
+
45
+ **面向 DeepSeek V4 的终端智能体 · TUI + CLI 双模式**
46
+
47
+ </div>
48
+
49
+ NexForgeCLI 是一个运行在终端里的智能体助手,专为 **DeepSeek V4** 打造。既能作为全屏 TUI 交互式对话/编码,也能作为 one-shot 命令行工具嵌进脚本和管道。
50
+
51
+ > 当前版本:**v0.2.0** · PyPI: `pip install nexforge-cli`
52
+
53
+ ---
54
+
55
+ ## 📦 安装
56
+
57
+ ```bash
58
+ # pipx 安装(推荐,自动管理 PATH)
59
+ pipx install nexforge-cli
60
+
61
+ # pip 安装
62
+ pip install nexforge-cli
63
+
64
+ # 开发版
65
+ pip install git+https://gitee.com/Lighthorn/nexforgecli.git
66
+ ```
67
+
68
+ 设置 API Key:
69
+
70
+ ```bash
71
+ export DEEPSEEK_API_KEY="sk-..."
72
+ # 或启动后在输入框输入: /key sk-...
73
+ ```
74
+
75
+ API Key 获取: https://platform.deepseek.com/api_keys
76
+
77
+ ---
78
+
79
+ ## ✨ 特性
80
+
81
+ - **DeepSeek V4 深度优化** —— thinking 模式、KV Cache、streaming、采样参数、JSON Mode、tool_choice 全适配
82
+ - **TUI 全屏交互** —— Textual 驱动,流式 Markdown、可折叠思考面板、工具卡片、状态栏
83
+ - **安全分级** —— safe/supervised/auto 三级权限,审批弹窗
84
+ - **会话管理** —— 自动保存/恢复、多会话切换、重命名/删除
85
+ - **计划模式** —— 只读讨论,AI 生成计划后执行
86
+ - **多行输入** —— F2 弹窗面板、F3 系统编辑器
87
+ - **一键安装** —— `pip install nexforge-cli`
88
+ - **性能优化** —— O(n²)→O(n) 流式渲染、DOM 查询缓存、I/O 异步化
89
+
90
+ ---
91
+
92
+ ## 🚀 使用
93
+
94
+ ```bash
95
+ # 全屏 TUI(默认)
96
+ nexforge
97
+
98
+ # 或简写
99
+ nf
100
+
101
+ # one-shot 模式
102
+ nexforge -p "这个项目是做什么的?"
103
+ ```
104
+
105
+ ### 快捷键
106
+
107
+ | 快捷键 | 功能 |
108
+ |--------|------|
109
+ | `Enter` | 发送消息 |
110
+ | `F1` | 帮助 |
111
+ | `F2` | 多行输入弹窗 |
112
+ | `F3` | 外部编辑器 |
113
+ | `Ctrl+S` | 会话面板 |
114
+ | `Ctrl+B` | 计划面板 |
115
+ | `Ctrl+L` | 清屏 |
116
+ | `Ctrl+Shift+C` | 复制 AI 回复 |
117
+ | `Esc` | 停止/退出 |
118
+
119
+ ---
120
+
121
+ ## 📁 文档
122
+
123
+ | 文档 | 内容 |
124
+ |------|------|
125
+ | [总览](doc/总览.md) | 项目介绍 |
126
+ | [安装与配置](doc/安装与配置.md) | 安装/配置/FAQ |
127
+ | [命令与快捷键](doc/命令与快捷键.md) | 全部命令和快捷键 |
128
+ | [工具参考](doc/工具参考.md) | AI 可调用工具说明 |
129
+ | [会话管理](doc/会话管理.md) | 会话保存/恢复/切换 |
130
+ | [计划模式](doc/计划模式.md) | 只读讨论模式 |
131
+ | [权限系统](doc/权限系统.md) | 三级权限 |
132
+ | [高级功能](doc/高级功能.md) | DeepSeek 集成/Web/技能 |
133
+
134
+ ---
135
+
136
+ ## 🧪 开发
137
+
138
+ ```bash
139
+ git clone https://gitee.com/Lighthorn/nexforgecli.git
140
+ cd nexforgecli
141
+ pip install -e ".[dev]"
142
+ python -m pytest -q
143
+ ```
144
+
145
+ ---
146
+
147
+ ## 📄 License
148
+
149
+ MIT
@@ -0,0 +1,109 @@
1
+ <div align="center">
2
+
3
+ # ◆ NexForgeCLI
4
+
5
+ **面向 DeepSeek V4 的终端智能体 · TUI + CLI 双模式**
6
+
7
+ </div>
8
+
9
+ NexForgeCLI 是一个运行在终端里的智能体助手,专为 **DeepSeek V4** 打造。既能作为全屏 TUI 交互式对话/编码,也能作为 one-shot 命令行工具嵌进脚本和管道。
10
+
11
+ > 当前版本:**v0.2.0** · PyPI: `pip install nexforge-cli`
12
+
13
+ ---
14
+
15
+ ## 📦 安装
16
+
17
+ ```bash
18
+ # pipx 安装(推荐,自动管理 PATH)
19
+ pipx install nexforge-cli
20
+
21
+ # pip 安装
22
+ pip install nexforge-cli
23
+
24
+ # 开发版
25
+ pip install git+https://gitee.com/Lighthorn/nexforgecli.git
26
+ ```
27
+
28
+ 设置 API Key:
29
+
30
+ ```bash
31
+ export DEEPSEEK_API_KEY="sk-..."
32
+ # 或启动后在输入框输入: /key sk-...
33
+ ```
34
+
35
+ API Key 获取: https://platform.deepseek.com/api_keys
36
+
37
+ ---
38
+
39
+ ## ✨ 特性
40
+
41
+ - **DeepSeek V4 深度优化** —— thinking 模式、KV Cache、streaming、采样参数、JSON Mode、tool_choice 全适配
42
+ - **TUI 全屏交互** —— Textual 驱动,流式 Markdown、可折叠思考面板、工具卡片、状态栏
43
+ - **安全分级** —— safe/supervised/auto 三级权限,审批弹窗
44
+ - **会话管理** —— 自动保存/恢复、多会话切换、重命名/删除
45
+ - **计划模式** —— 只读讨论,AI 生成计划后执行
46
+ - **多行输入** —— F2 弹窗面板、F3 系统编辑器
47
+ - **一键安装** —— `pip install nexforge-cli`
48
+ - **性能优化** —— O(n²)→O(n) 流式渲染、DOM 查询缓存、I/O 异步化
49
+
50
+ ---
51
+
52
+ ## 🚀 使用
53
+
54
+ ```bash
55
+ # 全屏 TUI(默认)
56
+ nexforge
57
+
58
+ # 或简写
59
+ nf
60
+
61
+ # one-shot 模式
62
+ nexforge -p "这个项目是做什么的?"
63
+ ```
64
+
65
+ ### 快捷键
66
+
67
+ | 快捷键 | 功能 |
68
+ |--------|------|
69
+ | `Enter` | 发送消息 |
70
+ | `F1` | 帮助 |
71
+ | `F2` | 多行输入弹窗 |
72
+ | `F3` | 外部编辑器 |
73
+ | `Ctrl+S` | 会话面板 |
74
+ | `Ctrl+B` | 计划面板 |
75
+ | `Ctrl+L` | 清屏 |
76
+ | `Ctrl+Shift+C` | 复制 AI 回复 |
77
+ | `Esc` | 停止/退出 |
78
+
79
+ ---
80
+
81
+ ## 📁 文档
82
+
83
+ | 文档 | 内容 |
84
+ |------|------|
85
+ | [总览](doc/总览.md) | 项目介绍 |
86
+ | [安装与配置](doc/安装与配置.md) | 安装/配置/FAQ |
87
+ | [命令与快捷键](doc/命令与快捷键.md) | 全部命令和快捷键 |
88
+ | [工具参考](doc/工具参考.md) | AI 可调用工具说明 |
89
+ | [会话管理](doc/会话管理.md) | 会话保存/恢复/切换 |
90
+ | [计划模式](doc/计划模式.md) | 只读讨论模式 |
91
+ | [权限系统](doc/权限系统.md) | 三级权限 |
92
+ | [高级功能](doc/高级功能.md) | DeepSeek 集成/Web/技能 |
93
+
94
+ ---
95
+
96
+ ## 🧪 开发
97
+
98
+ ```bash
99
+ git clone https://gitee.com/Lighthorn/nexforgecli.git
100
+ cd nexforgecli
101
+ pip install -e ".[dev]"
102
+ python -m pytest -q
103
+ ```
104
+
105
+ ---
106
+
107
+ ## 📄 License
108
+
109
+ MIT
@@ -0,0 +1,56 @@
1
+ # 会话管理
2
+
3
+ ## 自动保存
4
+
5
+ 每次 AI 回复完成后自动保存当前会话到 `.nexforge/sessions/` 目录下的 Markdown 文件。文件按日期分目录:
6
+
7
+ ```
8
+ .nexforge/
9
+ └── sessions/
10
+ └── 2026-07-14/
11
+ ├── session-075412.md
12
+ └── session-083021.md
13
+ ```
14
+
15
+ ## 自动恢复
16
+
17
+ 启动时自动恢复当前项目最近一次会话,包括完整的对话历史。
18
+
19
+ ## 会话面板(Ctrl+S)
20
+
21
+ 侧边栏显示所有历史会话,支持:
22
+
23
+ - **新建会话**:点击 `+ 新建会话` 或快捷键 `Ctrl+S`
24
+ - **切换会话**:点击会话名,自动保存当前会话并加载选中会话
25
+ - **重命名**:`/rename 新名称`
26
+ - **删除**:点击 `✖` 按钮,弹出确认弹窗
27
+ - **绿点**:当前活跃会话的指示标记
28
+
29
+ ## 命令
30
+
31
+ | 命令 | 说明 |
32
+ |------|------|
33
+ | `/save [name]` | 手动保存当前会话 |
34
+ | `/rename <name>` | 重命名当前会话 |
35
+ | `/sessions` | 列出所有历史会话 |
36
+ | `/clear` | 清空当前会话内容 |
37
+ | `/cost` | 显示累计 token 用量和费用 |
38
+
39
+ ## 会话格式
40
+
41
+ 会话文件为 Markdown 格式,每条消息结构:
42
+
43
+ ```markdown
44
+ ### ❯ 用户
45
+ 消息内容
46
+
47
+ ### ❯ 助手
48
+ 回复内容
49
+ <!-- thinking: 思考内容 -->
50
+ ```
51
+
52
+ ## 上下文管理
53
+
54
+ - 屏幕 widget 上限 300 个(自动裁剪最旧的)
55
+ - 会话消息无截断(完整保留在文件中)
56
+ - 长会话警告:每轮 API 调用发送全量消息历史
@@ -0,0 +1,57 @@
1
+ # 命令与快捷键
2
+
3
+ ## 快捷键
4
+
5
+ | 快捷键 | 功能 |
6
+ |--------|------|
7
+ | `Enter` | 发送消息 |
8
+ | `F1` | 显示帮助 |
9
+ | `F2` | 弹出多行输入面板(30行) |
10
+ | `F3` | 系统默认编辑器编辑文本 |
11
+ | `Esc` | AI 工作中:停止当前任务 / 空闲时:退出确认 |
12
+ | `Ctrl+L` | 清屏 |
13
+ | `Ctrl+S` | 打开/关闭会话侧边栏 |
14
+ | `Ctrl+B` | 打开/关闭计划侧边栏 |
15
+ | `Ctrl+Shift+C` | 复制最后一条 AI 回复到剪贴板 |
16
+ | `PageUp/PageDown` | 上下翻页 |
17
+ | `↑/↓` | 单行滚动 |
18
+ | `End` | 滚回底部 |
19
+
20
+ ## 斜杠命令
21
+
22
+ | 命令 | 说明 |
23
+ |------|------|
24
+ | `/help` | 显示帮助 |
25
+ | `/key sk-...` | 保存 API Key |
26
+ | `/model flash\|pro\|auto` | 切换模型档位 |
27
+ | `/think on\|off` | 开关思考模式 |
28
+ | `/mode review\|auto` | 审批模式切换 |
29
+ | `/plan` | 切换计划模式(只读讨论) |
30
+ | `/json` | 切换 JSON 输出模式 |
31
+ | `/perm safe\|supervised\|auto` | 切换权限级别 |
32
+ | `/balance` | 查询 DeepSeek 账户余额 |
33
+ | `/skill <name>` | 执行指定技能 |
34
+ | `/skills` | 列出可用技能 |
35
+ | `/save [name]` | 保存当前会话 |
36
+ | `/rename <name>` | 重命名当前会话 |
37
+ | `/sessions` | 列出历史会话 |
38
+ | `/cost` | 显示累计费用 |
39
+ | `/clear` | 清空当前会话 |
40
+ | `/web start\|stop` | Web 管理面板 |
41
+ | `/quit` | 退出 |
42
+
43
+ ## 权限级别
44
+
45
+ | 级别 | 命令 | 效果 |
46
+ |------|------|------|
47
+ | 🛡 safe | `/perm safe` | 全部写/删/Shell 需审批 |
48
+ | ⚡ supervised | `/perm supervised` | 写文件自动,删/Shell 需审批(默认) |
49
+ | 🔥 auto | `/perm auto` | 全部直接执行 |
50
+
51
+ ## 提示栏
52
+
53
+ 输入框下方有一条提示栏,列出常用快捷键:
54
+
55
+ ```
56
+ F1帮助 · F2多行输入 · F3外部编辑器 · Enter发送 · Ctrl+S会话 · Ctrl+B计划 · Ctrl+L清屏 · Ctrl+Shift+C复制 · Esc停止/退出 · /help命令
57
+ ```
@@ -0,0 +1,108 @@
1
+ # 安装与配置
2
+
3
+ ## 环境要求
4
+
5
+ - Python **3.11+**
6
+ - 终端:Windows Terminal / macOS Terminal / Linux 任意终端
7
+ - 网络:需能访问 `api.deepseek.com`
8
+
9
+ ## 安装
10
+
11
+ ```bash
12
+ # 方式一:pipx 安装(推荐,自动管理 PATH)
13
+ pipx install nexforge-cli
14
+
15
+ # 方式二:Pip 安装
16
+ pip install nexforge-cli
17
+ # 如果提示 nexforge 不在 PATH 中:
18
+ # Windows: 将 %APPDATA%\Python\Python3xx\Scripts 加入 PATH
19
+ # Linux/macOS: 确保 ~/.local/bin 在 PATH 中
20
+
21
+ # 方式三:安装开发版
22
+ pip install git+https://gitee.com/Lighthorn/nexforgecli.git
23
+
24
+ # 方式四:源码安装
25
+ git clone https://gitee.com/Lighthorn/nexforgecli.git
26
+ cd nexforgecli
27
+ pip install -e .
28
+ ```
29
+
30
+ ## 运行
31
+
32
+ ```bash
33
+ nexforge
34
+ # 或简写
35
+ nf
36
+ ```
37
+
38
+ ## 配置 API Key
39
+
40
+ ### 首次启动自动配置
41
+
42
+ 运行 `nexforge` 后会弹出 API Key 输入面板,直接粘贴 `sk-…` 即可。
43
+
44
+ ### 手动配置
45
+
46
+ ```bash
47
+ # 环境变量(每次有效)
48
+ export DEEPSEEK_API_KEY="sk-你的密钥"
49
+
50
+ # 或启动后在输入框输入
51
+ /key sk-你的密钥
52
+ ```
53
+
54
+ API Key 获取:[platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)
55
+
56
+ ### 凭据文件
57
+
58
+ API Key 保存在 `~/.nexforge/auth.toml`,不会被 Git 追踪。
59
+
60
+ ## 配置文件
61
+
62
+ 主配置文件:`~/.nexforge/config.toml`
63
+
64
+ ```toml
65
+ [models]
66
+ default_tier = "auto" # flash | pro | auto
67
+ thinking = true # 思考模式
68
+ reasoning_effort = "high" # high | max
69
+ max_output_tokens = 8192
70
+ temperature = null # 0-2,仅 thinking=off 生效
71
+ top_p = null
72
+ frequency_penalty = null
73
+ presence_penalty = null
74
+ stop = null
75
+
76
+ [ui]
77
+ mode = "review" # review | auto
78
+ plan_mode = false # 计划模式
79
+ json_mode = false # JSON 强制输出
80
+ theme = "dark"
81
+
82
+ [permissions]
83
+ profile = "supervised" # safe | supervised | auto
84
+ ```
85
+
86
+ ## 升级
87
+
88
+ ```bash
89
+ pip install --upgrade nexforge-cli
90
+ ```
91
+
92
+ ## 卸载
93
+
94
+ ```bash
95
+ pip uninstall nexforge-cli -y
96
+ ```
97
+
98
+ 配置文件和数据保留在 `~/.nexforge/` 和项目 `.nexforge/` 目录下,需手动删除。
99
+
100
+ ## 常见问题
101
+
102
+ | 问题 | 解决 |
103
+ |------|------|
104
+ | `nexforge: command not found` | Python Scripts 目录不在 PATH 中,用 `python -m nexforge` 代替 |
105
+ | `No module named 'nexforge'` | pip 安装未成功,检查 Python 版本 ≥3.11 |
106
+ | `ProviderError: 未找到 API Key` | 未配置 API Key,用 `/key` 或环境变量设置 |
107
+ | Windows 终端乱码 | 使用 Windows Terminal 或 Git Bash,避免 PowerShell |
108
+ | 大段粘贴被截断 | 按 F3 用外部编辑器粘贴大段文本 |
@@ -0,0 +1,76 @@
1
+ # NexForgeCLI vs 其他 AI 编码智能体横向对比
2
+
3
+ ## 总览
4
+
5
+ | | **NexForgeCLI** | **Claude Code** | **Codex CLI** | **Cursor** | **Windsurf** | **Aider** |
6
+ |---|---|---|---|---|---|---|
7
+ | **界面** | TUI(Textual)+CLI | 终端 TUI | 终端 CLI(Node) | VS Code 分支 | VS Code 扩展 | 终端 TUI+CLI |
8
+ | **模型** | DeepSeek V4 | Claude 3.5/4 | GPT-4o/o-series | 多模型 | 多模型 | 多模型 |
9
+ | **安装** | `pip install` | `npm install -g` | `npx` | 安装包(~400MB) | VS Code 市场 | `pip install` |
10
+ | **开源** | ✅ MIT | ❌ | ✅ Apache | ❌ | ❌ | ✅ Apache |
11
+ | **跨平台** | Win/Mac/Linux | Mac/Linux(WSL) | Mac/Linux(?) | 全平台 | 全平台 | 全平台 |
12
+ | **大小** | ~95KB | ~50MB npm | ~? | ~400MB | ~500MB | ~3MB |
13
+
14
+ ---
15
+
16
+ ## 工具能力
17
+
18
+ | | **NexForgeCLI** | **Claude Code** | **Codex CLI** | **Cursor** | **Windsurf** | **Aider** |
19
+ |---|---|---|---|---|---|---|
20
+ | **文件读取** | ✅ 行范围 | ✅ | ✅ | ✅ IDE原生 | ✅ IDE原生 | ✅ |
21
+ | **文件编辑** | ✅ SEARCH/REPLACE | ✅ SEARCH/REPLACE | ✅ | ✅ IDE直接 | ✅ IDE直接 | ✅ SEARCH/REPLACE |
22
+ | **批量编辑** | ✅ multi_edit | — | — | ✅ 多光标 | ✅ 多光标 | — |
23
+ | **Shell** | ✅ 超时+危险拦截 | ✅ | ✅ | ✅ 集成终端 | ✅ 集成终端 | ✅ |
24
+ | **后台任务** | ✅ run_background | — | — | ✅ 终端多标签 | ✅ 终端多标签 | — |
25
+ | **Web 抓取** | ✅ web_fetch | — | — | — | — | ❌(靠 curl) |
26
+ | **文件搜索** | ✅ grep+文件名 | ✅ | ✅ | ✅ VS搜索 | ✅ VS搜索 | ❌(靠 shell) |
27
+ | **Git** | ✅ 三状态+可选commit | ✅ 完整 | ✅ 完整 | ✅ 内建VCS | ✅ 内建VCS | ✅ 完整 |
28
+
29
+ ---
30
+
31
+ ## 权限与安全
32
+
33
+ | | **NexForgeCLI** | **Claude Code** | **Codex CLI** | **Cursor** | **Aider** |
34
+ |---|---|---|---|---|---|
35
+ | **权限分级** | 🛡safe/⚡supervised/🔥auto | 逐命令审批(Y/n) | 工具级审批 | 审批确认 | `--yes`全跳过 |
36
+ | **危险命令拦截** | ✅ 内置黑名单(rm -rf /等) | ⚠ Shell警告 | — | ✅ IDE沙箱 | ❌ |
37
+ | **死循环检测** | ✅ 连续3次同工具失败→注入提示 | — | — | — | — |
38
+
39
+ ---
40
+
41
+ ## 会话与上下文
42
+
43
+ | | **NexForgeCLI** | **Claude Code** | **Codex CLI** | **Aider** |
44
+ |---|---|---|---|---|
45
+ | **会话保存** | ✅ 自动保存MD文件 | ✅ .claude/sessions/ | ✅ .codex/sessions/ | ✅ .md文件 |
46
+ | **会话管理** | ✅ 侧边栏:新建/切/删/改名 | ✅ ls/resume命令 | — | `--restore` |
47
+ | **会话恢复** | ✅ 启动自动恢复最近 | ✅ 可恢复 | ✅ 可恢复 | ✅ 可恢复 |
48
+ | **上下文窗口** | **1M tokens**(DeepSeek V4) | 200K(Claude) | 128K(GPT-4o) | 模型决定 |
49
+ | **计划模式** | ✅ /plan只读讨论 | — | — | — |
50
+
51
+ ---
52
+
53
+ ## 模型路由与优化
54
+
55
+ | | **NexForgeCLI** | **Claude Code** | **Codex CLI** | **Cursor** | **Aider** |
56
+ |---|---|---|---|---|---|
57
+ | **自动路由** | ✅ Flash→Pro(关键词+上下文+失败次数) | ❌ | ❌ | ❌ | ❌ |
58
+ | **思考模式** | ✅ thinking流式+可折叠面板 | ✅ 扩展思考 | ✅ o-series推理 | ❌ | ❌ |
59
+ | **KV Cache计费** | ✅ 缓存命中/未命中拆分 | — | — | — | — |
60
+ | **采样参数** | ✅ thinking=off时可用 | — | — | — | — |
61
+ | **JSON模式** | ✅ /json切换 | — | — | — | — |
62
+
63
+ ---
64
+
65
+ ## 独有亮点
66
+
67
+ 1. **后台任务管理** —— 启动/监控/杀后台进程(`run_background`等5个工具)
68
+ 2. **自动路由** —— 客户端智能判断,小任务用 Flash 省钱,大任务自动升 Pro
69
+ 3. **死循环保护** —— 同一工具连续失败3次自动停止+提示
70
+ 4. **三级权限** —— safe/supervised/auto 允许用户按场景自由控制
71
+ 5. **DeepSeek KV Cache 精确计费** —— 区分缓存命中/未命中,费用更准确
72
+ 6. **自建 Web 面板** —— 零外部依赖,浏览器管理会话/计划/配置
73
+ 7. **计划模式** —— `/plan` 只读讨论,先规划再执行
74
+ 8. **Markdown 会话** —— 人类可读的会话文件,可直接编辑
75
+ 9. **跨 Agent 协作** —— `/import` 读取其他智能体的项目数据
76
+ 10. **轻量级** —— pip 包仅 95KB,无 Node.js 依赖
@@ -0,0 +1,64 @@
1
+ # 工具参考
2
+
3
+ NexForgeCLI 内置以下工具供 AI 调用:
4
+
5
+ ## 文件操作
6
+
7
+ | 工具 | 功能 |
8
+ |------|------|
9
+ | `read_file` | 读取文件内容 |
10
+ | `write_file` | 写入新文件 |
11
+ | `edit_file` | 搜索替换编辑已有文件 |
12
+ | `multi_edit` | 批量编辑多个文件 |
13
+ | `list_directory` | 列出目录内容 |
14
+ | `search_files` | 按文件名搜索 |
15
+ | `search_content` | 按文件内容搜索(grep) |
16
+ | `delete_file` | 删除文件 |
17
+ | `move_file` | 移动/重命名文件 |
18
+
19
+ ## Shell 命令
20
+
21
+ | 工具 | 功能 |
22
+ |------|------|
23
+ | `run_shell` | 执行 Shell 命令 |
24
+
25
+ ## Git 操作
26
+
27
+ | 工具 | 功能 |
28
+ |------|------|
29
+ | `git_status` | 查看 Git 状态 |
30
+ | `git_diff` | 查看 Git 差异 |
31
+ | `git_commit` | Git 提交(需启用) |
32
+
33
+ ## Web
34
+
35
+ | 工具 | 功能 |
36
+ |------|------|
37
+ | `web_fetch` | 获取网页内容 |
38
+ | `web_search` | 网页搜索 |
39
+
40
+ ## 工具限制
41
+
42
+ - **工具轮数上限**:50 轮(防死循环)
43
+ - **单轮超时**:300 秒
44
+ - **单工具超时**:60 秒
45
+
46
+ ## 审批流程
47
+
48
+ 根据权限级别,以下工具需要用户审批:
49
+
50
+ | 权限 | 读 | 写 | 删 | Shell |
51
+ |------|----|----|-----|-------|
52
+ | safe | ✅ | 🔒 | 🔒 | 🔒 |
53
+ | supervised | ✅ | ✅ | 🔒 | 🔒 |
54
+ | auto | ✅ | ✅ | ✅ | ✅ |
55
+
56
+ ✅ = 自动执行 🔒 = 需用户确认
57
+
58
+ ## DeepSeek 优化
59
+
60
+ - **Thinking 模式**:启用以太坊思考链,提升复杂推理质量
61
+ - **KV Cache**:自动记录缓存命中/未命中 tokens
62
+ - **采样参数**:thinking=off 时可调节 temperature/top_p
63
+ - **JSON Mode**:`/json` 强制输出合法 JSON
64
+ - **max_completion_tokens**:使用 DeepSeek 推荐的新参数名