@xmemo/client 0.4.135 → 0.4.136
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 +7 -7
- package/README.md +393 -329
- package/bin/memory-os.js +12 -12
- package/package.json +46 -46
- package/src/cli.js +2406 -2244
package/README.md
CHANGED
|
@@ -1,329 +1,393 @@
|
|
|
1
|
-
# XMemo CLI
|
|
2
|
-
|
|
3
|
-
`@xmemo/client` is the privacy-first command line entry point for XMemo client
|
|
4
|
-
setup. It is intentionally small: the npm package contains only the CLI and
|
|
5
|
-
setup helper code needed on a user's machine.
|
|
6
|
-
|
|
7
|
-
`@yonro/xmemo-client` is reserved as a Yonro fallback package. The CLI exposes
|
|
8
|
-
`xmemo` as the primary command and keeps `memory-os` as a compatibility alias.
|
|
9
|
-
|
|
10
|
-
The XMemo server, database, token registry, deployment files, logs, and
|
|
11
|
-
internal scripts are not part of this npm package.
|
|
12
|
-
|
|
13
|
-
## Install
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g @xmemo/client
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Upgrade an existing global install:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
xmemo update
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This runs `npm install -g @xmemo/client@latest`. Use `xmemo update --dry-run`
|
|
26
|
-
to print the exact command without changing anything.
|
|
27
|
-
|
|
28
|
-
## Commands
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
xmemo update
|
|
32
|
-
xmemo setup codex
|
|
33
|
-
xmemo setup codex --dry-run
|
|
34
|
-
xmemo setup cursor
|
|
35
|
-
xmemo setup cursor --dry-run
|
|
36
|
-
xmemo setup copilot
|
|
37
|
-
xmemo setup copilot --dry-run
|
|
38
|
-
xmemo
|
|
39
|
-
xmemo
|
|
40
|
-
xmemo setup
|
|
41
|
-
xmemo
|
|
42
|
-
xmemo
|
|
43
|
-
xmemo
|
|
44
|
-
xmemo
|
|
45
|
-
xmemo
|
|
46
|
-
xmemo
|
|
47
|
-
xmemo
|
|
48
|
-
xmemo
|
|
49
|
-
xmemo
|
|
50
|
-
xmemo
|
|
51
|
-
xmemo
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
and
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
xmemo
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
xmemo mcp
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
xmemo
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
1
|
+
# XMemo CLI
|
|
2
|
+
|
|
3
|
+
`@xmemo/client` is the privacy-first command line entry point for XMemo client
|
|
4
|
+
setup. It is intentionally small: the npm package contains only the CLI and
|
|
5
|
+
setup helper code needed on a user's machine.
|
|
6
|
+
|
|
7
|
+
`@yonro/xmemo-client` is reserved as a Yonro fallback package. The CLI exposes
|
|
8
|
+
`xmemo` as the primary command and keeps `memory-os` as a compatibility alias.
|
|
9
|
+
|
|
10
|
+
The XMemo server, database, token registry, deployment files, logs, and
|
|
11
|
+
internal scripts are not part of this npm package.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @xmemo/client
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Upgrade an existing global install:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
xmemo update
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This runs `npm install -g @xmemo/client@latest`. Use `xmemo update --dry-run`
|
|
26
|
+
to print the exact command without changing anything.
|
|
27
|
+
|
|
28
|
+
## Commands
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
xmemo update
|
|
32
|
+
xmemo setup codex
|
|
33
|
+
xmemo setup codex --dry-run
|
|
34
|
+
xmemo setup cursor
|
|
35
|
+
xmemo setup cursor --dry-run
|
|
36
|
+
xmemo setup copilot
|
|
37
|
+
xmemo setup copilot --dry-run
|
|
38
|
+
xmemo setup gemini
|
|
39
|
+
xmemo setup gemini --dry-run
|
|
40
|
+
xmemo setup antigravity
|
|
41
|
+
xmemo setup antigravity --dry-run
|
|
42
|
+
xmemo doctor
|
|
43
|
+
xmemo discovery show
|
|
44
|
+
xmemo setup
|
|
45
|
+
xmemo login
|
|
46
|
+
xmemo auth status
|
|
47
|
+
xmemo status
|
|
48
|
+
xmemo token status
|
|
49
|
+
xmemo token add --from-stdin
|
|
50
|
+
xmemo env example --shell bash
|
|
51
|
+
xmemo mcp list
|
|
52
|
+
xmemo mcp config --client generic
|
|
53
|
+
xmemo mcp config --client antigravity
|
|
54
|
+
xmemo mcp add antigravity --write
|
|
55
|
+
xmemo profile status codex
|
|
56
|
+
xmemo smoke --client codex
|
|
57
|
+
xmemo privacy
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Enterprise privacy and security defaults
|
|
61
|
+
|
|
62
|
+
- No telemetry or analytics.
|
|
63
|
+
- `xmemo doctor`, `xmemo discovery show`, and `xmemo status` do not send tokens.
|
|
64
|
+
- MCP config generated by the CLI references `XMEMO_KEY` or uses the client's
|
|
65
|
+
MCP OAuth flow; it does not write token values into project files.
|
|
66
|
+
- The CLI generates one stable non-secret `XMEMO_AGENT_INSTANCE_ID` per local
|
|
67
|
+
client profile and stores it in user-scoped config outside git.
|
|
68
|
+
- `xmemo login` stores the issued credential in the user-scoped XMemo CLI
|
|
69
|
+
config directory, shows the approved account when the server provides it,
|
|
70
|
+
and does not require extra token configuration afterward.
|
|
71
|
+
- `xmemo token add` remains available for existing tokens and still avoids
|
|
72
|
+
project files, shell history, and printed token values.
|
|
73
|
+
- Legacy `xmemo token set` refuses plaintext credential storage unless
|
|
74
|
+
`--allow-plaintext` is explicitly provided.
|
|
75
|
+
- The npm package uses a `files` whitelist so only `bin`, `src`, `README.md`,
|
|
76
|
+
and `LICENSE` are published.
|
|
77
|
+
|
|
78
|
+
## Token flow
|
|
79
|
+
|
|
80
|
+
Recommended personal-user flow:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
xmemo login
|
|
84
|
+
xmemo auth status
|
|
85
|
+
xmemo token status --verify
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`xmemo login` uses the hosted device-login flow when the service advertises it:
|
|
89
|
+
the CLI shows a browser URL and one-time code, the user authorizes in XMemo, and
|
|
90
|
+
the CLI stores the issued MCP token in the user-scoped credential file. When the
|
|
91
|
+
service returns approved account metadata, the CLI prints the account label so
|
|
92
|
+
users can confirm which XMemo account was connected. No manual token setup is
|
|
93
|
+
needed after a successful `xmemo login`; `xmemo token status --verify` is only
|
|
94
|
+
an optional connectivity check. The CLI waits for the full browser authorization
|
|
95
|
+
window by default; use `--timeout-ms` only to shorten or extend that approval
|
|
96
|
+
window, and `--http-timeout-ms` only for individual service requests.
|
|
97
|
+
|
|
98
|
+
Users who already have a token can configure it directly without shell profiles:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
printf '%s\n' 'your-token' | xmemo token add --from-stdin
|
|
102
|
+
xmemo token status --verify
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
This is the preferred fallback while a hosted service is rolling out device
|
|
106
|
+
login. It still avoids project files, MCP config files, logs, and chat
|
|
107
|
+
transcripts.
|
|
108
|
+
|
|
109
|
+
Tokens should be created by the XMemo website or enterprise console, then
|
|
110
|
+
stored with `xmemo login`, `xmemo token add`, a user environment variable, or an
|
|
111
|
+
enterprise secret manager:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
export XMEMO_KEY="your-token"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
PowerShell:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
[Environment]::SetEnvironmentVariable("XMEMO_KEY", "your-token", "User")
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Do not commit tokens to source control, MCP config files, `.env` files, logs, or
|
|
124
|
+
chat transcripts.
|
|
125
|
+
|
|
126
|
+
## Hosted discovery setup
|
|
127
|
+
|
|
128
|
+
Hosted setup uses the XMemo public discovery contracts. The CLI reads
|
|
129
|
+
secret-free discovery and onboarding status documents, then tells the user where
|
|
130
|
+
the API, MCP endpoint, docs, and any server-advertised onboarding links are.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
xmemo doctor
|
|
134
|
+
xmemo discovery show
|
|
135
|
+
xmemo setup
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Discovery requests do not send `XMEMO_KEY` or any Authorization
|
|
139
|
+
header. Token creation still happens in the website or enterprise console; the
|
|
140
|
+
public service discovery document does not return token values.
|
|
141
|
+
|
|
142
|
+
The hosted default service/base URL is `https://xmemo.dev`, so normal users do
|
|
143
|
+
not need to type a service address. The MCP endpoint is discovered from that
|
|
144
|
+
base URL and written as `https://xmemo.dev/mcp`; `https://mcp.xmemo.dev` is not
|
|
145
|
+
the current canonical setup URL. Use `--url <service-url>` or `XMEMO_URL` only
|
|
146
|
+
for private, enterprise, or self-hosted deployments. `MEMORY_OS_URL` remains
|
|
147
|
+
accepted as a compatibility alias.
|
|
148
|
+
|
|
149
|
+
Generate and write a client config from discovery:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
xmemo setup codex
|
|
153
|
+
xmemo setup codex --url "https://your-private-service.example"
|
|
154
|
+
xmemo setup cursor
|
|
155
|
+
xmemo setup copilot
|
|
156
|
+
xmemo setup gemini
|
|
157
|
+
xmemo setup antigravity
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`xmemo setup <client>` is the unified setup entry point. For write-capable
|
|
161
|
+
clients, it applies the user-scoped config directly; use `--dry-run` to preview
|
|
162
|
+
without writing. Codex/Cursor configs reference `XMEMO_KEY`; OAuth-native
|
|
163
|
+
clients such as Gemini CLI and Antigravity use the client's MCP OAuth flow
|
|
164
|
+
instead. No generated config embeds a token value. Write-capable client configs
|
|
165
|
+
also include stable non-secret agent identity headers where the client format
|
|
166
|
+
supports them. `--yes` remains accepted for Codex and Cursor as a compatibility
|
|
167
|
+
no-op.
|
|
168
|
+
|
|
169
|
+
`xmemo setup codex` is the recommended Codex path. It writes the Codex MCP
|
|
170
|
+
config and installs the profile into the current project's `AGENTS.md` marker
|
|
171
|
+
block. Use `--dry-run` to preview, `--profile-target <path>` to choose a
|
|
172
|
+
different project instruction file, or `--no-profile` to configure MCP only.
|
|
173
|
+
|
|
174
|
+
## MCP setup
|
|
175
|
+
|
|
176
|
+
List supported client generators:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
xmemo mcp list
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Current write-capable clients:
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
codex ~/.codex/config.toml
|
|
186
|
+
cursor ~/.cursor/mcp.json
|
|
187
|
+
copilot ~/.copilot/mcp-config.json
|
|
188
|
+
gemini ~/.gemini/settings.json
|
|
189
|
+
antigravity ~/.gemini/antigravity/mcp_config.json
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
For clients without a verified user-scoped write path, generate a read-only
|
|
193
|
+
template and apply it manually after review:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
xmemo mcp config --client generic --base-url "https://your-private-service.example" --json
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Codex, Cursor, Copilot CLI, Gemini CLI, and Antigravity have write-capable setup
|
|
200
|
+
helpers.
|
|
201
|
+
Other client writes should only be added after their official user-scoped config
|
|
202
|
+
format is verified.
|
|
203
|
+
|
|
204
|
+
### Copilot CLI
|
|
205
|
+
|
|
206
|
+
Copilot CLI has `/mcp` management and reads user MCP configuration from
|
|
207
|
+
`~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json`). XMemo writes
|
|
208
|
+
a local proxy server entry there:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
xmemo login
|
|
212
|
+
xmemo setup copilot
|
|
213
|
+
xmemo mcp proxy
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
`xmemo setup copilot` writes `memory-os` to Copilot CLI's user MCP config and
|
|
217
|
+
does not include token or identity headers. Use `xmemo setup copilot --dry-run`
|
|
218
|
+
to preview without writing. `xmemo mcp proxy` reads the token saved by
|
|
219
|
+
`xmemo login` or `xmemo token add --from-stdin`, adds the XMemo bearer token and
|
|
220
|
+
local agent identity, then forwards requests to `https://xmemo.dev/mcp`. If
|
|
221
|
+
Copilot CLI is already open, reload MCP config or restart Copilot CLI after
|
|
222
|
+
setup.
|
|
223
|
+
If you specifically want the older environment-variable template, run:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
xmemo mcp config --client copilot-cli --remote-env
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Codex
|
|
230
|
+
|
|
231
|
+
Recommended Codex setup:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
xmemo setup codex
|
|
235
|
+
xmemo smoke --client codex
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
`setup codex` writes the MCP config to user-scoped Codex config and installs the
|
|
239
|
+
XMemo Codex behavior profile into the current project's `AGENTS.md` between
|
|
240
|
+
these markers. Use `xmemo setup codex --dry-run` to preview without writing.
|
|
241
|
+
|
|
242
|
+
```html
|
|
243
|
+
<!-- memory-os:codex-profile:start -->
|
|
244
|
+
<!-- memory-os:codex-profile:end -->
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Repeat installs update only that marker block. Remove it with:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
xmemo profile uninstall codex
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Advanced: generate a Codex MCP config snippet without touching files:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
xmemo mcp add codex --url "$XMEMO_URL"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Write it to the default Codex config path:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
xmemo mcp add codex --url "$XMEMO_URL" --write
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
The generated config references `XMEMO_KEY` and does not include the token
|
|
266
|
+
value. Codex custom identity headers are not written until the CLI format is
|
|
267
|
+
verified to support them.
|
|
268
|
+
|
|
269
|
+
Codex MCP-depth checks:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
xmemo mcp profile codex
|
|
273
|
+
xmemo profile install codex --dry-run
|
|
274
|
+
xmemo profile install codex
|
|
275
|
+
xmemo profile status codex
|
|
276
|
+
xmemo smoke --client codex
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`xmemo mcp profile codex` prints the recommended memory behavior profile:
|
|
280
|
+
recall/search at the start of non-trivial tasks, write back high-signal
|
|
281
|
+
decisions and fixes, and never store secrets. `xmemo smoke --client codex`
|
|
282
|
+
checks the local Codex TOML config for the `memory_os` MCP server,
|
|
283
|
+
`bearer_token_env_var = "XMEMO_KEY"`, token presence in the environment, and
|
|
284
|
+
absence of embedded token values.
|
|
285
|
+
|
|
286
|
+
### Cursor
|
|
287
|
+
|
|
288
|
+
Recommended Cursor setup:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
xmemo setup cursor
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
`setup cursor` merges the Cursor MCP config into the default Cursor user config
|
|
295
|
+
path. Use `xmemo setup cursor --dry-run` to preview without writing. The
|
|
296
|
+
lower-level equivalent remains:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
xmemo mcp add cursor --url "$XMEMO_URL" --write
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
The CLI refuses to overwrite an existing `memory_os` MCP server entry. Edit the
|
|
303
|
+
config manually if you need to rotate the endpoint. Cursor configs include
|
|
304
|
+
`X-Memory-OS-Agent-ID` and `X-Memory-OS-Agent-Instance-ID`; the instance ID is
|
|
305
|
+
non-secret and stored under the user's XMemo CLI config directory.
|
|
306
|
+
|
|
307
|
+
### Gemini CLI
|
|
308
|
+
|
|
309
|
+
Recommended Gemini CLI setup:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
xmemo setup gemini
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
`setup gemini` merges an XMemo MCP server into Gemini CLI's user settings at
|
|
316
|
+
`~/.gemini/settings.json`. It writes a remote HTTP server using Gemini's
|
|
317
|
+
`httpUrl` key plus `X-Memory-OS-Agent-ID` and `X-Memory-OS-Agent-Instance-ID`
|
|
318
|
+
headers. Use `xmemo setup gemini --dry-run` to preview without writing.
|
|
319
|
+
|
|
320
|
+
Unlike Codex/Cursor, the Gemini config carries **no token**: authentication uses
|
|
321
|
+
Gemini CLI's built-in MCP OAuth flow (a one-time browser login on first use).
|
|
322
|
+
This is deliberate — Gemini redacts environment variables matching
|
|
323
|
+
`*KEY*`/`*TOKEN*`/`*AUTH*` during header expansion, so an `${XMEMO_KEY}`
|
|
324
|
+
reference would not survive. OAuth avoids storing any secret in the config and
|
|
325
|
+
still grants the full XMemo tool profile. After setup, restart Gemini CLI and
|
|
326
|
+
run `/mcp` (or the first XMemo tool call) to complete the OAuth login.
|
|
327
|
+
|
|
328
|
+
The CLI refuses to overwrite an existing `memory_os` MCP server entry. Edit the
|
|
329
|
+
config manually if you need to rotate the endpoint.
|
|
330
|
+
|
|
331
|
+
### Antigravity
|
|
332
|
+
|
|
333
|
+
Recommended Antigravity setup:
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
xmemo setup antigravity
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
`setup antigravity` merges an XMemo MCP server into Antigravity's user MCP config
|
|
340
|
+
at `~/.gemini/antigravity/mcp_config.json`. It writes Antigravity's
|
|
341
|
+
`serverUrl` shape plus `X-Memory-OS-Agent-ID` and
|
|
342
|
+
`X-Memory-OS-Agent-Instance-ID` headers. Like Gemini CLI, the config carries
|
|
343
|
+
**no token**: restart Antigravity and complete the MCP OAuth flow on first use.
|
|
344
|
+
|
|
345
|
+
The lower-level equivalent is:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
xmemo mcp add antigravity --write
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Use `xmemo setup antigravity` for normal installs because it performs discovery
|
|
352
|
+
and chooses the recommended Antigravity path automatically. Use
|
|
353
|
+
`xmemo mcp add antigravity --write` when you want the generic MCP writer
|
|
354
|
+
directly, for example with `--url` or `--config` in advanced/multi-client setup.
|
|
355
|
+
The CLI refuses to overwrite an existing `memory_os` MCP server entry. Edit the
|
|
356
|
+
config manually if you need to rotate the endpoint.
|
|
357
|
+
|
|
358
|
+
## Release model
|
|
359
|
+
|
|
360
|
+
This repository is the source for the `@xmemo/client` npm package. Releases
|
|
361
|
+
should be published from GitHub Actions on tags or GitHub Releases, not from a
|
|
362
|
+
developer workstation.
|
|
363
|
+
|
|
364
|
+
Recommended flow:
|
|
365
|
+
|
|
366
|
+
```text
|
|
367
|
+
develop -> test -> tag/release -> GitHub Actions -> npm publish --provenance
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Package boundary
|
|
371
|
+
|
|
372
|
+
Included in npm:
|
|
373
|
+
|
|
374
|
+
```text
|
|
375
|
+
bin/
|
|
376
|
+
src/
|
|
377
|
+
README.md
|
|
378
|
+
LICENSE
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Excluded from npm:
|
|
382
|
+
|
|
383
|
+
```text
|
|
384
|
+
.github/
|
|
385
|
+
test/
|
|
386
|
+
coverage/
|
|
387
|
+
server code
|
|
388
|
+
database migrations
|
|
389
|
+
deployment files
|
|
390
|
+
logs
|
|
391
|
+
local state
|
|
392
|
+
secrets
|
|
393
|
+
```
|