{"record":{"id":"efd05e47e713a0fc","repo":"pnpm/pnpm","slug":"config-no-subcommand","errorCode":"CONFIG_NO_SUBCOMMAND","errorMessage":"Please specify the subcommand","messagePattern":"Please specify the subcommand","errorType":"exception","errorClass":"PnpmError","httpStatus":null,"severity":"error","filePath":"pnpm11/config/commands/src/config.ts","lineNumber":83,"sourceCode":"        ],\n      },\n    ],\n    url: docsUrl('config'),\n    usages: [\n      'pnpm config set <key> <value>',\n      'pnpm config get <key>',\n      'pnpm config get --json <key>',\n      'pnpm config delete <key>',\n      'pnpm config list',\n    ],\n  })\n}\n\nexport type ConfigHandlerResult = string | undefined | { output: string, exitCode: number }\n\nexport async function handler (opts: ConfigCommandOptions, params: string[]): Promise<ConfigHandlerResult> {\n  if (params.length === 0) {\n    throw new PnpmError('CONFIG_NO_SUBCOMMAND', 'Please specify the subcommand', {\n      hint: help(),\n    })\n  }\n  if (opts.location) {\n    opts.global = opts.location === 'global'\n  } else if (opts.cliOptions['global'] == null) {\n    opts.global = true\n  }\n  switch (params[0]) {\n    case 'set':\n    case 'delete': {\n      if (!params[1]) {\n        throw new PnpmError('CONFIG_NO_PARAMS', `\\`pnpm config ${params[0]}\\` requires the config key`)\n      }\n      if (params[0] === 'set') {\n        let [key, value] = params.slice(1)\n        if (value == null) {\n          const parts = key.split('=')","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/pnpm/pnpm/blob/5b11d3a15b9022a2109cb18ed96a5d652630371f/pnpm11/config/commands/src/config.ts#L65-L101","documentation":"Usage error for the `pnpm config` command: invoked with zero parameters, so there is no subcommand to dispatch. `pnpm config` is a strictly subcommand-based verb (set, get, delete, list), and the error's hint embeds the help text showing the supported forms.","triggerScenarios":"`pnpm config` bare, or through a wrapper that failed to append the subcommand (empty variable). The check is `params.length === 0` before any location/global resolution happens.","commonSituations":"Users expecting `pnpm config` alone to list settings (npm-like muscle memory varies); shell functions like `pnpm config \"$CMD\"` with CMD unset.","solutions":["Use a subcommand: `pnpm config list` is the no-argument way to inspect settings","Guard script variables: `pnpm config \"${CMD:?}\"`"],"exampleFix":"# before\npnpm config\n# after\npnpm config list","handlingStrategy":"validation","validationCode":"const subcommands = new Set(['set', 'get', 'delete', 'list'])\nif (params.length === 0 || !subcommands.has(params[0])) {\n  console.error('usage: pnpm config <set|get|delete|list> [args]')\n  process.exit(1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default wrappers to a concrete subcommand (e.g. `pnpm config list`)","Assert variables: `pnpm config \"${CMD:?}\"`"],"tags":["cli","config","usage","user-input"],"backgroundTag":null,"analyzedSha":"5b11d3a15b9022a2109cb18ed96a5d652630371f","analyzedAt":"2026-08-16T13:18:59.198Z","schemaVersion":2},"datasetVersion":"2026-08-16T18:17:16.020Z"}