Yeachan-Heo/oh-my-codex · error · Error

Missing setup scope value after --scope. Expected one of: ${

Error message

Missing setup scope value after --scope. Expected one of: ${SETUP_SCOPES.join(", ")}

What it means

--scope requires a value (one of SETUP_SCOPES) as the next token. Thrown when --scope is the last argument or the following token looks like another flag.

Source

Thrown at src/cli/index.ts:676

      index += 1;
      continue;
    }
    if (arg.startsWith("--mcp=")) {
      setValue(parseValue(arg.slice("--mcp=".length)), "--mcp");
    }
  }

  return value;
}

export function resolveSetupScopeArg(args: string[]): SetupScope | undefined {
  let value: string | undefined;
  for (let index = 0; index < args.length; index += 1) {
    const arg = args[index];
    if (arg === "--scope") {
      const next = args[index + 1];
      if (!next || next.startsWith("-")) {
        throw new Error(
          `Missing setup scope value after --scope. Expected one of: ${SETUP_SCOPES.join(", ")}`,
        );
      }
      value = next;
      index += 1;
      continue;
    }
    if (arg.startsWith("--scope=")) {
      value = arg.slice("--scope=".length);
    }
  }
  if (!value) return undefined;
  if (SETUP_SCOPES.includes(value as SetupScope)) {
    return value as SetupScope;
  }
  throw new Error(
    `Invalid setup scope: ${value}. Expected one of: ${SETUP_SCOPES.join(", ")}`,
  );

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Append a valid scope, e.g. `--scope project`
  2. Use `--scope=<value>` inline form

Example fix

# before
omx setup --scope
# after
omx setup --scope=project
Defensive patterns

Strategy: validation

Validate before calling

const i = args.indexOf('--scope');
const v = args[i + 1];
if (!v || v.startsWith('-')) throw new Error('missing scope value');

Prevention

When it happens

Trigger: `omx setup --scope` at end, or `--scope --mcp compat`.

Common situations: Missing value in scripted invocations; copy-paste truncation.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/1220e63651e9ffe1. Report an issue: GitHub.