affaan-m/ECC · warning · Error

${command} does not accept positional arguments.

Error message

${command} does not accept positional arguments.

What it means

requireNoPositionals throws `${command} does not accept positional arguments.` when a command that takes only flags receives bare tokens. It is applied to the init, save, handoff, and doctor commands. By contrast search and read DO take positionals (the query / the memory id), so this fires only on the no-positional commands.

Source

Thrown at scripts/memory.js:135

        skipNext: true,
      };
    }
    if (argument.startsWith('-')) {
      throw new Error(`Unknown option: ${argument}`);
    }
    return { ...state, positionals: [...state.positionals, argument] };
  }, { options: {}, positionals: [], skipNext: false });

  return {
    command,
    options: parsed.options,
    positionals: parsed.positionals,
  };
}

function requireNoPositionals(positionals, command) {
  if (positionals.length > 0) {
    throw new Error(`${command} does not accept positional arguments.`);
  }
}

function oneValue(values, label, fallback = null) {
  if (!values || values.length === 0) return fallback;
  if (values.length > 1) {
    throw new Error(`${label} may be provided only once.`);
  }
  return values[0];
}

function waitForStdinRetry(milliseconds) {
  Atomics.wait(STDIN_RETRY_SIGNAL, 0, 0, milliseconds);
}

function readBoundedStdin(maxBytes, retryOptions = {}) {
  const retryDelayMs = Number.isInteger(retryOptions.retryDelayMs)
    && retryOptions.retryDelayMs > 0

View on GitHub (pinned to 01e15490f0)

Solutions

  1. For init/doctor, pass scope as a flag: `--scope project`.
  2. For save/handoff, supply the body via `--stdin` or `--body-file <path>` and the title via `--title`.
  3. Remove any stray positional tokens from the command line.
  4. Use `ecc memory search <query>` or `ecc memory read <id>` when you actually have a positional.

Example fix

# before
ecc memory save release-notes.md

# after
ecc memory save --title "Release notes" --body-file release-notes.md
Defensive patterns

Strategy: validation

Validate before calling

const NO_POSITIONAL = new Set(['init','save','handoff','doctor']);
function validatePositionals(command, positionals) {
  if (NO_POSITIONAL.has(command) && positionals.length > 0) {
    throw new Error(`${command} does not accept positional arguments.`);
  }
}

Try / catch

try { runCommand(parsed); }
catch (err) { if (/does not accept positional arguments\./.test(err.message)) { usage(2); } else throw err; }

Prevention

When it happens

Trigger: Running `ecc memory init project` (init takes no positionals — scope is a flag). Running `ecc memory save my-note.md` (save takes --body-file, not a positional). Running `ecc memory doctor project`. A trailing filename left after removing a flag during editing.

Common situations: Assuming positional shortcuts where the CLI only has flags. Copying a pattern from `memory read <id>` into `memory save <file>`.

Related errors


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