{"record":{"id":"feb7f0ad027250da","repo":"affaan-m/ECC","slug":"unsupported-nasiko-command-command","errorCode":null,"errorMessage":"Unsupported Nasiko command: ${command}","messagePattern":"Unsupported Nasiko command: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/nasiko.js","lineNumber":134,"sourceCode":"    return 0;\n  }\n  if (command === 'install') {\n    const options = parseMutationArguments(rest, 'install');\n    const result = await installNasiko(options);\n    if (options.json) process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n    else if (result.dryRun) process.stdout.write(`Would install Nasiko ${result.version} to ${result.destination}.\\n`);\n    else process.stdout.write(`${result.reused ? 'Using existing' : 'Installed'} Nasiko ${result.version} at ${result.destination}.\\n`);\n    return 0;\n  }\n  if (command === 'uninstall') {\n    const options = parseMutationArguments(rest, 'uninstall');\n    const result = uninstallNasiko(options);\n    if (options.json) process.stdout.write(`${JSON.stringify(result, null, 2)}\\n`);\n    else if (result.dryRun) process.stdout.write(`Would uninstall Nasiko ${result.version} from ${result.destination}.\\n`);\n    else process.stdout.write(result.removed ? `Uninstalled Nasiko ${result.version}.\\n` : 'Nasiko was not installed.\\n');\n    return 0;\n  }\n  throw new Error(`Unsupported Nasiko command: ${command}`);\n}\n\nif (require.main === module) {\n  main().then(code => {\n    process.exitCode = code;\n  }).catch(error => {\n    process.stderr.write(`Error: ${String(error?.message || error).replace(/[\\r\\n]+/g, ' ')}\\n`);\n    process.exitCode = 1;\n  });\n}\n\nmodule.exports = { main, parseInstallArguments: parseMutationArguments, parseMutationArguments, parseStatusArguments, readStatus, resolveExecutable };\n","sourceCodeStart":116,"sourceCodeEnd":147,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/nasiko.js#L116-L147","documentation":"main dispatches on the first CLI argument and supports a fixed set of Nasiko commands (install/status/uninstall). If the command token does not match any handler, it throws this error. It is the top-level command router's strict-validation guard.","triggerScenarios":"Running the script with a typo'd, missing-as-empty, or entirely unsupported first token such as `node scripts/nasiko.js upgrade` or `node scripts/nasiko.js --help`; also invoking with argv slice producing undefined command.","commonSituations":"Guessing subcommand names (upgrade/reinstall/remove) that don't exist; old scripts using a renamed command; invoking the file with no arguments so command is undefined.","solutions":["Use one of the supported commands: install, status, or uninstall.","Fix typos in the command name.","Consult the script's usage/help text for the exact command list.","If you need a new command, add a dispatch branch in main in scripts/nasiko.js."],"exampleFix":"// before\nnode scripts/nasiko.js remove --version v0.1.0\n// after\nnode scripts/nasiko.js uninstall --version v0.1.0","handlingStrategy":"validation","validationCode":"const COMMANDS = new Set(['install','status','uninstall']);\nconst cmd = process.argv[2];\nif (!COMMANDS.has(cmd)) throw new Error(`Unsupported command \"${cmd}\"; use install, status, or uninstall`);","typeGuard":"const isNasikoCommand = (c) => typeof c === 'string' && ['install','status','uninstall'].includes(c);","tryCatchPattern":"try {\n  await main(argv);\n} catch (err) {\n  if (err.message.startsWith('Unsupported Nasiko command')) {\n    console.error('Valid commands: install, status, uninstall.');\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["Verify the subcommand name against the script's usage text before running.","Wrap nasiko invocations in a helper script that validates the command.","Watch for renamed/removed commands in script updates.","Never invoke the script with zero arguments."],"tags":["cli","unsupported-command","dispatch"],"backgroundTag":"unsupported-operation","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}