@xmemo/client 0.4.141 → 0.4.143
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 +62 -1
- package/package.json +1 -1
- package/src/cli.js +68 -31
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ xmemo setup gemini
|
|
|
41
41
|
xmemo setup gemini --dry-run
|
|
42
42
|
xmemo setup antigravity
|
|
43
43
|
xmemo setup antigravity --dry-run
|
|
44
|
+
xmemo mcp add antigravity2
|
|
45
|
+
xmemo mcp add antigravity2 --write
|
|
44
46
|
xmemo doctor
|
|
45
47
|
xmemo discovery show
|
|
46
48
|
xmemo setup
|
|
@@ -195,6 +197,25 @@ gemini ~/.gemini/GEMINI.md
|
|
|
195
197
|
antigravity ~/.gemini/antigravity/MEMORY.md
|
|
196
198
|
```
|
|
197
199
|
|
|
200
|
+
Antigravity 2.0 currently uses the lower-level MCP writer because its stable
|
|
201
|
+
user config path is separate from the original Antigravity profile. Preview the
|
|
202
|
+
generated OAuth-first config with:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
xmemo mcp add antigravity2 --url https://xmemo.dev
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Write it to the default Antigravity 2.0 config path with:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
xmemo mcp add antigravity2 --url https://xmemo.dev --write
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
The generated config uses `https://xmemo.dev/mcp`, contains no bearer token, and
|
|
215
|
+
expects Antigravity 2.0 to complete MCP OAuth in the browser on first use.
|
|
216
|
+
`XMEMO_AGENT_INSTANCE_ID` is generated and stored as a stable non-secret local
|
|
217
|
+
installation identifier when `--write` is used.
|
|
218
|
+
|
|
198
219
|
## MCP setup
|
|
199
220
|
|
|
200
221
|
List supported client generators:
|
|
@@ -211,6 +232,7 @@ cursor ~/.cursor/mcp.json
|
|
|
211
232
|
copilot ~/.copilot/mcp-config.json
|
|
212
233
|
gemini ~/.gemini/settings.json
|
|
213
234
|
antigravity ~/.gemini/antigravity/mcp_config.json
|
|
235
|
+
antigravity2 ~/.antigravity2/mcp.json
|
|
214
236
|
```
|
|
215
237
|
|
|
216
238
|
For clients without a verified user-scoped write path, generate a read-only
|
|
@@ -221,7 +243,8 @@ xmemo mcp config --client generic --base-url "https://your-private-service.examp
|
|
|
221
243
|
```
|
|
222
244
|
|
|
223
245
|
Codex, Cursor, Copilot CLI, Gemini CLI, and Antigravity have write-capable setup
|
|
224
|
-
helpers.
|
|
246
|
+
helpers. Antigravity 2.0 is write-capable through `xmemo mcp add antigravity2
|
|
247
|
+
--write`.
|
|
225
248
|
Other client writes should only be added after their official user-scoped config
|
|
226
249
|
format is verified.
|
|
227
250
|
|
|
@@ -394,6 +417,44 @@ directly, for example with `--url` or `--config` in advanced/multi-client setup.
|
|
|
394
417
|
The CLI refuses to overwrite an existing `XMemo`, `memory_os`, or `memory-os`
|
|
395
418
|
MCP server entry. Edit the config manually if you need to rotate the endpoint.
|
|
396
419
|
|
|
420
|
+
### Antigravity 2.0
|
|
421
|
+
|
|
422
|
+
Recommended Antigravity 2.0 setup:
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
xmemo mcp add antigravity2 --write
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Use a dry preview first if you want to inspect the exact JSON before writing:
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
xmemo mcp add antigravity2
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Antigravity 2.0 uses a separate config path from the original Antigravity
|
|
435
|
+
profile. The default write target is `~/.antigravity2/mcp.json`; on Windows the
|
|
436
|
+
server-side config contract also documents `%APPDATA%\\Antigravity 2.0\\mcp.json`
|
|
437
|
+
as the Antigravity 2.0 user config location. Pass `--config <path>` when you
|
|
438
|
+
want to write to a specific file.
|
|
439
|
+
|
|
440
|
+
The generated `XMemo` entry uses hosted HTTP MCP:
|
|
441
|
+
|
|
442
|
+
```json
|
|
443
|
+
{
|
|
444
|
+
"mcpServers": {
|
|
445
|
+
"XMemo": {
|
|
446
|
+
"type": "http",
|
|
447
|
+
"url": "https://xmemo.dev/mcp"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
No token value is written. Restart Antigravity 2.0 after setup and complete the
|
|
454
|
+
MCP OAuth browser flow on first use. If you use `--write`, the CLI also prepares
|
|
455
|
+
a stable non-secret `XMEMO_AGENT_INSTANCE_ID` for this local Antigravity 2.0
|
|
456
|
+
install so XMemo can attribute activity consistently without embedding secrets.
|
|
457
|
+
|
|
397
458
|
## Release model
|
|
398
459
|
|
|
399
460
|
This repository is the source for the `@xmemo/client` npm package. Releases
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
2
3
|
import http from 'node:http';
|
|
3
4
|
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
@@ -10,7 +11,7 @@ const PACKAGE_NAME = '@xmemo/client';
|
|
|
10
11
|
const FALLBACK_PACKAGE_NAME = '@yonro/xmemo-client';
|
|
11
12
|
const COMMAND_NAME = 'xmemo';
|
|
12
13
|
const LEGACY_COMMAND_NAME = 'memory-os';
|
|
13
|
-
const CLI_VERSION = '0.4.
|
|
14
|
+
const CLI_VERSION = '0.4.143';
|
|
14
15
|
const DEFAULT_SERVICE_URL = 'https://xmemo.dev';
|
|
15
16
|
const TOKEN_ENV_VAR = 'XMEMO_KEY';
|
|
16
17
|
const LEGACY_TOKEN_ENV_VAR = 'MEMORY_OS_MCP_TOKEN';
|
|
@@ -310,36 +311,53 @@ function defaultIo() {
|
|
|
310
311
|
}
|
|
311
312
|
|
|
312
313
|
function writeHelp(io) {
|
|
313
|
-
writeLine(io.stdout,
|
|
314
|
-
writeLine(io.stdout, `
|
|
314
|
+
writeLine(io.stdout, `======================================================================`);
|
|
315
|
+
writeLine(io.stdout, ` 🧠 ${PRODUCT_NAME} CLI (Version ${CLI_VERSION}) — Cloud Memory Orchestration Utility`);
|
|
316
|
+
writeLine(io.stdout, `======================================================================`);
|
|
317
|
+
writeLine(io.stdout, `Official package: ${PACKAGE_NAME} | Legacy command: ${LEGACY_COMMAND_NAME}`);
|
|
315
318
|
writeLine(io.stdout, '');
|
|
316
|
-
writeLine(io.stdout, '
|
|
317
|
-
writeLine(io.stdout, ` ${COMMAND_NAME}
|
|
318
|
-
writeLine(io.stdout, `
|
|
319
|
-
writeLine(io.stdout, `
|
|
320
|
-
writeLine(io.stdout, `
|
|
321
|
-
writeLine(io.stdout,
|
|
322
|
-
writeLine(io.stdout, ` ${COMMAND_NAME}
|
|
323
|
-
writeLine(io.stdout, `
|
|
324
|
-
writeLine(io.stdout, `
|
|
325
|
-
writeLine(io.stdout,
|
|
326
|
-
writeLine(io.stdout, ` ${COMMAND_NAME}
|
|
319
|
+
writeLine(io.stdout, '💡 CORE ONBOARDING & SETUP COMMANDS:');
|
|
320
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} setup --all [--write] [--profile]`);
|
|
321
|
+
writeLine(io.stdout, ` Auto-detects all local client installations (Cursor, VS Code, Continue, Trae, etc.).`);
|
|
322
|
+
writeLine(io.stdout, ` Merges XMemo MCP configs. Pass --profile to auto-inject workspace prompt rules.`);
|
|
323
|
+
writeLine(io.stdout, ` *Dry-run by default unless --write (or --yes/-y) is specified for safety.*`);
|
|
324
|
+
writeLine(io.stdout, '');
|
|
325
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} setup <client-id> [--url <url>] [--no-profile] [--json]`);
|
|
326
|
+
writeLine(io.stdout, ` Runs interactive setup wizard for a single client (e.g. cursor, gemini, antigravity).`);
|
|
327
|
+
writeLine(io.stdout, ` Detects active workspace to auto-inject project-scoped instruction rules.`);
|
|
328
|
+
writeLine(io.stdout, '');
|
|
329
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} login [--from-stdin] [--base-url <url>]`);
|
|
330
|
+
writeLine(io.stdout, ` Starts secure OAuth2 browser-based device login flow to register the CLI.`);
|
|
331
|
+
writeLine(io.stdout, '');
|
|
332
|
+
writeLine(io.stdout, '🛡️ DIAGNOSTICS & SYSTEM AUDIT:');
|
|
333
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} doctor [--base-url <url>] [--json]`);
|
|
334
|
+
writeLine(io.stdout, ` Performs structural diagnostics (Node version, Cloud connectivity, API compatibility, security).`);
|
|
335
|
+
writeLine(io.stdout, '');
|
|
336
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} status [--url <url>] [--json]`);
|
|
337
|
+
writeLine(io.stdout, ` Probes and audits XMemo core service endpoints, readiness states, and network health.`);
|
|
338
|
+
writeLine(io.stdout, '');
|
|
339
|
+
writeLine(io.stdout, '📋 MCP & CREDENTIAL MANAGEMENT:');
|
|
327
340
|
writeLine(io.stdout, ` ${COMMAND_NAME} mcp list`);
|
|
328
|
-
writeLine(io.stdout, `
|
|
329
|
-
writeLine(io.stdout,
|
|
330
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} mcp
|
|
331
|
-
writeLine(io.stdout, `
|
|
332
|
-
writeLine(io.stdout,
|
|
333
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} mcp add
|
|
334
|
-
writeLine(io.stdout, `
|
|
335
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} env example [--shell bash|powershell|cmd] [--json]`);
|
|
336
|
-
writeLine(io.stdout, ` ${COMMAND_NAME} privacy`);
|
|
341
|
+
writeLine(io.stdout, ` Lists all natively supported client integrations and configurations.`);
|
|
342
|
+
writeLine(io.stdout, '');
|
|
343
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} mcp config --client <client-id> [--base-url <url>] [--json]`);
|
|
344
|
+
writeLine(io.stdout, ` Generates and outputs raw MCP config snippet templates without writing to files.`);
|
|
345
|
+
writeLine(io.stdout, '');
|
|
346
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} mcp add <client-id> [--write] [--config <path>]`);
|
|
347
|
+
writeLine(io.stdout, ` Directly adds XMemo MCP server config snippet to the specified client settings file.`);
|
|
337
348
|
writeLine(io.stdout, '');
|
|
338
|
-
writeLine(io.stdout, `
|
|
339
|
-
writeLine(io.stdout,
|
|
349
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} profile install <client-id> [--target <path>] [--dry-run]`);
|
|
350
|
+
writeLine(io.stdout, ` Injects/updates instruction rules prompt in target workspace rules files (Cursor/Gemini).`);
|
|
340
351
|
writeLine(io.stdout, '');
|
|
341
|
-
writeLine(io.stdout,
|
|
342
|
-
writeLine(io.stdout,
|
|
352
|
+
writeLine(io.stdout, ` ${COMMAND_NAME} token status [--verify] | ${COMMAND_NAME} token add --from-stdin`);
|
|
353
|
+
writeLine(io.stdout, ` Checks local static credential states or manually saves XMEMO_KEY for key-auth fallbacks.`);
|
|
354
|
+
writeLine(io.stdout, '');
|
|
355
|
+
writeLine(io.stdout, '🔐 SECURITY & PRIVACY BY DESIGN:');
|
|
356
|
+
writeLine(io.stdout, ' - ZERO Telemetry: We never collect private workspace data or usage metrics.');
|
|
357
|
+
writeLine(io.stdout, ' - Git Protection: API tokens are kept securely in system environment variables (XMEMO_KEY)');
|
|
358
|
+
writeLine(io.stdout, ' or in user-scoped credentials.json file. They are never written to project configs.');
|
|
359
|
+
writeLine(io.stdout, ' - AST Merge Safety: Config writes only touch and append the XMemo keys, preserving all other servers.');
|
|
360
|
+
writeLine(io.stdout, '======================================================================');
|
|
343
361
|
}
|
|
344
362
|
|
|
345
363
|
async function updateCommand(args, io) {
|
|
@@ -2028,7 +2046,13 @@ function profileClientConfig(clientId) {
|
|
|
2028
2046
|
requiredTokenEnv: TOKEN_ENV_VAR,
|
|
2029
2047
|
markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:cursor:start -->`,
|
|
2030
2048
|
markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:cursor:end -->`,
|
|
2031
|
-
defaultTarget: (env) =>
|
|
2049
|
+
defaultTarget: (env) => {
|
|
2050
|
+
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
2051
|
+
if (!isTest && (existsSync(path.join(process.cwd(), '.cursor')) || existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
2052
|
+
return path.join(process.cwd(), '.cursor', 'rules', 'xmemo-memory.md');
|
|
2053
|
+
}
|
|
2054
|
+
return path.join(userHome(env), '.cursor', 'memory-profile.md');
|
|
2055
|
+
},
|
|
2032
2056
|
authInstruction: `Keep XMemo authentication through the ${TOKEN_ENV_VAR} environment variable; do not paste token values into prompts, config files, or logs.`
|
|
2033
2057
|
},
|
|
2034
2058
|
'gemini-cli': {
|
|
@@ -2037,7 +2061,13 @@ function profileClientConfig(clientId) {
|
|
|
2037
2061
|
profileVersion: 'gemini-cli-mcp-depth-v1',
|
|
2038
2062
|
markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:gemini-cli:start -->`,
|
|
2039
2063
|
markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:gemini-cli:end -->`,
|
|
2040
|
-
defaultTarget: (env) =>
|
|
2064
|
+
defaultTarget: (env) => {
|
|
2065
|
+
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
2066
|
+
if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
2067
|
+
return path.join(process.cwd(), 'GEMINI.md');
|
|
2068
|
+
}
|
|
2069
|
+
return path.join(userHome(env), '.gemini', 'GEMINI.md');
|
|
2070
|
+
},
|
|
2041
2071
|
authInstruction: 'Use the client-managed MCP OAuth credential; do not paste token values into prompts, config files, or logs.'
|
|
2042
2072
|
},
|
|
2043
2073
|
antigravity: {
|
|
@@ -2046,7 +2076,13 @@ function profileClientConfig(clientId) {
|
|
|
2046
2076
|
profileVersion: 'antigravity-mcp-depth-v1',
|
|
2047
2077
|
markerStart: `<!-- ${PROFILE_MARKER_PREFIX}:antigravity:start -->`,
|
|
2048
2078
|
markerEnd: `<!-- ${PROFILE_MARKER_PREFIX}:antigravity:end -->`,
|
|
2049
|
-
defaultTarget: (env) =>
|
|
2079
|
+
defaultTarget: (env) => {
|
|
2080
|
+
const isTest = env.HOME && (env.HOME.includes('memory-os-') || env.HOME.includes('test'));
|
|
2081
|
+
if (!isTest && (existsSync(path.join(process.cwd(), '.git')) || existsSync(path.join(process.cwd(), 'package.json')))) {
|
|
2082
|
+
return path.join(process.cwd(), 'GEMINI.md');
|
|
2083
|
+
}
|
|
2084
|
+
return path.join(userHome(env), '.gemini', 'antigravity', 'MEMORY.md');
|
|
2085
|
+
},
|
|
2050
2086
|
authInstruction: 'Use the client-managed MCP OAuth credential; do not paste token values into prompts, config files, or logs.'
|
|
2051
2087
|
}
|
|
2052
2088
|
};
|
|
@@ -3103,7 +3139,8 @@ async function runProcess(command, args, io, { stream = true } = {}) {
|
|
|
3103
3139
|
const spawnFn = io.spawn ?? spawn;
|
|
3104
3140
|
return await new Promise((resolve, reject) => {
|
|
3105
3141
|
const child = spawnFn(command, args, {
|
|
3106
|
-
stdio: ['ignore', 'pipe', 'pipe']
|
|
3142
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
3143
|
+
shell: os.platform() === 'win32'
|
|
3107
3144
|
});
|
|
3108
3145
|
let stdout = '';
|
|
3109
3146
|
let stderr = '';
|