{"record":{"id":"c35195f1714f17fc","repo":"remix-run/remix","slug":"unknown-command-assets-command","errorCode":null,"errorMessage":"Unknown command: assets ${command}","messagePattern":"Unknown command: assets (.+?)","errorType":"exception","errorClass":"UsageError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/lib/commands/assets.ts","lineNumber":75,"sourceCode":"      examples: [\n        'remix assets',\n        'remix assets inspect /assets/app/actions/public/entry.ts',\n        'remix assets inspect app/actions/public/entry.ts',\n      ],\n      usage: ['remix assets', 'remix assets inspect <url-or-file>'],\n    },\n    target,\n  )\n}\n\ntype AssetsCommandInvocation = { command: 'list' } | { command: 'inspect'; input: string }\n\nfunction parseAssetsCommandArgs(argv: string[]): AssetsCommandInvocation {\n  let parsed = parseArgs(argv, {}, { maxPositionals: 2 })\n  let [command, input] = parsed.positionals\n\n  if (command === undefined) return { command: 'list' }\n  if (command !== 'inspect') throw unknownCommand(`assets ${command}`)\n  if (input === undefined) {\n    throw invalidOptionValue('`remix assets inspect` requires a URL or file path.')\n  }\n  return { command, input }\n}\n\nfunction formatAssetList(assets: readonly AssetDetails[], rootDir: string): string {\n  if (assets.length === 0) return 'No assets.\\n'\n  return `${assets\n    .map((asset) => `${asset.url} -> ${formatFilePath(asset.filePath, rootDir)}`)\n    .join('\\n')}\\n`\n}\n\nfunction formatAssetDetails(details: AssetDetails, rootDir: string): string {\n  let lines = [`Status: ${details.status}`]\n  if (details.url !== undefined) lines.push(`URL: ${details.url}`)\n  if (details.filePath !== undefined) {\n    lines.push(`File: ${formatFilePath(details.filePath, rootDir)}`)","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/cli/src/lib/commands/assets.ts#L57-L93","documentation":"The assets subcommand only accepts 'list' (default) and 'inspect'; any other positional command word is rejected as unknown before execution.","triggerScenarios":"parseAssetsCommandArgs finds a first positional that is not undefined and not 'inspect', e.g. remix assets build, remix assets sync, or a typo like remix assets inspeect.","commonSituations":"Assuming the assets command mirrors other subcommands (build/sync); tab-completion or muscle-memory typos; older/newer CLI versions with different subcommand sets.","solutions":["Use remix assets list or remix assets inspect <url-or-path>","Check remix assets --help for the supported subcommands in your CLI version","Update the CLI if following current docs that document a subcommand your version lacks"],"exampleFix":"# before\n$ remix assets sync\n\n# after\n$ remix assets list","handlingStrategy":"type-guard","validationCode":"const ASSETS_COMMANDS = new Set(['list', 'inspect'])\n\nfunction isKnownAssetsCommand(cmd?: string): boolean {\n  return cmd === undefined || ASSETS_COMMANDS.has(cmd!)\n}","typeGuard":"function isAssetsCommand(cmd: string): cmd is 'list' | 'inspect' {\n  return cmd === 'list' || cmd === 'inspect'\n}","tryCatchPattern":"try {\n  runAssetsCommand(argv, context)\n} catch (error) {\n  if (/Unknown command: assets/.test(error.message)) printAssetsHelp()\n  else throw error\n}","preventionTips":["Check remix assets --help when unsure of subcommands","Wrap CLI calls in scripts that validate the subcommand against a whitelist","Keep CLI version aligned with the docs you follow"],"tags":["cli","assets","arguments"],"backgroundTag":"unknown-cli-subcommand","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}