Skip to content

fix(jtk): make config show reflect the shared store - #483

Open
jurij wants to merge 1 commit into
open-cli-collective:mainfrom
jurij:fix/jtk-config-show-shared-store
Open

jurij wants to merge 1 commit into
open-cli-collective:mainfrom
jurij:fix/jtk-config-show-shared-store

Conversation

@jurij

@jurij jurij commented Aug 26, 2026

Copy link
Copy Markdown

Problem

jtk config show skips the shared ~/.config/atlassian-cli/config.yml that the runtime resolvers actually use. After jtk init writes the shared store, config show renders url/email/default_project as empty - rows and prints the legacy per-tool path (which may not even exist) as Config file:. A fully working configuration looks unconfigured:

KEY | VALUE | SOURCE
url |  | -
email |  | -
...
Config file: ~/Library/Application Support/jira-ticket-cli/config.json   # does not exist

while jtk me succeeds. The blind spot was documented in the command's help text, but as a diagnostic surface it misleads more than it explains — I hit it minutes after a successful jtk init.

Fix

  • GetURLWithSource, GetEmailWithSource, GetDefaultProjectWithSource now consult the shared store between env and the legacy file — the same precedence the runtime getters use (auth_method and cloud_id already did this via jtkSectionWithSource).
  • The Config file: row names the file actually read: the shared store when it exists on disk, else the legacy path.
  • The help-text paragraph documenting the old limitation is replaced by the actual precedence.

After

KEY | VALUE | SOURCE
url | https://example.atlassian.net | shared default
email | user@example.com | shared default
api_token | configured | keyring (api_token)
...
Config file: ~/Library/Application Support/atlassian-cli/config.yml

Tests

Two new tests: shared-store values surface with the shared source label and the path row names the shared file; shared beats legacy per field (url from shared, email falling through to legacy). go test ./tools/jtk/... green, gofmt clean.

The runtime resolvers (GetURL, GetEmail, GetDefaultProject) consult the
shared ~/.config/atlassian-cli/config.yml, but the *WithSource
diagnostics behind `jtk config show` skipped it. After `jtk init`
writes the shared store, `config show` rendered url/email as empty
"-" rows and printed the legacy per-tool path (which may not exist) as
"Config file:" — a working configuration looked unconfigured.

- GetURLWithSource / GetEmailWithSource / GetDefaultProjectWithSource
  now consult the shared store between env and the legacy file, matching
  runtime precedence (auth_method and cloud_id already did).
- The Config file row names the file actually read: the shared store
  when it exists, else the legacy path.
- Drop the help text documenting the old blind spot.
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.

1 participant