chenhg5/cc-connect · error
new mode does not accept credentials; use `cc-connect feishu
Error message
new mode does not accept credentials; use `cc-connect feishu bind`
What it means
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.
Source
Thrown at cmd/cc-connect/feishu.go:414
if appID != "" || appSecret != "" {
if appID == "" || appSecret == "" {
return "", "", "", fmt.Errorf("both --app-id and --app-secret are required")
}
}
effectiveMode = mode
if mode == feishuSetupModeAuto {
if appID != "" && appSecret != "" {
effectiveMode = feishuSetupModeBind
} else {
effectiveMode = feishuSetupModeNew
}
}
if mode == feishuSetupModeBind && (appID == "" || appSecret == "") {
return "", "", "", fmt.Errorf("bind mode requires credentials: use --app id:secret or --app-id/--app-secret")
}
if mode == feishuSetupModeNew && (appID != "" || appSecret != "") {
return "", "", "", fmt.Errorf("new mode does not accept credentials; use `cc-connect feishu bind`")
}
return effectiveMode, appID, appSecret, nil
}
func parseAppPair(raw string) (appID, appSecret string, err error) {
idx := strings.Index(raw, ":")
if idx <= 0 || idx >= len(raw)-1 {
return "", "", fmt.Errorf("--app format must be app_id:app_secret")
}
appID = strings.TrimSpace(raw[:idx])
appSecret = strings.TrimSpace(raw[idx+1:])
if appID == "" || appSecret == "" {
return "", "", fmt.Errorf("--app format must be app_id:app_secret")
}
return appID, appSecret, nil
}
View on GitHub (pinned to 4000b2338a)
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
Example fix
// before cc-connect feishu setup --mode new --app-id id --app-secret sec // after cc-connect feishu setup --mode bind --app-id id --app-secret sec
Defensive patterns
Strategy: validation
Validate before calling
if [[ "$MODE" == new && ( -n "$APP" || -n "$APP_ID" || -n "$APP_SECRET" ) ]]; then echo "new mode takes no credentials" >&2; exit 1; fi
Prevention
- Only inject credentials in bind mode
- Parameterize scripts so credentials are conditional on mode
- Choose bind explicitly when reusing an app
When it happens
Trigger: `cc-connect feishu setup --mode new --app id:secret` or `--mode new --app-id X --app-secret Y`.
Common situations: See trigger scenarios.
Understand the failure class
Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.
Related errors
- use either --app or --app-id/--app-secret, not both
- both --app-id and --app-secret are required
- bind mode requires credentials: use --app id:secret or --app
- --app format must be app_id:app_secret
- invalid --platform-type %q, want feishu or lark
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/1fa733da06a04e0b.
Report an issue: GitHub.