{"record":{"id":"d204744a85ade73f","repo":"remix-run/remix","slug":"rmx-unexpected-argument","errorCode":"RMX_UNEXPECTED_ARGUMENT","errorMessage":"Unexpected extra argument","messagePattern":"Unexpected extra argument","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/errors.ts","lineNumber":142,"sourceCode":"    title: 'Could not resolve a route owner plan',\n  },\n  routesFileNotFound: {\n    code: 'RMX_ROUTES_FILE_NOT_FOUND',\n    title: 'Could not find app/routes.ts',\n    fix: 'Run this command inside a Remix app that has app/routes.ts.',\n  },\n  targetDirectoryNotEmpty: {\n    code: 'RMX_TARGET_DIRECTORY_NOT_EMPTY',\n    title: 'Target directory is not empty',\n    fix: 'Re-run with --force to continue.',\n  },\n  targetPathNotDirectory: {\n    code: 'RMX_TARGET_PATH_NOT_DIRECTORY',\n    title: 'Target path is not a directory',\n    fix: 'Choose a directory path for the new app target.',\n  },\n  unexpectedExtraArgument: {\n    code: 'RMX_UNEXPECTED_ARGUMENT',\n    title: 'Unexpected extra argument',\n    fix: 'Remove the extra argument or run the command with --help.',\n  },\n  unknownArgument: {\n    code: 'RMX_UNKNOWN_ARGUMENT',\n    title: 'Unknown argument',\n    fix: 'Run the command with --help to see supported arguments.',\n  },\n  unknownCommand: {\n    code: 'RMX_UNKNOWN_COMMAND',\n    title: 'Unknown command',\n    fix: 'Run `remix help` to see available commands.',\n  },\n  unknownCompletionShell: {\n    code: 'RMX_UNKNOWN_COMPLETION_SHELL',\n    title: 'Unknown completion shell',\n    fix: 'Run `remix completion bash` or `remix completion zsh`.',\n  },","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/errors.ts#L124-L160","documentation":"The command received more positional arguments than it accepts. Argument parsing rejects extras rather than silently ignoring them, and the fix hint points to --help for the expected signature.","triggerScenarios":"Passing two operands to a command taking one (e.g. `remix init a b`), or trailing shell-expanded values unintentionally becoming extra arguments.","commonSituations":"Unquoted globs expanding into multiple arguments, copy-pasting a command from docs with placeholder text left in, or assuming a command takes multiple targets.","solutions":["Remove the extra argument so only the accepted count remains.","Run the command with --help to see the expected positional signature.","Quote globs/variables (`\"$DIR\"`) so they don't expand into extra arguments."],"exampleFix":"# before\nremix init my-app extra\n\n# after\nremix init my-app","handlingStrategy":"validation","validationCode":"// Validate argument count before invoking\nlet positional = args.filter((a) => !a.startsWith('-'))\nif (positional.length > 1) {\n  // reject before calling the CLI\n}","typeGuard":null,"tryCatchPattern":"try {\n  run(args)\n} catch (error) {\n  if (error.code === 'RMX_UNEXPECTED_ARGUMENT') {\n    // drop extras, print --help\n  }\n}","preventionTips":["Quote shell variables and globs.","Consult --help before scripting commands."],"tags":["cli","arguments","usage"],"backgroundTag":"invalid-command-arguments","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}