{"record":{"id":"1fa733da06a04e0b","repo":"chenhg5/cc-connect","slug":"new-mode-does-not-accept-credentials-use-cc-conn","errorCode":null,"errorMessage":"new mode does not accept credentials; use `cc-connect feishu bind`","messagePattern":"new mode does not accept credentials; use `cc-connect feishu bind`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":414,"sourceCode":"\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 != \"\" {\n\t\t\teffectiveMode = feishuSetupModeBind\n\t\t} else {\n\t\t\teffectiveMode = feishuSetupModeNew\n\t\t}\n\t}\n\tif mode == feishuSetupModeBind && (appID == \"\" || appSecret == \"\") {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"bind mode requires credentials: use --app id:secret or --app-id/--app-secret\")\n\t}\n\tif mode == feishuSetupModeNew && (appID != \"\" || appSecret != \"\") {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"new mode does not accept credentials; use `cc-connect feishu bind`\")\n\t}\n\n\treturn effectiveMode, appID, appSecret, nil\n}\n\nfunc parseAppPair(raw string) (appID, appSecret string, err error) {\n\tidx := strings.Index(raw, \":\")\n\tif idx <= 0 || idx >= len(raw)-1 {\n\t\treturn \"\", \"\", fmt.Errorf(\"--app format must be app_id:app_secret\")\n\t}\n\tappID = strings.TrimSpace(raw[:idx])\n\tappSecret = strings.TrimSpace(raw[idx+1:])\n\tif appID == \"\" || appSecret == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"--app format must be app_id:app_secret\")\n\t}\n\treturn appID, appSecret, nil\n}\n","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L396-L432","documentation":"New mode creates a brand-new Feishu app, so pre-existing credentials are meaningless and rejected. resolveFeishuSetupInputs throws this error when `--mode new` is combined with --app or --app-id/--app-secret, directing the user to the bind subcommand instead.","triggerScenarios":"`cc-connect feishu setup --mode new --app id:secret` or `--mode new --app-id X --app-secret Y`.","commonSituations":"See trigger scenarios.","solutions":["Drop the credential flags when using --mode new","Use `cc-connect feishu setup --mode bind --app id:secret` (or the bind subcommand) if you want to reuse the existing app","Remove credential interpolation from the script invocation when mode is new"],"exampleFix":"// before\ncc-connect feishu setup --mode new --app-id id --app-secret sec\n// after\ncc-connect feishu setup --mode bind --app-id id --app-secret sec","handlingStrategy":"validation","validationCode":"if [[ \"$MODE\" == new && ( -n \"$APP\" || -n \"$APP_ID\" || -n \"$APP_SECRET\" ) ]]; then echo \"new mode takes no credentials\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only inject credentials in bind mode","Parameterize scripts so credentials are conditional on mode","Choose bind explicitly when reusing an app"],"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"}