ankitpokhrel / jira-cli

🔥 Feature-rich interactive Jira command line.
MIT License
3.95k stars 201 forks source link

PAT from keychain works during init but not for any other command #791

Open wduda opened 2 hours ago

wduda commented 2 hours ago

Describe the bug I have added my PAT to keychain on macOS. I run jira init and the config is successful and lists the boards in the project for example. However, when I try to execute any other command (like jira me) it asks me to put the PAT in the env variable or netrc file, and does nothing, and seemingly forgets the existence of the PAT in the keychain.

Please provide following details

  1. JiraCLI Version: (Version="1.5.2", GitCommit="34221786aaa12d5bc66039d164b6d9587b0799c7", CommitDate="2024-09-20T08:29:56+00:00", GoVersion="go1.23.1", Compiler="gc", Platform="darwin/arm64")
  2. Are you using Jira cloud or on-premise jira server? on premise No serverinfo output as jira-cli asks to put PAT in env variable but I have it in keychain. I cpopied this from the config file generated by jira init: version: major: 9 minor: 12 patch: 13
  3. What operating system are you using? Also mention version. macOS Version 15.0.1 (24A348)
  4. What terminal are you using? Also mention version. iTerm 2 Build 3.5.5

Steps to reproduce the behavior:

  1. Add PAT to Keychain
  2. Do NOT set an env variable JIRA_API_TOKEN
  3. Install jira-cli
  4. Run jira init successfully with PAT being provided by keychain
  5. Try any command like jira me or jira serverinfo
  6. JIRA CLI will print the error message starting with "The tool needs a Jira API token to function. ..."

Expected behavior All Jira-cli commands work with PAT provided from keychain.

wduda commented 2 hours ago

Providing the PAT through export JIRA_API_TOKEN="" makes all commands successful again. But that cannot be the point of claiming keychain support if one still has to use the env variable.