Skip to content

kanyun-inc/jira-cli

Repository files navigation

@kanyun-ai-infra/jira-cli

Jira Server CLI & MCP Server — manage issues, sprints, boards from terminal and AI agents

npm version License: MIT


Quick Start

# Login (opens browser to get token)
npx @kanyun-ai-infra/jira-cli login

# Login with token
npx @kanyun-ai-infra/jira-cli login <your-token>

# My open issues
npx @kanyun-ai-infra/jira-cli my

# Search with JQL
npx @kanyun-ai-infra/jira-cli issue search 'project = OC AND status = "IN progress"'

Features

  • JQL search — full Jira Query Language support
  • Issue CRUD — create, view, comment, assign, transition
  • Agile — boards, sprints, sprint issues
  • MCP Server — 14 tools for AI agent integration (Claude Code, Cursor, etc.)
  • Default domain — preconfigured for jira.zhenguanyu.com, zero extra config
  • JSON / table / JSONL — multiple output formats for humans and machines

Installation

Requirements: Node.js >= 22.0.0

npx @kanyun-ai-infra/jira-cli <command>        # Use directly via npx
npm install -g @kanyun-ai-infra/jira-cli        # Or global install, then use `jira-cli`

Authentication

Get your API Token:

  1. Run npx @kanyun-ai-infra/jira-cli login — browser opens automatically
  2. Or visit https://jira.zhenguanyu.com/plugins/servlet/de.resolution.apitokenauth/admin
  3. Create a token, then:
# Option 1: login command (saved to ~/.jira-cli/config.json)
npx @kanyun-ai-infra/jira-cli login <your-token>

# Option 2: environment variables
export JIRA_API_TOKEN=<your-token>
export JIRA_BASE_URL=https://jira.zhenguanyu.com  # optional, this is the default

Commands

Command Description
login [token] Configure credentials (opens browser if no token)
me Show current user info
my List my open issues across all projects
server Show Jira server info
project list List all projects
project detail <key> Get project details
issue list -p <key> List issues in a project
issue search <jql> Search issues with JQL
issue view <key> View issue details
issue create Create a new issue
issue comment <key> <text> Add a comment
issue comments <key> List comments
issue assign <key> <user> Assign to a user
issue transitions <key> List available transitions
issue transition <key> <id> Transition to new status
board list List agile boards
sprint list <boardId> List sprints
sprint issues <sprintId> List sprint issues
users <query> Search users
meta types List issue types
meta priorities List priorities
meta statuses List statuses
mcp Start MCP stdio server
mcp-install Register jira-mcp in Claude Code

Usage Examples

My Issues

jira-cli my                                    # All my open issues
jira-cli my -n 10                              # Top 10
jira-cli my -o json                            # JSON output

Issue Operations

jira-cli issue list -p OC                      # List OC project issues
jira-cli issue list -p OC -s "IN progress"     # Filter by status
jira-cli issue list -p OC -a me                # My issues in OC

jira-cli issue search 'priority = High AND status != Done'  # JQL search
jira-cli issue view OC-35493                   # View details
jira-cli issue view OC-35493 -o json           # Full JSON

jira-cli issue create -p OC -s "Fix login bug" -t Bug      # Create
jira-cli issue comment OC-123 "Fixed in PR #45"            # Comment
jira-cli issue assign OC-123 wupengfeibj01                 # Assign
jira-cli issue transitions OC-123                           # Check transitions
jira-cli issue transition OC-123 31                         # Move to In Progress

Agile

jira-cli board list -p OC                      # Boards for project
jira-cli sprint list 5009 -s active            # Active sprints
jira-cli sprint issues 46078                   # Sprint issues

Output Formats

All commands support -o json, -o table (default), -o jsonl:

jira-cli my -o json                            # Structured JSON
jira-cli my -o jsonl                           # One JSON per line (pipeable)
jira-cli my -o table                           # Human-readable table

MCP Server

Built-in MCP server for AI agent integration (Claude Code, Cursor, etc.).

One-Command Setup

npx @kanyun-ai-infra/jira-cli mcp-install

Manual Configuration

Add to your MCP settings:

{
  "mcpServers": {
    "jira-mcp": {
      "command": "npx",
      "args": ["-y", "@kanyun-ai-infra/jira-cli", "mcp"],
      "env": {
        "JIRA_API_TOKEN": "<your-token>"
      }
    }
  }
}

MCP Tools

Tool Description
jira_myself Get current user info
jira_search Search issues with JQL
jira_issue_detail Get full issue details
jira_issue_comments List issue comments
jira_issue_transitions List available transitions
jira_issue_transition Transition an issue
jira_add_comment Add a comment
jira_assign_issue Assign an issue
jira_create_issue Create a new issue
jira_project_list List all projects
jira_board_list List agile boards
jira_sprint_list List sprints for a board
jira_sprint_issues List issues in a sprint
jira_user_search Search users

API Reference

jira-cli wraps the Jira Server REST API v2 and Agile API:

Command API Endpoint
me GET /rest/api/2/myself
project list GET /rest/api/2/project
issue search GET /rest/api/2/search
issue view GET /rest/api/2/issue/{key}
issue create POST /rest/api/2/issue
issue comments GET /rest/api/2/issue/{key}/comment
issue transitions GET /rest/api/2/issue/{key}/transitions
issue transition POST /rest/api/2/issue/{key}/transitions
issue assign PUT /rest/api/2/issue/{key}/assignee
board list GET /rest/agile/1.0/board
sprint list GET /rest/agile/1.0/board/{id}/sprint
sprint issues GET /rest/agile/1.0/sprint/{id}/issue
users GET /rest/api/2/user/search

Auth: Authorization: Bearer <token>.

License

MIT

About

Jira Server CLI for AI agents — issues, sprints, boards, projects and more

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages