forgex-agent 0.0.0-stage → 0.5.0
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.
- package/LICENSE +21 -0
- package/README.md +92 -2
- package/main.js +13316 -0
- package/package.json +44 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 ForgeX contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ForgeX CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TUI-first 的 Coding + DevOps Agent。用自然语言让 Agent 读代码、改代码、跑测试、排查进程/端口/日志,并在执行写操作或命令前请求确认。
|
|
4
|
+
|
|
5
|
+
## 环境要求
|
|
6
|
+
|
|
7
|
+
- Node.js **>= 22.13.0**(依赖内置 `node:sqlite`)
|
|
8
|
+
- Git(使用 `git_status` / `git_diff` 时需要)
|
|
9
|
+
- 可选:ripgrep(`grep_search` 会优先使用;没有则回退到 Node 搜索)
|
|
10
|
+
|
|
11
|
+
## 安装
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g forgex-agent
|
|
15
|
+
forgex --version
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 快速开始
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# 配置模型 API Key(会做一次连通性测试)
|
|
22
|
+
forgex connect
|
|
23
|
+
|
|
24
|
+
# 在当前目录启动 TUI
|
|
25
|
+
forgex
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
首次运行会在 `~/.forgex/config.json` 生成配置。API Key 不写入配置文件,而是保存到环境变量(Windows 用户级环境变量;Unix 会提示 export 命令)。
|
|
29
|
+
|
|
30
|
+
## TUI 命令
|
|
31
|
+
|
|
32
|
+
在 TUI 输入框中输入:
|
|
33
|
+
|
|
34
|
+
| 命令 | 作用 |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `/models` | 切换模型;也支持 `/models deepseek-v4-pro` |
|
|
37
|
+
| `/plan` | 进入/退出计划模式:只读分析,不改文件、不执行命令 |
|
|
38
|
+
| `/connect` | 配置 Provider、API Key、模型,并测试连通性 |
|
|
39
|
+
| `/context` | 查看当前上下文 token 估算 |
|
|
40
|
+
| `/session` | 查看当前会话 ID |
|
|
41
|
+
| `/help` | 查看帮助 |
|
|
42
|
+
| `/exit` | 退出(`/quit` 同义) |
|
|
43
|
+
|
|
44
|
+
任务运行中按 `Ctrl+C` 取消任务;空闲时按 `Ctrl+C` 退出。审批面板中按 `Ctrl+C` 视为拒绝。
|
|
45
|
+
|
|
46
|
+
## CLI 子命令
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
forgex connect # 配置模型连接
|
|
50
|
+
forgex # 启动 TUI(非 TTY 时自动纯文本模式)
|
|
51
|
+
forgex run "检查端口 8080" # 单次任务
|
|
52
|
+
forgex run --json "..." # JSON 输出
|
|
53
|
+
forgex doctor # 环境自检
|
|
54
|
+
forgex tools # 列出内置工具
|
|
55
|
+
forgex sessions # 查看历史会话
|
|
56
|
+
forgex config # 查看最终生效配置(Key 脱敏)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`forgex run` 支持 `--session <id>` 继续历史会话,`--yes` 跳过审批(仅建议在隔离环境使用)。
|
|
60
|
+
|
|
61
|
+
## 配置
|
|
62
|
+
|
|
63
|
+
默认路径:`~/.forgex/config.json`
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"model": {
|
|
68
|
+
"baseUrl": "https://api.deepseek.com",
|
|
69
|
+
"apiKeyEnv": "DEEPSEEK_API_KEY",
|
|
70
|
+
"model": "deepseek-flash",
|
|
71
|
+
"contextWindow": 1000000,
|
|
72
|
+
"maxOutputTokens": 8192
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
支持任意 OpenAI-compatible 接口;Provider 预设见 `forgex connect`。
|
|
78
|
+
|
|
79
|
+
## 安全说明
|
|
80
|
+
|
|
81
|
+
- 写文件、执行命令默认需要人工审批。
|
|
82
|
+
- 审计日志写入 `~/.forgex/audit.jsonl`,敏感字段会脱敏。
|
|
83
|
+
- 会话保存在 `~/.forgex/sessions.db`。
|
|
84
|
+
- 命令白名单不是内核级沙箱;不要在不可信目录中随意授予执行权限。
|
|
85
|
+
|
|
86
|
+
## 链接
|
|
87
|
+
|
|
88
|
+
- 仓库:<https://github.com/fuermocai/forgex>
|
|
89
|
+
- 问题反馈:<https://github.com/fuermocai/forgex/issues>
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|