{"record":{"id":"e94a220a76abe98b","repo":"gastownhall/beads","slug":"linear-authentication-not-configured-options-oa","errorCode":null,"errorMessage":"Linear authentication not configured\nOptions:\n  OAuth (for CI):  export LINEAR_OAUTH_CLIENT_ID=... LINEAR_OAUTH_CLIENT_SECRET=...\n  API key (devs):  export LINEAR_API_KEY=... or bd config set linear.api_key \"YOUR_API_KEY\"","messagePattern":"Linear authentication not configured\nOptions:\n  OAuth \\(for CI\\):  export LINEAR_OAUTH_CLIENT_ID=\\.\\.\\. LINEAR_OAUTH_CLIENT_SECRET=\\.\\.\\.\n  API key \\(devs\\):  export LINEAR_API_KEY=\\.\\.\\. or bd config set linear\\.api_key \"YOUR_API_KEY\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/linear.go","lineNumber":1017,"sourceCode":"\n// validateLinearConfig checks that required Linear configuration is present.\n// cliTeams is the list of team IDs from the --team flag (may be nil).\nfunc validateLinearConfig(cliTeams []string) error {\n\tif err := ensureStoreActive(); err != nil {\n\t\treturn fmt.Errorf(\"database not available: %w\", err)\n\t}\n\n\tctx := rootCtx\n\n\t// Accept either OAuth credentials or API key.\n\toauthClientID, _ := getLinearConfig(ctx, \"linear.oauth_client_id\")\n\toauthClientSecret, _ := getLinearConfig(ctx, \"linear.oauth_client_secret\")\n\thasOAuth := oauthClientID != \"\" && oauthClientSecret != \"\"\n\n\tif !hasOAuth {\n\t\tapiKey, _ := getLinearConfig(ctx, \"linear.api_key\")\n\t\tif apiKey == \"\" {\n\t\t\treturn fmt.Errorf(\"Linear authentication not configured\\n\" +\n\t\t\t\t\"Options:\\n\" +\n\t\t\t\t\"  OAuth (for CI):  export LINEAR_OAUTH_CLIENT_ID=... LINEAR_OAUTH_CLIENT_SECRET=...\\n\" +\n\t\t\t\t\"  API key (devs):  export LINEAR_API_KEY=... or bd config set linear.api_key \\\"YOUR_API_KEY\\\"\")\n\t\t}\n\t}\n\n\tteamIDs := getLinearTeamIDs(ctx, cliTeams)\n\tif len(teamIDs) == 0 {\n\t\treturn fmt.Errorf(\"no Linear team ID configured\\nRun: bd config set linear.team_id \\\"TEAM_ID\\\"\\nOr:  bd config set linear.team_ids \\\"TEAM_ID1,TEAM_ID2\\\"\\nOr: export LINEAR_TEAM_ID=TEAM_ID\")\n\t}\n\n\tfor _, id := range teamIDs {\n\t\tif !isValidUUID(id) {\n\t\t\treturn fmt.Errorf(\"invalid Linear team ID (expected UUID format like '12345678-1234-1234-1234-123456789abc')\\nInvalid value: %s\", id)\n\t\t}\n\t}\n\n\treturn nil","sourceCodeStart":999,"sourceCodeEnd":1035,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/linear.go#L999-L1035","documentation":"Linear sync requires credentials: either OAuth client ID+secret (recommended for CI) or a Linear API key. validateLinearConfig checks config keys linear.oauth_client_id/secret and linear.api_key (which may themselves come from env vars LINEAR_OAUTH_CLIENT_ID/SECRET or LINEAR_API_KEY); if none are set it returns this multi-line guidance error.","triggerScenarios":"Running bd linear sync/push/pull with no LINEAR_API_KEY env var, no LINEAR_OAUTH_CLIENT_ID/LINEAR_OAUTH_CLIENT_SECRET env vars, and no corresponding keys in bd config.","commonSituations":"Fresh setup where credentials were never configured; CI environment missing exported secrets; credentials stored under wrong config key names; shell profile not sourced in the CI job.","solutions":["For CI: export LINEAR_OAUTH_CLIENT_ID and LINEAR_OAUTH_CLIENT_SECRET","For local dev: export LINEAR_API_KEY, or run `bd config set linear.api_key \"YOUR_API_KEY\"`","Verify with `bd config get linear.api_key` that the value persisted and the shell running bd actually has the env vars"],"exampleFix":"// before\n$ bd linear pull\nError: Linear authentication not configured...\n// after\n$ export LINEAR_API_KEY=lin_api_xxx\n$ bd linear pull","handlingStrategy":"validation","validationCode":"func linearAuthReady() bool {\n\thasOAuth := os.Getenv(\"LINEAR_OAUTH_CLIENT_ID\") != \"\" && os.Getenv(\"LINEAR_OAUTH_CLIENT_SECRET\") != \"\"\n\tif hasOAuth {\n\t\treturn true\n\t}\n\tif k := os.Getenv(\"LINEAR_API_KEY\"); k != \"\" {\n\t\treturn true\n\t}\n\treturn false\n}","typeGuard":null,"tryCatchPattern":"if err := runLinearPull(ctx); err != nil && strings.Contains(err.Error(), \"Linear authentication not configured\") {\n\treturn fmt.Errorf(\"set LINEAR_API_KEY or OAuth vars before syncing: %w\", err)\n}","preventionTips":["Set credentials in shell profile or CI secret store before running linear commands","Remember OAuth requires BOTH client id and secret","Verify with `env | grep LINEAR` in the same shell/process running bd"],"tags":["authentication","configuration","linear","env-var"],"backgroundTag":"missing-credentials","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}