{"record":{"id":"8f046633af219994","repo":"chenhg5/cc-connect","slug":"use-either-app-or-app-id-app-secret-not-bot","errorCode":null,"errorMessage":"use either --app or --app-id/--app-secret, not both","messagePattern":"use either --app or --app-id/--app-secret, not both","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":386,"sourceCode":"Examples:\n  # Recommended: one command for both flows\n  cc-connect feishu setup --project my-project\n  cc-connect feishu setup --project my-project --app cli_xxx:sec_xxx\n\n  # Equivalent to \"setup --app ...\"\n  cc-connect feishu bind --project my-project --app cli_xxx:sec_xxx\n\n  # Use only when you must force QR onboarding\n  cc-connect feishu new --project my-project --platform-type lark`)\n}\n\nfunc resolveFeishuSetupInputs(mode, app, appID, appSecret string) (effectiveMode, resolvedAppID, resolvedAppSecret string, err error) {\n\tapp = strings.TrimSpace(app)\n\tappID = strings.TrimSpace(appID)\n\tappSecret = strings.TrimSpace(appSecret)\n\n\tif app != \"\" && (appID != \"\" || appSecret != \"\") {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"use either --app or --app-id/--app-secret, not both\")\n\t}\n\n\tif app != \"\" {\n\t\tappID, appSecret, err = parseAppPair(app)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", \"\", err\n\t\t}\n\t}\n\n\tif appID != \"\" || appSecret != \"\" {\n\t\tif appID == \"\" || appSecret == \"\" {\n\t\t\treturn \"\", \"\", \"\", fmt.Errorf(\"both --app-id and --app-secret are required\")\n\t\t}\n\t}\n\n\teffectiveMode = mode\n\tif mode == feishuSetupModeAuto {\n\t\tif appID != \"\" && appSecret != \"\" {","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L368-L404","documentation":"resolveFeishuSetupInputs normalizes credentials for `cc-connect feishu setup`. The --app flag takes an id:secret pair while --app-id/--app-secret take the halves individually; the two styles are mutually exclusive. This error is thrown when --app is combined with either half flag, preventing ambiguous duplicate credentials.","triggerScenarios":"`cc-connect feishu setup --app id:secret --app-id id` or `--app id:secret --app-secret secret` (also after whitespace trimming).","commonSituations":"Migrating scripts from one flag style to the other and leaving both behind, or extending an existing command line with a second credential source copied from docs.","solutions":["Use only --app id:secret, or only --app-id X --app-secret Y","Remove the redundant --app flag if you intend to use the split flags","Remove --app-id/--app-secret if you intend to use --app"],"exampleFix":"// before\ncc-connect feishu setup --app id:secret --app-id id --app-secret sec\n// after\ncc-connect feishu setup --app-id id --app-secret sec","handlingStrategy":"validation","validationCode":"if [[ -n \"$APP\" && ( -n \"$APP_ID\" || -n \"$APP_SECRET\" ) ]]; then echo \"use --app or --app-id/--app-secret, not both\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one credential style per script and stick to it","When refactoring flag usage, delete the old flags completely","Document the chosen style in the script header"],"tags":["cli","feishu","flags"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}