@xmemo/client 0.4.142 → 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.
Files changed (3) hide show
  1. package/README.md +62 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +46 -28
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmemo/client",
3
- "version": "0.4.142",
3
+ "version": "0.4.143",
4
4
  "description": "Privacy-first CLI and MCP setup helper for XMemo.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -11,7 +11,7 @@ const PACKAGE_NAME = '@xmemo/client';
11
11
  const FALLBACK_PACKAGE_NAME = '@yonro/xmemo-client';
12
12
  const COMMAND_NAME = 'xmemo';
13
13
  const LEGACY_COMMAND_NAME = 'memory-os';
14
- const CLI_VERSION = '0.4.142';
14
+ const CLI_VERSION = '0.4.143';
15
15
  const DEFAULT_SERVICE_URL = 'https://xmemo.dev';
16
16
  const TOKEN_ENV_VAR = 'XMEMO_KEY';
17
17
  const LEGACY_TOKEN_ENV_VAR = 'MEMORY_OS_MCP_TOKEN';
@@ -311,36 +311,53 @@ function defaultIo() {
311
311
  }
312
312
 
313
313
  function writeHelp(io) {
314
- writeLine(io.stdout, `${PRODUCT_NAME} CLI (${PACKAGE_NAME})`);
315
- writeLine(io.stdout, `Fallback npm package: ${FALLBACK_PACKAGE_NAME}; legacy command alias: ${LEGACY_COMMAND_NAME}`);
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}`);
316
318
  writeLine(io.stdout, '');
317
- writeLine(io.stdout, 'Usage:');
318
- writeLine(io.stdout, ` ${COMMAND_NAME} update [--dry-run] [--json]`);
319
- writeLine(io.stdout, ` ${COMMAND_NAME} doctor [--base-url <https://api.example.com>] [--json]`);
320
- writeLine(io.stdout, ` ${COMMAND_NAME} discovery show [--base-url <https://api.example.com>] [--json]`);
321
- writeLine(io.stdout, ` ${COMMAND_NAME} setup <codex|cursor|copilot|gemini|antigravity> [--url <https://api.example.com>] [--dry-run] [--no-profile] [--json]`);
322
- writeLine(io.stdout, ` ${COMMAND_NAME} login [--from-stdin] [--base-url <url>] [--timeout-ms <ms>] [--http-timeout-ms <ms>] [--json]`);
323
- writeLine(io.stdout, ` ${COMMAND_NAME} auth status [--verify] [--base-url <url>] [--json]`);
324
- writeLine(io.stdout, ` ${COMMAND_NAME} status [--url <https://api.example.com>] [--json]`);
325
- writeLine(io.stdout, ` ${COMMAND_NAME} token status [--verify]`);
326
- writeLine(io.stdout, ` ${COMMAND_NAME} token add --from-stdin`);
327
- writeLine(io.stdout, ` ${COMMAND_NAME} token set --from-stdin [--allow-plaintext]`);
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:');
328
340
  writeLine(io.stdout, ` ${COMMAND_NAME} mcp list`);
329
- writeLine(io.stdout, ` ${COMMAND_NAME} mcp config --client <codex|cursor|copilot-cli|gemini-cli|antigravity|generic> [--base-url <url>] [--json]`);
330
- writeLine(io.stdout, ` ${COMMAND_NAME} mcp proxy [--port ${DEFAULT_PROXY_PORT}]`);
331
- writeLine(io.stdout, ` ${COMMAND_NAME} mcp profile codex [--json]`);
332
- writeLine(io.stdout, ` ${COMMAND_NAME} profile install <codex|cursor|gemini|antigravity> [--target <path>] [--dry-run|--json]`);
333
- writeLine(io.stdout, ` ${COMMAND_NAME} profile uninstall <codex|cursor|gemini|antigravity> [--target <path>] [--json]`);
334
- writeLine(io.stdout, ` ${COMMAND_NAME} mcp add <${supportedMcpClientIds().join('|')}> [--url <https://api.example.com>] [--write] [--config <path>]`);
335
- writeLine(io.stdout, ` ${COMMAND_NAME} smoke --client codex [--config <path>] [--json]`);
336
- writeLine(io.stdout, ` ${COMMAND_NAME} env example [--shell bash|powershell|cmd] [--json]`);
337
- 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.`);
348
+ 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).`);
338
351
  writeLine(io.stdout, '');
339
- writeLine(io.stdout, `Default service URL: ${DEFAULT_SERVICE_URL}; use --url or XMEMO_URL for private deployments.`);
340
- writeLine(io.stdout, '`login --timeout-ms` controls the full browser approval window; HTTP calls use `--http-timeout-ms`.');
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.`);
341
354
  writeLine(io.stdout, '');
342
- writeLine(io.stdout, 'Privacy defaults: no telemetry, no token in project files, and no token is sent by `status`, `doctor`, or `discovery`.');
343
- writeLine(io.stdout, '`login` and `token add` store credentials only in the user-scoped XMemo CLI config directory.');
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, '======================================================================');
344
361
  }
345
362
 
346
363
  async function updateCommand(args, io) {
@@ -3122,7 +3139,8 @@ async function runProcess(command, args, io, { stream = true } = {}) {
3122
3139
  const spawnFn = io.spawn ?? spawn;
3123
3140
  return await new Promise((resolve, reject) => {
3124
3141
  const child = spawnFn(command, args, {
3125
- stdio: ['ignore', 'pipe', 'pipe']
3142
+ stdio: ['ignore', 'pipe', 'pipe'],
3143
+ shell: os.platform() === 'win32'
3126
3144
  });
3127
3145
  let stdout = '';
3128
3146
  let stderr = '';