{"record":{"id":"b7d10ccb8d24ed2b","repo":"chenhg5/cc-connect","slug":"bind-mode-requires-credentials-use-app-id-secre","errorCode":null,"errorMessage":"bind mode requires credentials: use --app id:secret or --app-id/--app-secret","messagePattern":"bind mode requires credentials: use --app id:secret or --app-id/--app-secret","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":411,"sourceCode":"\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 != \"\" {\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}","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L393-L429","documentation":"In bind mode the command must reuse an existing Feishu app, which by definition needs its credentials. resolveFeishuSetupInputs throws this error when `--mode bind` (or the bind subcommand path) is selected without a complete id:secret pair, since binding cannot create anything without them.","triggerScenarios":"`cc-connect feishu setup --mode bind` with no --app/--app-id/--app-secret, or bind mode reached implicitly in auto mode where appID/appSecret were expected but empty.","commonSituations":"Automation that omits credentials because it assumed a previous config would be reused, or users intending `new` mode but selecting bind.","solutions":["Supply credentials: --app id:secret or --app-id X --app-secret Y","Switch to --mode new if you want a fresh app created","Check that the credential variables in your script are populated before running"],"exampleFix":"// before\ncc-connect feishu setup --mode bind\n// after\ncc-connect feishu setup --mode bind --app cli_xxx:secret_yyy","handlingStrategy":"validation","validationCode":"if [[ \"$MODE\" == bind ]]; then [[ -n \"$APP\" || ( -n \"$APP_ID\" && -n \"$APP_SECRET\" ) ]] || { echo \"bind needs credentials\" >&2; exit 1; }; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bind mode always needs existing app credentials","Use new mode when no credentials exist yet","Fail fast in scripts if credential vars are empty"],"tags":["cli","feishu","credentials"],"backgroundTag":"missing-required-argument","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"}