@fastagent/cli 0.0.2 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +95 -3
  2. package/cli.js +282 -269
  3. package/package.json +14 -2
package/README.md CHANGED
@@ -1,8 +1,26 @@
1
1
  # @fastagent/cli
2
2
 
3
- FastAgent 是一个面向工具接入、skills、MCP、IM 通道接入、子智能体、计划任务与多智能体调度场景的 agentic 执行引擎命令行入口。
3
+ `@fastagent/cli` 是 FastAgent 面向使用者的统一命令行入口。你可以用它直接启动 FastAgent、接入 IM channel、安装 skills,并使用 harness 工程提供的一组工程化执行能力。
4
4
 
5
- 通过 `fastagent` 命令,你可以用统一方式启动和使用 FastAgent;当前公开命令面已开放其中一部分能力,并会持续扩展。
5
+ 它适合这些场景:
6
+
7
+ - 把 FastAgent 作为本地 CLI agent 使用
8
+ - 通过微信内置 channel 把 FastAgent 跑成 IM 服务
9
+ - 在一个统一入口下使用文件、搜索、MCP、skills、cron 等 harness 能力
10
+
11
+ ## 能力概览
12
+
13
+ 当前主要聚焦 harness 工程相关能力:
14
+
15
+ - 文件读取、写入和编辑
16
+ - 文件搜索与内容搜索
17
+ - 命令执行与进程管理
18
+ - MCP 工具接入与 MCP 资源读取
19
+ - skills 安装、发现和调用
20
+ - `cron` 定时任务
21
+ - session 任务清单管理
22
+ - 子智能体 / 并行任务执行
23
+ - local / remote sandbox 路由
6
24
 
7
25
  ## 安装
8
26
 
@@ -22,19 +40,93 @@ fastagent --help
22
40
  fastagent
23
41
  fastagent --channel weixin
24
42
  fastagent --channel weixin --output jsonl
43
+ fastagent --channel weixin --sandbox local
44
+ fastagent --channel weixin --sandbox remote --sandbox-url http://127.0.0.1:8788
25
45
  fastagent config
26
46
  fastagent doctor
27
47
  fastagent skills add <source>
28
48
  fastagent skills list
29
49
  ```
30
50
 
31
- ## 示例
51
+ 当前 `fastagent` 裸命令默认只打印 help;如果你要直接跑服务,优先从 IM channel 开始。
52
+
53
+ ## IM Channel
54
+
55
+ 当前内置的 IM channel 是微信 `weixin`。
56
+
57
+ 你可以用它把 FastAgent 作为一个微信机器人运行,支持:
58
+
59
+ - 扫码登录
60
+ - 已有登录态恢复
61
+ - 文本模式输出
62
+ - `jsonl` 机器输出
63
+ - `local` / `remote` sandbox 路由
64
+
65
+ ### 启动前需要的环境变量
66
+
67
+ 必填:
68
+
69
+ ```bash
70
+ # 用户工作区(项目级)
71
+ export IM_GATEWAY_WORKSPACE_DIR=/weixin-bot/workspace
72
+ # 全局/用户级数据目录
73
+ export IM_GATEWAY_DATA_DIR=/weixin-bot/data
74
+ # AI名字可任意命名
75
+ export IM_GATEWAY_AGENT_ID=weixin-bot
76
+ # 默认允许全部权限
77
+ export IM_GATEWAY_ALLOW_ALL_PERMISSIONS=true
78
+ ```
79
+
80
+ LLM 最小示例:
81
+
82
+ ```bash
83
+ export FASTAGENT_PROVIDER=anthropic
84
+ export FASTAGENT_MODEL=claude-opus-4-6
85
+ export ANTHROPIC_API_KEY=<your-key>
86
+ ```
87
+
88
+ 常见可选项:
89
+
90
+ ```bash
91
+ export FASTAGENT_API_KEY=<your-key>
92
+ export FASTAGENT_API_TYPE=openai-responses
93
+ export FASTAGENT_BASE_URL=https://api.openai.com/v1
94
+ export FASTAGENT_USER_AGENT=your-app-name
95
+ ```
96
+
97
+ ### 启动微信服务
98
+
99
+ ```bash
100
+ fastagent --channel weixin
101
+ ```
102
+
103
+ 机器可读输出:
104
+
105
+ ```bash
106
+ fastagent --channel weixin --output jsonl
107
+ ```
108
+
109
+ 远端 sandbox:
110
+
111
+ ```bash
112
+ fastagent --channel weixin --sandbox remote --sandbox-url http://127.0.0.1:8788
113
+ ```
114
+
115
+ 如果你要在 npm 安装态启用 `--sandbox local`,需要满足以下其一:
116
+
117
+ - 通过 `FASTAGENT_SANDBOX_RUNTIME_BIN` 和可选 `FASTAGENT_SANDBOX_RUNTIME_ARGS` 显式指定 launcher
118
+ - 让 `fastagent-sandbox` 已经存在于 PATH 中
119
+
120
+ ## 常见用例
32
121
 
33
122
  ```bash
34
123
  fastagent --help
35
124
  fastagent --version
36
125
  fastagent --channel weixin
37
126
  fastagent --channel weixin --output jsonl
127
+ fastagent --channel weixin --sandbox local
128
+ fastagent skills add owner/repo
129
+ fastagent skills add ./skills/review-pr --scope project
38
130
  fastagent config
39
131
  fastagent doctor
40
132
  fastagent skills list