@mindmux/cli 0.1.3 → 0.1.4

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/bin/mmx.mjs CHANGED
@@ -3,7 +3,7 @@ import { notifyUpdate } from '../src/update.mjs';
3
3
  import { main } from '../src/cli.mjs';
4
4
  await notifyUpdate();
5
5
  await main().catch(error => {
6
- if (process.argv.includes('--non-interactive')) console.log(JSON.stringify({ status: 'error', installed: false, error: error.message }));
6
+ if (process.argv.some(arg => ['--non-interactive', '-agent'].includes(arg))) console.log(JSON.stringify({ status: 'error', installed: false, error: error.message }));
7
7
  else console.error(`mmx: ${error.message}`);
8
8
  process.exitCode = 1;
9
9
  });
@@ -17,11 +17,11 @@ Instructions for an agent installing MindMux in the user's current project. The
17
17
  Run commands in the intended project (or provide an explicit `--project PATH`). Start with:
18
18
 
19
19
  ```sh
20
- mmx setup --agent codex --non-interactive --json
20
+ mmx setup -agent --agent codex
21
21
  # For Claude Code, use --agent claude-code instead.
22
22
  ```
23
23
 
24
- `--non-interactive` implies JSON output and never opens a terminal menu. Inspect `status` and `step` after every invocation. Input-required responses exit zero and always report `installed: false`; they are not success. Errors exit nonzero with `status: "error"`. Preserve the selected agent/server/project flags across retries. Pass IDs as separate, properly quoted process arguments; never build executable shell text from returned names or URLs.
24
+ `-agent` is shorthand for `--non-interactive --json` and never opens a terminal menu. It is distinct from `--agent NAME`, which selects the host integration. Plain `mmx setup` retains its interactive wizard. The long form remains supported. Inspect `status` and `step` after every invocation. Input-required responses exit zero and always report `installed: false`; they are not success. Errors exit nonzero with `status: "error"`. Preserve the selected agent/server/project flags across retries. Pass IDs as separate, properly quoted process arguments; never build executable shell text from returned names or URLs.
25
25
 
26
26
  | Response | Next action |
27
27
  | --- | --- |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindmux/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Brain operations and lifecycle integrations for coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.mjs CHANGED
@@ -16,7 +16,7 @@ Setup:
16
16
  mmx setup [--agent claude-code,codex] login, choose Brain, install MCP + rules/hooks
17
17
  mmx setup --local --agent codex --yes local Brain without Cloud login
18
18
  mmx setup --json return detailed setup results as JSON
19
- mmx setup --non-interactive --json resumable Agent setup; returns required input or ready
19
+ mmx setup -agent resumable Agent setup (alias: --non-interactive --json)
20
20
  mmx login --non-interactive --json start/reuse background browser authorization
21
21
  mmx login --status check --non-interactive --json inspect background authorization
22
22
  mmx update [--check] [--yes] [--json] check for releases or upgrade this global installation
@@ -84,7 +84,16 @@ function cloudVersion(value) {
84
84
  export async function main(argv = process.argv.slice(2)) {
85
85
  const options = Object.fromEntries(['project', 'agent', 'brain-id', 'server', 'workspace-id', 'name', 'description', 'id', 'title', 'category', 'status', 'source', 'expected-version', 'change-kind', 'summary', 'kind', 'args', 'review-token', 'outcome', 'reason', 'manager'].map(key => [key, { type: 'string' }]));
86
86
  for (const key of ['local', 'online', 'no-open', 'confirm', 'help', 'version', 'yes', 'migrate', 'json', 'keep-login', 'include-external-data', 'fix', 'check', 'refresh-integrations', 'non-interactive']) options[key] = { type: 'boolean' };
87
- const { values: flags, positionals: pos } = parseArgs({ args: argv, options, allowPositionals: true, strict: true });
87
+ // -agent is an exact single-dash alias, distinct from --agent NAME.
88
+ // Do not rewrite option values or positional content after --.
89
+ const args = [];
90
+ for (let i = 0; i < argv.length; i++) {
91
+ const arg = argv[i];
92
+ if (arg === '--') { args.push(...argv.slice(i)); break; }
93
+ args.push(arg === '-agent' ? '--non-interactive' : arg);
94
+ if (arg.startsWith('--') && options[arg.slice(2)]?.type === 'string' && i + 1 < argv.length) args.push(argv[++i]);
95
+ }
96
+ const { values: flags, positionals: pos } = parseArgs({ args, options, allowPositionals: true, strict: true });
88
97
  if (flags['non-interactive']) flags.json = true;
89
98
  if (flags.version) { console.log(VERSION); return; }
90
99
  if (flags.help || pos[0] === 'help' || (!pos.length && (!process.stdin.isTTY || !process.stderr.isTTY || flags.json || flags.yes))) { console.log(HELP); return; }
package/src/update.mjs CHANGED
@@ -65,7 +65,7 @@ export async function checkUpdate({ current = VERSION, fetcher = fetch, now = Da
65
65
  }
66
66
 
67
67
  export async function notifyUpdate({ argv = process.argv.slice(2), stdin = process.stdin, stderr = process.stderr, env = process.env, check = checkUpdate } = {}) {
68
- if (!stdin.isTTY || !stderr.isTTY || env.CI || env.NO_UPDATE_NOTIFIER || env.MINDMUX_NO_UPDATE_CHECK || argv.some(arg => ['--json', '--help', '--version', '--yes', '--non-interactive'].includes(arg))) return;
68
+ if (!stdin.isTTY || !stderr.isTTY || env.CI || env.NO_UPDATE_NOTIFIER || env.MINDMUX_NO_UPDATE_CHECK || argv.some(arg => ['--json', '--help', '--version', '--yes', '--non-interactive', '-agent'].includes(arg))) return;
69
69
  // Only these exact human-facing commands may contact the registry or print notices.
70
70
  const commands = [...argv];
71
71
  while (commands[0] === '--project' || commands[0]?.startsWith('--project=')) {