affaan-m/ECC · error · Error

Missing value for --write

Error message

Missing value for --write

What it means

Thrown by scripts/status.js when --write appears in argv but no file path follows it. The parser stores `args[index + 1] || null` into writePath, and the post-parse guard `args.includes('--write') && !parsed.writePath` rejects a null path. --write is meant to persist the chosen output format (JSON or Markdown) to disk, so a missing target path makes the operation meaningless.

Source

Thrown at scripts/status.js:67

      parsed.limit = args[index + 1] || null;
      index += 1;
    } else if (arg === '--help' || arg === '-h') {
      parsed.help = true;
    } else {
      throw new Error(`Unknown argument: ${arg}`);
    }
  }

  if (parsed.json && parsed.markdown) {
    throw new Error('Choose only one output format: --json or --markdown');
  }

  if (args.includes('--db') && !parsed.dbPath) {
    throw new Error('Missing value for --db');
  }

  if (args.includes('--write') && !parsed.writePath) {
    throw new Error('Missing value for --write');
  }

  if (args.includes('--limit') && !parsed.limit) {
    throw new Error('Missing value for --limit');
  }

  return parsed;
}

function printActiveSessions(section) {
  console.log(`Active sessions: ${section.activeCount}`);
  if (section.sessions.length === 0) {
    console.log('  - none');
    return;
  }

  for (const session of section.sessions) {
    console.log(`  - ${session.id} [${session.harness}/${session.adapterId}] ${session.state}`);

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Provide a destination path: `node scripts/status.js --json --write /tmp/ecc-status.json`.
  2. Ensure you also pass --json or --markdown, since --write alone triggers a separate error (error 465).
  3. Verify the path variable in your wrapper script is non-empty before appending the flag.

Example fix

// before
node scripts/status.js --json --write

// after
node scripts/status.js --json --write /tmp/ecc-status.json
Defensive patterns

Strategy: validation

Validate before calling

// Only set --write when both a path and a format are chosen
const outFile = process.env.ECC_STATUS_OUT;
const args = ['--json'];
if (outFile) {
  args.push('--write', outFile);
}

Prevention

When it happens

Trigger: `node scripts/status.js --json --write` (no path after --write); a wrapper that appends `--write $OUTFILE` where $OUTFILE is unset.

Common situations: An output-path environment variable that is not exported or is empty; editing a command and deleting the path but not the flag; a CI template that conditionally includes --write but leaves the path blank in one branch.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/9a2f2cd4b32e4426. Report an issue: GitHub.