{"record":{"id":"dbed325f6c73bfb2","repo":"stablyai/orca","slug":"invalid-argument-dbed32","errorCode":"invalid_argument","errorMessage":"--kind must be git or folder","messagePattern":"--kind must be git or folder","errorType":"exception","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/handlers/project.ts","lineNumber":36,"sourceCode":"  formatProjectHostSetupList,\n  formatProjectHostSetupResult,\n  formatProjectHostSetupUpdateResult,\n  formatProjectList,\n  printResult\n} from '../format'\nimport { getOptionalStringFlag, getRequiredStringFlag } from '../flags'\nimport { resolveRepoPathArgument } from '../repo-path-arguments'\nimport { RuntimeClientError } from '../runtime-client'\n\nfunction getOptionalRepoKind(flags: Map<string, string | boolean>): RepoKind | undefined {\n  const kind = getOptionalStringFlag(flags, 'kind')\n  if (kind === undefined) {\n    return undefined\n  }\n  if (kind === 'git' || kind === 'folder') {\n    return kind\n  }\n  throw new RuntimeClientError('invalid_argument', '--kind must be git or folder')\n}\n\nexport const PROJECT_HANDLERS: Record<string, CommandHandler> = {\n  'project list': async ({ client, json }) => {\n    const result = await client.call<{ projects: Project[] }>('project.list')\n    printResult(result, json, formatProjectList)\n  },\n  'project setups': async ({ flags, client, json }) => {\n    const projectFilter = getOptionalStringFlag(flags, 'project')\n    const hostFilter = getOptionalStringFlag(flags, 'host')\n    const result = await client.call<{ setups: ProjectHostSetup[] }>('projectHostSetup.list')\n    const setups = result.result.setups.filter(\n      (setup) =>\n        (projectFilter === undefined || setup.projectId === projectFilter) &&\n        (hostFilter === undefined || setup.hostId === hostFilter)\n    )\n    printResult({ ...result, result: { setups } }, json, formatProjectHostSetupList)\n  },","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/handlers/project.ts#L18-L54","documentation":"Thrown by getOptionalRepoKind in project.ts (line 36) when --kind is provided with a value other than 'git' or 'folder', the two RepoKind variants (shared/types.ts:93). The flag is optional across project setup-existing-folder, setup-create, and setup-update; when present it must match exactly or the call is rejected before the projectHostSetup RPC.","triggerScenarios":"Calling 'project setup-create --kind <bad> ...' e.g. '--kind svn', '--kind worktree', '--kind Git' (case-sensitive), '--kind repo'. The branch at project.ts:35 fires.","commonSituations":"Assuming 'worktree' is a kind (worktrees are a git setup concern, not a separate kind); case mismatch; copy-pasting a value from a different tool's concept of project type.","solutions":["Use exactly 'git' or 'folder' (lowercase).","Omit --kind to let the runtime infer it from the path/setup method.","For worktree-based setups use '--kind git' with the appropriate worktree flags."],"exampleFix":"// before\norca project setup-create --project p1 --host h1 --kind worktree\n// after\norca project setup-create --project p1 --host h1 --kind git","handlingStrategy":"validation","validationCode":"const KINDS = ['git', 'folder'] as const\nfunction assertRepoKind(v: string | undefined) {\n  if (v !== undefined && !KINDS.includes(v as never)) {\n    throw new Error('--kind must be git or folder')\n  }\n}","typeGuard":"function isRepoKind(v: unknown): v is 'git' | 'folder' {\n  return v === 'git' || v === 'folder'\n}","tryCatchPattern":"try {\n  await runProjectSetup(args)\n} catch (err) {\n  if (err instanceof RuntimeClientError && /kind must be/i.test(err.message)) {\n    // use 'git' or 'folder', or omit --kind to infer, then retry\n  } else { throw err }\n}","preventionTips":["Use '--kind git' for worktree-based setups (worktree is not a kind).","Omit --kind to let the runtime infer from the path.","Lowercase and trim the value before passing."],"tags":["cli","validation","project","enum","argument-validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}