jira-client-cli
v0.1.3
Published
A cross-platform CLI client for JIRA
Maintainers
Readme
jira-client-cli
A cross-platform CLI client for JIRA.
Installation
npm install -g jira-client-cliRequirements: Node.js >= 18.0.0
Quick Start
Interactive Mode
Start the CLI in interactive mode by running without arguments:
jira-cliThis opens an interactive session where you can run commands:
JIRA CLI - Interactive Mode
Type "help" for available commands, "exit" to quit.
No active profile. Run "profile create" to get started.
jira-cli> profile create
? Profile name: work
? JIRA domain: company.atlassian.net
? Email: [email protected]
? API token: ****
✓ Authenticated as John Doe
✓ Profile "work" created and set as active.
jira-cli [work]> issue get PROJ-123
────────────────────────────────────────────────────────
PROJ-123: Fix login button
────────────────────────────────────────────────────────
Type: Bug
Status: In Progress
...
jira-cli [work]> exit
Goodbye!One-Shot Mode
You can also run individual commands directly:
jira-cli profile create
jira-cli issue get PROJ-1231. Create a Profile
First, create a profile with your JIRA credentials:
jira-cli
# Then in the interactive session:
profile createOr directly:
jira-cli profile createYou'll be prompted for:
- Profile name: A name for this profile (e.g., "work", "personal")
- JIRA domain: Your JIRA instance (e.g.,
company.atlassian.net) - Email: Your JIRA account email
- API token: Your JIRA API token
Getting an API token:
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Give it a label and copy the token
Or create a profile non-interactively:
jira-cli profile create --name work --domain company.atlassian.net --email [email protected] --token YOUR_TOKEN2. Query Issues
Fetch details of a JIRA issue:
jira-cli issue get PROJ-123Output as JSON:
jira-cli issue get PROJ-123 --jsonCommands
Profile Management
# Create a new profile
jira-cli profile create
# List all profiles (* = active)
jira-cli profile list
# Switch to a different profile
jira-cli profile use <name>
# Show profile details
jira-cli profile show [name]
# Delete a profile
jira-cli profile delete <name>
jira-cli profile delete <name> --force # Skip confirmationIssue Commands
# Get issue details
issue get <issue-key>
issue get PROJ-123 --json
# Calculate time in status for issues (outputs CSV)
issue time-in-status "project = PROJ"
issue time-in-status "project = PROJ AND status = Done" --output report.csv
issue time-in-status "assignee = currentUser()" --max-results 200Session Commands (Interactive Mode)
help, ? Show available commands
clear, cls Clear the screen
exit, quit, q Exit the CLITime in Status Report
The time-in-status command calculates how long each issue spent in each status and outputs a CSV report with:
- Time per ticket per status (H:MM:SS format)
- Total time per status
- Average time per status
- Median time per status
Example output:
TICKET ID,To Do,In Progress,Done
PROJ-1,1:30:00,4:15:30,2:00:00
PROJ-2,0:45:00,3:30:15,1:15:45
...
"Total, h",2:15:00,7:45:45,3:15:45
"Average, h",1:07:30,3:52:52,1:37:52
"Median, h",1:07:30,3:52:52,1:37:52Multiple Profiles
You can manage multiple JIRA accounts:
# Create profiles
jira-cli profile create --name work
jira-cli profile create --name personal
# List profiles
jira-cli profile list
# NAME DOMAIN EMAIL
# * work company.atlassian.net [email protected]
# personal personal.atlassian.net [email protected]
# Switch profiles
jira-cli profile use personalConfiguration
Configuration is stored in a platform-specific location:
| OS | Location |
|----|----------|
| macOS | ~/Library/Preferences/jira-cli-nodejs/config.json |
| Windows | %APPDATA%\jira-cli-nodejs\Config\config.json |
| Linux | ~/.config/jira-cli-nodejs/config.json |
Development
# Clone the repository
git clone https://github.com/k0stya/jira-client-cli.git
cd jira-client-cli
# Install dependencies
npm install
# Build
npm run build
# Run locally
node bin/jira.js --help
# Run tests
npm test
# Link for local development
npm link
jira-cli --helpLicense
MIT
