Skip to content

feat(profiles): one profile per Linear workspace - #74

Open
taylorg009 wants to merge 4 commits into
phnx-labs:mainfrom
taylorg009:feat/profiles
Open

taylorg009 wants to merge 4 commits into
phnx-labs:mainfrom
taylorg009:feat/profiles

Conversation

@taylorg009

Copy link
Copy Markdown

Why

A Linear API key belongs to one workspace, so a project in a second workspace could never be read with the shared key. Profiles give each workspace its own config, cache, queue, uploads and Keychain key.

What

  • --profile <name> (global flag) or LINEAR_PROFILE; the flag wins. Names match ^[a-z0-9][a-z0-9._-]{0,63}$.
  • Under a profile, config/cache/queue/uploads live in ~/.linear-cli/profiles/<name>/. The legacy ~/.agents/linear.json migration only applies to the default profile.
  • Key resolution under a profile: profile config apiKey, then Keychain linear-api-key with account <name>. LINEAR_API_KEY / LINEAR_TEAM_ID are not read under a profile (they belong to the default workspace). Default profile is unchanged.
  • setup --keychain stores the key in the Keychain (service linear-api-key, account <profile|default>) and keeps apiKey out of config.json.
  • With neither flag nor env set, the cwd's agents project picks the profile through the same agents projects view . --json call the auto-scope already makes, now done once in main() and reused.
  • Fix: the projects <name> / initiatives <name> shorthand now survives a leading --team or --profile.
  • Version 0.32.0; CHANGELOG and README updated. Not tagged or released.

Companion PRs

agents-cli (linear.profile on project defs, link --profile) and agi-ext (the Project panel passes LINEAR_PROFILE).

Tests

Ran 294 tests OK (skipped=4); 14 new tests in ProfileTest (fake security and agents on PATH, local GraphQL server for setup). Verified live: default tasks --cycle all --json unchanged; LINEAR_PROFILE=zz tasks exits 1 naming linear --profile zz setup; a bad key with --keychain writes neither config nor Keychain.

🤖 Generated with Claude Code

taylor009 and others added 4 commits October 14, 2026 19:17
A Linear API key belongs to one workspace, so a project in a second
workspace (talora-health) could never be read with the shared key.
--profile <name> or LINEAR_PROFILE now keeps config, cache, queue and
uploads under ~/.linear-cli/profiles/<name>/ and resolves the key from the
profile config, then Keychain linear-api-key with account <name>.
LINEAR_API_KEY / LINEAR_TEAM_ID are not read under a profile. With neither
set, the cwd's agents project picks the profile through the same
`agents projects view` call the project auto-scope already makes, now done
once in main() and reused. setup --keychain keeps the key out of
config.json. The projects/initiatives <name> shorthand now survives a
leading --team or --profile. Version 0.32.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A profile's key now lives under its own Keychain service
(linear-api-key.<profile>, linear-team-id.<profile>) instead of an account
under the shared one: find-generic-password without -a matches any
account, so the default profile could pick up a profile's key. The
default lookup is unchanged.

Review fixes: the cwd `agents` lookup in main() is skipped for commands
that never scope by project and when the default config has autoScope:
false; a cwd project only auto-scopes when its profile is the active one;
profile names use fullmatch so a trailing newline is refused; an invalid
profile in a project YAML is ignored with a warning instead of failing
every command; and a test runs `tasks --similar --json` under a profile
against a local Linear to prove its key, config and cache are the ones
used.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
--profile default and LINEAR_PROFILE=default select the default profile:
default paths, the default key chain, and no cwd auto-profile lookup, so
agents-cli can pin LINEAR_PROFILE=default for an unprofiled project and the
directory can never redirect it to another workspace. activate_profile
('default') rebinds nothing and creates no profiles/default directory, and
`profile: default` on an agents project reads as the default profile.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The cwd profile was skipped for queue, states, labels, users, agents and
inbox, so in a directory bound to a profile `update --done` queued into
profiles/<name>/queue while `queue drain` there read the default queue with
the default key. Profile selection from `agents projects view` now applies
to every command except setup; the project auto-scope half of that answer
still only applies in tasks and create. autoScope: false in the default
config remains the switch that turns the cwd lookup off entirely.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants