{"record":{"id":"449596056875aef7","repo":"chenhg5/cc-connect","slug":"multiple-projects-found-please-specify-project","errorCode":null,"errorMessage":"multiple projects found, please specify --project (%s)","messagePattern":"multiple projects found, please specify --project \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":449,"sourceCode":"}\n\nfunc resolveTargetProject(project string) (string, error) {\n\tproject = strings.TrimSpace(project)\n\tif project != \"\" {\n\t\treturn project, nil\n\t}\n\tprojects, err := config.ListProjects()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tswitch len(projects) {\n\tcase 0:\n\t\treturn \"\", fmt.Errorf(\"no project found in config\")\n\tcase 1:\n\t\treturn projects[0], nil\n\tdefault:\n\t\tsort.Strings(projects)\n\t\treturn \"\", fmt.Errorf(\"multiple projects found, please specify --project (%s)\", strings.Join(projects, \", \"))\n\t}\n}\n\nfunc normalizeFeishuPlatformType(raw string) (string, error) {\n\traw = strings.ToLower(strings.TrimSpace(raw))\n\tif raw == \"\" {\n\t\treturn \"\", nil\n\t}\n\tif raw != \"feishu\" && raw != \"lark\" {\n\t\treturn \"\", fmt.Errorf(\"invalid --platform-type %q, want feishu or lark\", raw)\n\t}\n\treturn raw, nil\n}\n\nfunc validateAppCredentials(appID, appSecret, platformType string) (string, error) {\n\tappID = strings.TrimSpace(appID)\n\tappSecret = strings.TrimSpace(appSecret)\n\tif appID == \"\" || appSecret == \"\" {","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L431-L467","documentation":"A sentinel from resolveTargetProject: no --project flag was given, and the config contains more than one project, so the target is ambiguous. The message lists the sorted project names to choose from; the caller (e.g. feishu setup) aborts.","triggerScenarios":"Running feishu/weixin/yuanbao setup with two or more [[projects]] entries in config.toml and no --project flag.","commonSituations":"Multi-repo users who configured several projects and then run setup for a new platform without naming the target project.","solutions":["Re-run with --project <name>, choosing one of the names listed in the error message.","If only one project is actually relevant, remove the other [[projects]] entries from config.toml.","Verify exact project name spelling; the list in the error is authoritative (sorted, joined with \", \")."],"exampleFix":"// before\ncc-connect feishu setup --app cli_x:sec\n// after\ncc-connect feishu setup --app cli_x:sec --project myproj","handlingStrategy":"validation","validationCode":"projects, _ := config.ListProjects(); if len(projects) > 1 && project == \"\" { return fmt.Errorf(\"--project required; candidates: %s\", strings.Join(projects, \", \")) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In multi-project configs, always pass --project explicitly to setup commands.","Use the exact project name from the error's candidate list (sorted, comma-joined).","Prune stale [[projects]] entries so unqualified commands stay unambiguous."],"tags":["cli","config","setup","ambiguity"],"backgroundTag":"missing-required-flag","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}