{"record":{"id":"97ea655da87dd787","repo":"paperclipai/paperclip","slug":"no-company-found-for-selector-selector-use-c","errorCode":null,"errorMessage":"No company found for selector '${selector}'. Use company ID or issue prefix (for example PAP).","messagePattern":"No company found for selector '(.+?)'\\. Use company ID or issue prefix \\(for example PAP\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1308,"sourceCode":"  }\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\nexport function assertDeleteConfirmation(company: Company, opts: CompanyDeleteOptions): void {\n  if (!opts.yes) {\n    throw new Error(\"Deletion requires --yes.\");\n  }\n\n  const confirm = opts.confirm?.trim();\n  if (!confirm) {\n    throw new Error(\n      \"Deletion requires --confirm <value> where value matches the company ID or issue prefix.\",\n    );\n  }\n\n  const confirmsById = confirm === company.id;\n  const confirmsByPrefix = confirm.toUpperCase() === company.issuePrefix.toUpperCase();","sourceCodeStart":1290,"sourceCodeEnd":1326,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/company.ts#L1290-L1326","documentation":"Thrown by resolveCompanyForDeletion in auto mode when the selector matches neither any company id nor any issue prefix. This is the catch-all 'no match' fallback after id and prefix lookups both return empty and there is no ambiguity.","triggerScenarios":"Passing a selector that is neither an existing id nor an existing prefix. A selector for a company that has been deleted. A selector from the wrong tenant/list. Pure typo.","commonSituations":"Stale id copied from an old note. Company deleted by another operator. Wrong API base/tenant. Selector includes stray characters or whitespace inside (not at the ends).","solutions":["Run 'paperclipai company list' to see current ids and prefixes.","Confirm you are pointed at the right API base / tenant for the company you expect.","Copy the id or prefix verbatim from the list output and re-run.","If the company was deleted, choose a different target or restore it first."],"exampleFix":"# before\npaperclipai company delete xyz --yes --confirm xyz\n# after\npaperclipai company list   # confirm valid selector\npaperclipai company delete cmp_real --yes --confirm cmp_real","handlingStrategy":"validation","validationCode":"function ensureCompanySelectable(companies: { id: string; issuePrefix: string }[], selector: string): void {\n  const hit = companies.find(\n    (c) => c.id === selector || c.issuePrefix.toUpperCase() === selector.toUpperCase(),\n  );\n  if (!hit) throw new Error(`No company matches '${selector}'. Verify id/prefix or tenant.`);\n}","typeGuard":"function companySelectorMatches(companies: { id: string; issuePrefix: string }[], selector: string): boolean {\n  return companies.some(\n    (c) => c.id === selector || c.issuePrefix.toUpperCase() === selector.toUpperCase(),\n  );\n}","tryCatchPattern":null,"preventionTips":["Refresh the company list before deletion to catch deletions/renames.","Confirm the API base/tenant matches where the company lives.","Copy the selector from current list output, not historical notes."],"tags":["cli","validation","company-delete","lookup","not-found"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}