chenhg5/cc-connect · error

bind mode requires credentials: use --app id:secret or --app

Error message

bind mode requires credentials: use --app id:secret or --app-id/--app-secret

What it means

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.

Source

Thrown at cmd/cc-connect/feishu.go:411

		}
	}

	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")
	}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Supply credentials: --app id:secret or --app-id X --app-secret Y
  2. Switch to --mode new if you want a fresh app created
  3. Check that the credential variables in your script are populated before running

Example fix

// before
cc-connect feishu setup --mode bind
// after
cc-connect feishu setup --mode bind --app cli_xxx:secret_yyy
Defensive patterns

Strategy: validation

Validate before calling

if [[ "$MODE" == bind ]]; then [[ -n "$APP" || ( -n "$APP_ID" && -n "$APP_SECRET" ) ]] || { echo "bind needs credentials" >&2; exit 1; }; fi

Prevention

When it happens

Trigger: `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.

Common situations: Automation that omits credentials because it assumed a previous config would be reused, or users intending `new` mode but selecting bind.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/b7d10ccb8d24ed2b. Report an issue: GitHub.