{"record":{"id":"5d2bb65b8edc1b3b","repo":"paperclipai/paperclip","slug":"no-company-found-by-shortname-prefix-selector","errorCode":null,"errorMessage":"No company found by shortname/prefix '${selector}'.","messagePattern":"No company found by shortname/prefix '(.+?)'\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1294,"sourceCode":"): Company {\n  const selector = normalizeSelector(selectorRaw);\n  if (!selector) {\n    throw new Error(\"Company selector is required.\");\n  }\n\n  const idMatch = companies.find((company) => company.id === selector);\n  const prefixMatch = companies.find((company) => matchesPrefix(company, selector));\n\n  if (by === \"id\") {\n    if (!idMatch) {\n      throw new Error(`No company found by ID '${selector}'.`);\n    }\n    return idMatch;\n  }\n\n  if (by === \"prefix\") {\n    if (!prefixMatch) {\n      throw new Error(`No company found by shortname/prefix '${selector}'.`);\n    }\n    return prefixMatch;\n  }\n\n  if (idMatch && prefixMatch && idMatch.id !== prefixMatch.id) {\n    throw new Error(\n      `Selector '${selector}' is ambiguous (matches both an ID and a shortname). Re-run with --by id or --by prefix.`,\n    );\n  }\n\n  if (idMatch) return idMatch;\n  if (prefixMatch) return prefixMatch;\n\n  throw new Error(\n    `No company found for selector '${selector}'. Use company ID or issue prefix (for example PAP).`,\n  );\n}\n","sourceCodeStart":1276,"sourceCodeEnd":1312,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/company.ts#L1276-L1312","documentation":"Thrown by resolveCompanyForDeletion when by==='prefix' (or auto resolves to prefix) and no company matches the selector by issue prefix. Prefix matching is case-insensitive exact equality against company.issuePrefix.","triggerScenarios":"Passing --by prefix with a selector that is not any company's issue prefix. A typo in the prefix (e.g. 'PPA' instead of 'PAP'). A prefix from a company in a different list/tenant than the one supplied.","commonSituations":"User misremembers the 3-letter prefix. The prefix was renamed. Wrong tenant's company list supplied to the resolver. Trailing whitespace or hyphenation differences.","solutions":["Run 'paperclipai company list' and read the exact issue prefix column.","If you actually have the id, use '--by id' instead.","Drop --by to let auto-resolution attempt both id and prefix.","Double-check capitalization is irrelevant (match is case-insensitive) but spelling matters."],"exampleFix":"# before\npaperclipai company delete PPA --by prefix --yes --confirm PPA\n# after\ngrep -i prefix <(paperclipai company list)  # confirm exact prefix\npaperclipai company delete PAP --by prefix --yes --confirm PAP","handlingStrategy":"validation","validationCode":"function ensureCompanyByPrefix(companies: { issuePrefix: string }[], selector: string): void {\n  const upper = selector.toUpperCase();\n  if (!companies.some((c) => c.issuePrefix.toUpperCase() === upper)) {\n    throw new Error(`No company with prefix '${selector}'. Run 'company list'.`);\n  }\n}","typeGuard":"function companyPrefixExists(companies: { issuePrefix: string }[], selector: string): boolean {\n  const upper = selector.toUpperCase();\n  return companies.some((c) => c.issuePrefix.toUpperCase() === upper);\n}","tryCatchPattern":null,"preventionTips":["Read prefixes from 'company list' rather than memory.","Remember prefix match is case-insensitive but spelling must be exact.","Switch to '--by id' when prefix lookups repeatedly miss."],"tags":["cli","validation","company-delete","lookup"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}