@foxden-app/foxclaw 0.2.6 → 0.2.7
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/README.md +299 -297
- package/README_EN.md +299 -297
- package/dist/controller/controller.js +1 -1
- package/dist/controller/presentation.js +25 -15
- package/dist/i18n.d.ts +58 -58
- package/dist/i18n.js +58 -58
- package/docs/agent-assisted-install.md +84 -84
- package/docs/install-for-beginners.md +282 -282
- package/docs/troubleshooting.md +236 -236
- package/docs/zh/agent-assisted-install.md +83 -0
- package/docs/zh/foxclaw-skill.md +24 -0
- package/docs/zh/install-for-beginners.md +295 -0
- package/docs/zh/troubleshooting.md +222 -0
- package/package.json +2 -1
- package/scripts/doctor.sh +0 -0
- package/scripts/launchd/install.sh +0 -0
- package/scripts/status.sh +4 -4
- package/scripts/systemd/install.sh +4 -4
- package/scripts/systemd/uninstall.sh +4 -4
package/docs/troubleshooting.md
CHANGED
|
@@ -1,236 +1,236 @@
|
|
|
1
|
-
# Troubleshooting
|
|
2
|
-
|
|
3
|
-
Start with these commands:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
foxclaw doctor
|
|
7
|
-
foxclaw status
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
If FoxClaw is installed as a Linux user service, also check:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
systemctl --user status foxclaw.service
|
|
14
|
-
journalctl --user -u foxclaw.service -f
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Doctor Failures
|
|
18
|
-
|
|
19
|
-
| Symptom | Meaning | Fix |
|
|
20
|
-
| --- | --- | --- |
|
|
21
|
-
| `[FAIL] node >= 24` | Your current shell is using an older Node.js. | Run `nvm install 24 && nvm use 24`, then rerun `foxclaw doctor`. If the service uses old Node, reinstall it from a Node 24 shell with `foxclaw start`. |
|
|
22
|
-
| `[FAIL] codex cli available` | The `codex` command is not in PATH. | Install Codex CLI or fix PATH, then confirm `codex --version` works. |
|
|
23
|
-
| `[FAIL] telegram bot token configured` | `TG_BOT_TOKEN` is missing from `.env`. | Copy the token from `@BotFather` into `.env`. |
|
|
24
|
-
| `[FAIL] telegram allowed user configured` | `TG_ALLOWED_USER_ID` is missing from `.env`. | Get your numeric id from `@userinfobot` and add it to `.env`. |
|
|
25
|
-
| `[FAIL] default cwd exists` | `DEFAULT_CWD` points to a folder that does not exist. | Create the folder or change `DEFAULT_CWD` to an existing absolute path. |
|
|
26
|
-
|
|
27
|
-
## Node Or npm Is Missing
|
|
28
|
-
|
|
29
|
-
If you see `node: command not found` or `npm: command not found`, install Node.js 24 with `nvm`:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
|
33
|
-
export NVM_DIR="$HOME/.nvm"
|
|
34
|
-
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
35
|
-
nvm install 24
|
|
36
|
-
nvm use 24
|
|
37
|
-
node -v
|
|
38
|
-
npm -v
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
If it still fails, close the terminal, open a new one, and run:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
nvm use 24
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## npm Permission Errors
|
|
48
|
-
|
|
49
|
-
If `npm install -g @openai/codex` fails with `EACCES`, `EPERM`, or `permission denied`, your global npm directory is not writable by your user.
|
|
50
|
-
|
|
51
|
-
Recommended fix: use Node through `nvm`, then install again:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
nvm install 24
|
|
55
|
-
nvm use 24
|
|
56
|
-
npm install -g @openai/codex
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Avoid `sudo npm install -g ...` unless you already understand how your Node installation is managed. Mixing `sudo`, system Node, and `nvm` is a common source of broken PATHs.
|
|
60
|
-
|
|
61
|
-
If `codex` installs but FoxClaw still cannot find it, locate the binary:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
command -v codex
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Then put the absolute path in `.env`:
|
|
68
|
-
|
|
69
|
-
```dotenv
|
|
70
|
-
CODEX_CLI_BIN=/absolute/path/to/codex
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Bot Does Not Reply
|
|
74
|
-
|
|
75
|
-
Check these in order:
|
|
76
|
-
|
|
77
|
-
1. Make sure FoxClaw is running:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
foxclaw status
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
2. Try private chat first. Open your bot directly and send:
|
|
84
|
-
|
|
85
|
-
```text
|
|
86
|
-
/help
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
3. Confirm `TG_ALLOWED_USER_ID` is your numeric Telegram id, not your `@username`.
|
|
90
|
-
|
|
91
|
-
4. Confirm the bot token in `.env` belongs to the bot you are messaging.
|
|
92
|
-
|
|
93
|
-
5. Restart after changing `.env`:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
foxclaw start
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
If running foreground mode, stop with `Ctrl+C` and run `foxclaw serve` again.
|
|
100
|
-
|
|
101
|
-
## Group Messages Do Not Work
|
|
102
|
-
|
|
103
|
-
Private chat is the easiest mode. For groups and topics:
|
|
104
|
-
|
|
105
|
-
1. Add the bot to the group.
|
|
106
|
-
2. Disable the bot's `privacy mode` in `@BotFather`.
|
|
107
|
-
3. Promote the bot to administrator.
|
|
108
|
-
4. Remove and re-add the bot if privacy mode was changed after it joined.
|
|
109
|
-
5. Configure `TG_ALLOWED_CHAT_ID`, and optionally `TG_ALLOWED_TOPIC_ID`.
|
|
110
|
-
|
|
111
|
-
Explicit commands such as `/status@botname` can work even when normal group messages are blocked by privacy mode, so verify with a plain natural-language message too.
|
|
112
|
-
|
|
113
|
-
## Get Group Or Topic IDs
|
|
114
|
-
|
|
115
|
-
1. Stop FoxClaw.
|
|
116
|
-
2. Send a new message in the target group or topic.
|
|
117
|
-
3. Open:
|
|
118
|
-
|
|
119
|
-
```text
|
|
120
|
-
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
4. Use `message.chat.id` as `TG_ALLOWED_CHAT_ID`.
|
|
124
|
-
5. Use `message.message_thread_id` as `TG_ALLOWED_TOPIC_ID`.
|
|
125
|
-
|
|
126
|
-
If FoxClaw is still running, it may consume the update before you inspect it.
|
|
127
|
-
|
|
128
|
-
## Telegram Polling Conflict
|
|
129
|
-
|
|
130
|
-
If Telegram reports conflicts or the same bot behaves strangely, two processes may be polling the same bot token.
|
|
131
|
-
|
|
132
|
-
Check old and new services:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
systemctl --user is-active foxclaw.service
|
|
136
|
-
systemctl --user is-active telegram-codex-app-bridge.service 2>/dev/null || true
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Stop the old service:
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
systemctl --user disable --now telegram-codex-app-bridge.service
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Then restart FoxClaw:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
foxclaw start
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Codex Or App-Server Fails
|
|
152
|
-
|
|
153
|
-
FoxClaw requires local Codex auth. Check:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
codex --version
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
If Codex is not logged in:
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
codex login
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
`codex --version` only verifies the command exists. To verify auth, run:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
codex
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Then ask:
|
|
172
|
-
|
|
173
|
-
```text
|
|
174
|
-
Say ready and exit.
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
If your CLI supports `codex login status`, that is also useful, but a normal successful prompt is the most reliable check.
|
|
178
|
-
|
|
179
|
-
FoxClaw app-server logs are stored here by default:
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
tail -f ~/.foxclaw/logs/codex-app-server.log
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Bridge logs are stored here:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
tail -f ~/.foxclaw/logs/service.log
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## Service Starts With The Wrong Node Version
|
|
192
|
-
|
|
193
|
-
The systemd installer captures the `node` binary from your current PATH. If you installed the service from a shell using Node 22 or older, reinstall it from a Node 24 shell:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
nvm use 24
|
|
197
|
-
foxclaw start
|
|
198
|
-
systemctl --user status foxclaw.service
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
The status output should show a Node 24 path in `ExecStart`.
|
|
202
|
-
|
|
203
|
-
## Does It Run After Reboot?
|
|
204
|
-
|
|
205
|
-
Linux user systemd:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
systemctl --user is-enabled foxclaw.service
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
`enabled` means it starts with your user session. To start after reboot before login:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
loginctl enable-linger "$USER"
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
macOS launchd starts FoxClaw when you log in after running:
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
foxclaw start
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## Migrating From The Old Project Name
|
|
224
|
-
|
|
225
|
-
If this machine still runs `telegram-codex-app-bridge`, migrate once:
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
systemctl --user disable --now telegram-codex-app-bridge.service 2>/dev/null || true
|
|
229
|
-
test -e ~/.foxclaw || cp -a ~/.telegram-codex-app-bridge ~/.foxclaw
|
|
230
|
-
npm install -g @foxden-app/foxclaw@latest
|
|
231
|
-
foxclaw init
|
|
232
|
-
foxclaw doctor
|
|
233
|
-
foxclaw start
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
If `~/.foxclaw/.env` already exists, `foxclaw init` leaves it untouched.
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
Start with these commands:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
foxclaw doctor
|
|
7
|
+
foxclaw status
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
If FoxClaw is installed as a Linux user service, also check:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
systemctl --user status foxclaw.service
|
|
14
|
+
journalctl --user -u foxclaw.service -f
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Doctor Failures
|
|
18
|
+
|
|
19
|
+
| Symptom | Meaning | Fix |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `[FAIL] node >= 24` | Your current shell is using an older Node.js. | Run `nvm install 24 && nvm use 24`, then rerun `foxclaw doctor`. If the service uses old Node, reinstall it from a Node 24 shell with `foxclaw start`. |
|
|
22
|
+
| `[FAIL] codex cli available` | The `codex` command is not in PATH. | Install Codex CLI or fix PATH, then confirm `codex --version` works. |
|
|
23
|
+
| `[FAIL] telegram bot token configured` | `TG_BOT_TOKEN` is missing from `.env`. | Copy the token from `@BotFather` into `.env`. |
|
|
24
|
+
| `[FAIL] telegram allowed user configured` | `TG_ALLOWED_USER_ID` is missing from `.env`. | Get your numeric id from `@userinfobot` and add it to `.env`. |
|
|
25
|
+
| `[FAIL] default cwd exists` | `DEFAULT_CWD` points to a folder that does not exist. | Create the folder or change `DEFAULT_CWD` to an existing absolute path. |
|
|
26
|
+
|
|
27
|
+
## Node Or npm Is Missing
|
|
28
|
+
|
|
29
|
+
If you see `node: command not found` or `npm: command not found`, install Node.js 24 with `nvm`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
|
33
|
+
export NVM_DIR="$HOME/.nvm"
|
|
34
|
+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
35
|
+
nvm install 24
|
|
36
|
+
nvm use 24
|
|
37
|
+
node -v
|
|
38
|
+
npm -v
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
If it still fails, close the terminal, open a new one, and run:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
nvm use 24
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## npm Permission Errors
|
|
48
|
+
|
|
49
|
+
If `npm install -g @openai/codex` fails with `EACCES`, `EPERM`, or `permission denied`, your global npm directory is not writable by your user.
|
|
50
|
+
|
|
51
|
+
Recommended fix: use Node through `nvm`, then install again:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
nvm install 24
|
|
55
|
+
nvm use 24
|
|
56
|
+
npm install -g @openai/codex
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Avoid `sudo npm install -g ...` unless you already understand how your Node installation is managed. Mixing `sudo`, system Node, and `nvm` is a common source of broken PATHs.
|
|
60
|
+
|
|
61
|
+
If `codex` installs but FoxClaw still cannot find it, locate the binary:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
command -v codex
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then put the absolute path in `.env`:
|
|
68
|
+
|
|
69
|
+
```dotenv
|
|
70
|
+
CODEX_CLI_BIN=/absolute/path/to/codex
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Bot Does Not Reply
|
|
74
|
+
|
|
75
|
+
Check these in order:
|
|
76
|
+
|
|
77
|
+
1. Make sure FoxClaw is running:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
foxclaw status
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
2. Try private chat first. Open your bot directly and send:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
/help
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
3. Confirm `TG_ALLOWED_USER_ID` is your numeric Telegram id, not your `@username`.
|
|
90
|
+
|
|
91
|
+
4. Confirm the bot token in `.env` belongs to the bot you are messaging.
|
|
92
|
+
|
|
93
|
+
5. Restart after changing `.env`:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
foxclaw start
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
If running foreground mode, stop with `Ctrl+C` and run `foxclaw serve` again.
|
|
100
|
+
|
|
101
|
+
## Group Messages Do Not Work
|
|
102
|
+
|
|
103
|
+
Private chat is the easiest mode. For groups and topics:
|
|
104
|
+
|
|
105
|
+
1. Add the bot to the group.
|
|
106
|
+
2. Disable the bot's `privacy mode` in `@BotFather`.
|
|
107
|
+
3. Promote the bot to administrator.
|
|
108
|
+
4. Remove and re-add the bot if privacy mode was changed after it joined.
|
|
109
|
+
5. Configure `TG_ALLOWED_CHAT_ID`, and optionally `TG_ALLOWED_TOPIC_ID`.
|
|
110
|
+
|
|
111
|
+
Explicit commands such as `/status@botname` can work even when normal group messages are blocked by privacy mode, so verify with a plain natural-language message too.
|
|
112
|
+
|
|
113
|
+
## Get Group Or Topic IDs
|
|
114
|
+
|
|
115
|
+
1. Stop FoxClaw.
|
|
116
|
+
2. Send a new message in the target group or topic.
|
|
117
|
+
3. Open:
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
4. Use `message.chat.id` as `TG_ALLOWED_CHAT_ID`.
|
|
124
|
+
5. Use `message.message_thread_id` as `TG_ALLOWED_TOPIC_ID`.
|
|
125
|
+
|
|
126
|
+
If FoxClaw is still running, it may consume the update before you inspect it.
|
|
127
|
+
|
|
128
|
+
## Telegram Polling Conflict
|
|
129
|
+
|
|
130
|
+
If Telegram reports conflicts or the same bot behaves strangely, two processes may be polling the same bot token.
|
|
131
|
+
|
|
132
|
+
Check old and new services:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
systemctl --user is-active foxclaw.service
|
|
136
|
+
systemctl --user is-active telegram-codex-app-bridge.service 2>/dev/null || true
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Stop the old service:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
systemctl --user disable --now telegram-codex-app-bridge.service
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Then restart FoxClaw:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
foxclaw start
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Codex Or App-Server Fails
|
|
152
|
+
|
|
153
|
+
FoxClaw requires local Codex auth. Check:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
codex --version
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
If Codex is not logged in:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
codex login
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`codex --version` only verifies the command exists. To verify auth, run:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
codex
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Then ask:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
Say ready and exit.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
If your CLI supports `codex login status`, that is also useful, but a normal successful prompt is the most reliable check.
|
|
178
|
+
|
|
179
|
+
FoxClaw app-server logs are stored here by default:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
tail -f ~/.foxclaw/logs/codex-app-server.log
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Bridge logs are stored here:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
tail -f ~/.foxclaw/logs/service.log
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Service Starts With The Wrong Node Version
|
|
192
|
+
|
|
193
|
+
The systemd installer captures the `node` binary from your current PATH. If you installed the service from a shell using Node 22 or older, reinstall it from a Node 24 shell:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
nvm use 24
|
|
197
|
+
foxclaw start
|
|
198
|
+
systemctl --user status foxclaw.service
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The status output should show a Node 24 path in `ExecStart`.
|
|
202
|
+
|
|
203
|
+
## Does It Run After Reboot?
|
|
204
|
+
|
|
205
|
+
Linux user systemd:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
systemctl --user is-enabled foxclaw.service
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
`enabled` means it starts with your user session. To start after reboot before login:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
loginctl enable-linger "$USER"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
macOS launchd starts FoxClaw when you log in after running:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
foxclaw start
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Migrating From The Old Project Name
|
|
224
|
+
|
|
225
|
+
If this machine still runs `telegram-codex-app-bridge`, migrate once:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
systemctl --user disable --now telegram-codex-app-bridge.service 2>/dev/null || true
|
|
229
|
+
test -e ~/.foxclaw || cp -a ~/.telegram-codex-app-bridge ~/.foxclaw
|
|
230
|
+
npm install -g @foxden-app/foxclaw@latest
|
|
231
|
+
foxclaw init
|
|
232
|
+
foxclaw doctor
|
|
233
|
+
foxclaw start
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
If `~/.foxclaw/.env` already exists, `foxclaw init` leaves it untouched.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Agent 辅助安装
|
|
2
|
+
|
|
3
|
+
如果目标电脑上已经有能执行 shell、读写文件、检查服务状态的编码 agent,优先用这条路径。它比手动一步步复制命令更快,也更容易发现本机环境里的阻塞点。
|
|
4
|
+
|
|
5
|
+
适合使用 Codex、OpenClaw、QwenPaw、Hermes、OpenCode、Kimi CLI,或者任何可以在目标机器上运行命令的 agent。
|
|
6
|
+
|
|
7
|
+
## 你需要准备
|
|
8
|
+
|
|
9
|
+
先准备这几个值:
|
|
10
|
+
|
|
11
|
+
- `TG_BOT_TOKEN`:从 `@BotFather` 拿到的 Telegram bot token
|
|
12
|
+
- `TG_ALLOWED_USER_ID`:你的 Telegram 数字用户 ID
|
|
13
|
+
- `DEFAULT_CWD`:希望 Codex 默认工作的目录
|
|
14
|
+
|
|
15
|
+
后续再配置群组或话题时才需要:
|
|
16
|
+
|
|
17
|
+
- `TG_ALLOWED_CHAT_ID`
|
|
18
|
+
- `TG_ALLOWED_TOPIC_ID`
|
|
19
|
+
|
|
20
|
+
第一次请先用 Telegram 私聊跑通。群组和话题模式等私聊稳定后再开。
|
|
21
|
+
|
|
22
|
+
## 复制给 agent 的安装提示词
|
|
23
|
+
|
|
24
|
+
把下面这段发给目标电脑上的 agent:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
请在这台机器上安装 FoxClaw。
|
|
28
|
+
|
|
29
|
+
发布包:
|
|
30
|
+
@foxden-app/foxclaw
|
|
31
|
+
|
|
32
|
+
先使用 Telegram 私聊模式。除非我明确提供 TG_ALLOWED_CHAT_ID 或 TG_ALLOWED_TOPIC_ID,否则不要配置群组/话题模式。
|
|
33
|
+
|
|
34
|
+
必需配置:
|
|
35
|
+
TG_BOT_TOKEN=<把 token 粘贴在这里>
|
|
36
|
+
TG_ALLOWED_USER_ID=<把 Telegram 数字用户 ID 粘贴在这里>
|
|
37
|
+
DEFAULT_CWD=<把绝对工作目录粘贴在这里>
|
|
38
|
+
|
|
39
|
+
任务:
|
|
40
|
+
1. 先检查机器环境。如果已经存在 FoxClaw 或旧的 telegram-codex-app-bridge 服务,先报告再改服务。
|
|
41
|
+
2. 确保 Node.js 24+ 可用;如果没有,请用 nvm 安装或切到 Node 24。
|
|
42
|
+
3. 确保 Codex CLI 存在并且已经登录。如果需要登录,停下来告诉我具体要执行什么。
|
|
43
|
+
4. 用 npm install -g @foxden-app/foxclaw@latest 安装或升级 FoxClaw。
|
|
44
|
+
5. 运行 foxclaw init,然后写入 ~/.foxclaw/.env。不要打印或提交 bot token。
|
|
45
|
+
6. 运行 foxclaw doctor。
|
|
46
|
+
7. 用 foxclaw start 启动 FoxClaw。
|
|
47
|
+
8. 让我在 Telegram bot 里发送 /help 和 /status。
|
|
48
|
+
9. 验证最终状态:
|
|
49
|
+
- Linux 上 foxclaw.service 处于 active/enabled
|
|
50
|
+
- 如果存在旧 telegram-codex-app-bridge.service,它应当 inactive/disabled
|
|
51
|
+
- foxclaw status 可以正常输出
|
|
52
|
+
10. 汇报执行过的命令、最终状态和后续看日志的命令。请隐藏 TG_BOT_TOKEN,不要打印完整 token 或完整 .env。
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 旧项目迁移提示词
|
|
56
|
+
|
|
57
|
+
如果目标机器还在跑 `telegram-codex-app-bridge`,用这段:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
请把这台机器从 telegram-codex-app-bridge 迁移到 FoxClaw。
|
|
61
|
+
|
|
62
|
+
新发布包:
|
|
63
|
+
@foxden-app/foxclaw
|
|
64
|
+
|
|
65
|
+
请执行:
|
|
66
|
+
1. 修改前先检查现有安装方式、服务文件和运行目录。
|
|
67
|
+
2. 如果存在 telegram-codex-app-bridge.service,停止并禁用它。
|
|
68
|
+
3. 如果 ~/.foxclaw 不存在而 ~/.telegram-codex-app-bridge 存在,把旧目录复制到 ~/.foxclaw。
|
|
69
|
+
4. 用 npm install -g @foxden-app/foxclaw@latest 安装或升级 FoxClaw。
|
|
70
|
+
5. 如果 ~/.foxclaw/.env 不存在,运行 foxclaw init;然后检查配置是否完整。
|
|
71
|
+
6. 运行 foxclaw doctor。
|
|
72
|
+
7. 用 foxclaw start 安装或重启 FoxClaw 服务。
|
|
73
|
+
8. 验证 foxclaw.service 正常运行,旧 telegram-codex-app-bridge.service 已停止或禁用。
|
|
74
|
+
9. 汇报最终状态和阻塞点。请隐藏 TG_BOT_TOKEN,不要打印完整 token 或完整 .env。
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 安全注意事项
|
|
78
|
+
|
|
79
|
+
- 不要把 bot token 粘贴到公开 issue、公开聊天或代码仓库。
|
|
80
|
+
- 不要提交 `.env`。
|
|
81
|
+
- 汇报结果时隐藏 `TG_BOT_TOKEN`。
|
|
82
|
+
- 第一次安装不要把 `/`、整个 `/Users`、整个 `/home` 或完整 home 目录设为 `DEFAULT_CWD`。
|
|
83
|
+
- 日常启动用 `foxclaw start`;只有排障时才用前台模式 `foxclaw serve`。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# FoxClaw Skill 中文说明
|
|
2
|
+
|
|
3
|
+
仓库内置的 `skills/foxclaw` 是给 Codex 使用的安装技能。它的用途是让 Codex 在本机或远程 Mac 上自动完成 FoxClaw bootstrap,包括写 `.env`、安装依赖、构建、跑 `doctor`、安装 launchd 服务,并引导你完成第一次 Telegram 消息验证。
|
|
4
|
+
|
|
5
|
+
## 适合什么时候用
|
|
6
|
+
|
|
7
|
+
- 你想让 Codex 通过 SSH 帮另一台 Mac 安装 FoxClaw。
|
|
8
|
+
- 你希望 agent 先检查环境,再决定如何安装 Node.js 24、Codex CLI 和 FoxClaw。
|
|
9
|
+
- 你不想手动复制每一步安装命令,但愿意提供 Telegram bot token、用户 ID 和默认工作目录。
|
|
10
|
+
|
|
11
|
+
## 基本流程
|
|
12
|
+
|
|
13
|
+
1. 准备 `TG_BOT_TOKEN`、`TG_ALLOWED_USER_ID` 和 `DEFAULT_CWD`。
|
|
14
|
+
2. 让 Codex 使用 `skills/foxclaw`。
|
|
15
|
+
3. 如果是远程机器,提供 SSH 目标。
|
|
16
|
+
4. 让 Codex 执行安装、写配置、跑 `foxclaw doctor`。
|
|
17
|
+
5. 启动服务后,在 Telegram bot 里发送 `/help` 和 `/status` 验证。
|
|
18
|
+
|
|
19
|
+
## 注意事项
|
|
20
|
+
|
|
21
|
+
- 不要让 agent 把完整 bot token 打印到日志或提交到仓库。
|
|
22
|
+
- 第一次请先用私聊模式跑通。
|
|
23
|
+
- 不要把整个 home 目录或根目录作为首次 `DEFAULT_CWD`。
|
|
24
|
+
- 只有在 `doctor` 通过、服务已启动、Telegram 首条消息验证通过后,才算安装完成。
|