{"record":{"id":"023e66b1fec2342c","repo":"chenhg5/cc-connect","slug":"app-format-must-be-app-id-app-secret","errorCode":null,"errorMessage":"--app format must be app_id:app_secret","messagePattern":"--app format must be app_id:app_secret","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":423,"sourceCode":"\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\nfunc resolveTargetProject(project string) (string, error) {\n\tproject = strings.TrimSpace(project)\n\tif project != \"\" {\n\t\treturn project, nil\n\t}\n\tprojects, err := config.ListProjects()\n\tif err != nil {\n\t\treturn \"\", err\n\t}","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L405-L441","documentation":"parseAppPair splits the --app value on the first colon into app_id and app_secret. It throws this error when the string has no colon, starts with a colon (empty id), ends with a colon (empty secret), or when trimming leaves either half empty. Note the secret itself may contain colons; only the first colon splits.","triggerScenarios":"`--app cliabc` (no colon), `--app :secret`, `--app id:`, `--app \" \"` or `--app id:   ` (whitespace-only halves).","commonSituations":"Fetching only the app id from a store and forgetting the secret, quoting mistakes in shell dropping part of the pair, or a config variable that was never fully populated.","solutions":["Format the value as id:secret, e.g. --app cli_xxx:shcl_xxx","Verify the credential variable contains both halves separated by a colon","Trim stray whitespace/newlines from the variable before passing it"],"exampleFix":"// before\ncc-connect feishu setup --app \"$FEISHU_APP\"   # FEISHU_APP=\"cli_xxx\"\n// after\ncc-connect feishu setup --app \"$APP_ID:$APP_SECRET\"","handlingStrategy":"validation","validationCode":"case \"$APP\" in *:*) id=\"${APP%%:*}\"; sec=\"${APP#*:}\"; [[ -n \"$id\" && -n \"$sec\" ]] || { echo \"--app must be id:secret\" >&2; exit 1; };; *) echo \"--app must be id:secret\" >&2; exit 1;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the pair as id:secret with both halves non-empty","Remember the secret may contain colons; split on the first only","Trim whitespace/newlines from credential variables"],"tags":["cli","feishu","format"],"backgroundTag":"invalid-argument-format","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"}