Skip to main content

Comprehensive Jira API client and CLI tool

Project description

temet-jira

A comprehensive Jira API client and CLI tool for interacting with Jira Cloud instances. Built for AI agents and automation workflows — retrieve tickets, create rich ADF content, and analyze workflow state durations.

Table of Contents

Features

  • Agent-First Design — Enable AI agents to retrieve tickets, parse requirements, and create implementation plans
  • Jira API Client — Python and CLI interface to Jira Cloud REST API v3
  • Structured Data Export — Export issues in JSON, JSONL, CSV formats optimized for agent processing
  • Document Builder — Programmatically create ADF-formatted issues and epics with proper structure
  • Workflow Analysis — Analyze state durations and bottlenecks for retrospectives
  • Epic Management — Retrieve epics with children, filter by sprint, group by assignee/status
  • JQL Support — Advanced filtering for complex queries and batch operations
  • Claude Code Integration — Skills, slash commands, and an MCP server for AI-assisted workflows

Quick Start

Installation

Recommended: install as a global tool with uv

uv tool install temet-jira

Alternative: pipx

pipx install temet-jira

Verify:

temet-jira --help

Configuration

Run the interactive setup wizard:

temet-jira setup

This guides you through:

  1. Your Jira URL (e.g. https://your-company.atlassian.net)
  2. Your email address
  3. API token — generate one at https://id.atlassian.com/manage-profile/security/api-tokens
  4. Optional default project key

Configuration is saved to ~/.config/temet-jira/config.yaml.

Alternative: environment variables

export JIRA_BASE_URL="https://your-company.atlassian.net"
export JIRA_USERNAME="your-email@example.com"
export JIRA_API_TOKEN="your-api-token"
export JIRA_DEFAULT_PROJECT="PROJ"          # optional
export JIRA_DEFAULT_FORMAT="json"           # optional: table (default), json, jsonl, csv

Check your current configuration at any time:

temet-jira config show

Multiple Jira instances (named profiles)

Each profile is a separate Jira instance in ~/.config/temet-jira/config.yaml:

temet-jira config profile add work          # setup wizard for the 'work' profile
temet-jira config profile list
temet-jira --profile work search "project = PROJ"

Profile selection precedence (highest first): --profile flag → a per-project ./.temet-jira.yaml (profile:) → TEMET_JIRA_PROFILEdefault_profiledefault. A committed .temet-jira.yaml can also set non-sensitive defaults (project, component, …) so cd-ing into a repo auto-selects the right instance — credentials always stay in the named profile, never in the project file.

First Commands

# Get issue details
temet-jira get PROJ-123

# Search for issues using JQL
temet-jira search "project = PROJ AND status = 'In Progress'"

# List available issue types for a project
temet-jira types --project PROJ

# Create a task
temet-jira create --project PROJ --type Task --summary "Fix login bug"

# Export to CSV
temet-jira export --project PROJ --format csv -o tickets.csv

CLI Commands

Command Description
setup Interactive setup wizard
config View and manage configuration (show, get, set, unset, path, edit)
get Get details of a Jira issue
search Search for issues using JQL
types List available issue types for a project
create Create a new issue with ADF formatting
update Update issue fields or transition status
comment Add a comment to an issue
transitions Show available status transitions for an issue
epics List all epics in a project
epic-details Get epic details with child issues
export Export issues with filtering (JSON, JSONL, CSV, table)
analyze Analyze workflow state durations

Examples:

temet-jira get PROJ-123                                  # Issue details
temet-jira search "assignee = currentUser()"            # JQL search
temet-jira types --project PROJ                         # Available issue types
temet-jira create --project PROJ --type Story \
    --summary "New feature" --priority High             # Create issue
temet-jira update PROJ-123 --status "Done"              # Transition status
temet-jira comment PROJ-123 "Deployed to staging"       # Add comment
temet-jira export --project PROJ --format jsonl \
    -o issues.jsonl                                     # Export (streaming)
temet-jira analyze state-durations issues.json          # Workflow analysis

Output formats: table (console default), json, jsonl (streaming, best for large datasets), csv

MCP Server

temet-jira ships with a built-in MCP server (temet-jira-mcp) compatible with any MCP-enabled client: Claude Code, Cursor, Windsurf, VS Code Copilot, Zed, and others.

Guided setup:

temet-jira mcp add

This scans your system for existing config files, asks where you want to install, and prints the exact JSON snippet to paste — including the right format for your client.

List available tools:

temet-jira mcp tools

Exposed tools:

Tool Description
get_issue Fetch a single issue by key (supports expand: transitions, changelog)
search_issues Search with JQL, returns paginated results
create_issue Create a new issue with optional description, labels, priority
update_issue Update fields or transition status
add_comment Add a comment to an issue
get_transitions List available status transitions for an issue
transition_issue Move an issue to a new status
get_epics List epics in a project
get_issue_types List available issue types for a project

Manual config (if you prefer): run temet-jira mcp add and choose "Other" for a generic snippet you can adapt to any client.

Claude Code Integration

Slash commands are available in .claude/commands/jira/ — use with the /jira: prefix in Claude Code:

Command Description
/jira:get PROJ-123 Get ticket details
/jira:search "JQL query" Search with JQL
/jira:create Create an issue
/jira:update PROJ-123 Update an issue
/jira:comment PROJ-123 "message" Add a comment
/jira:export Export issues
/jira:epics List epics
/jira:epic-details PROJ-123 Epic with children
/jira:transitions PROJ-123 Show transitions

Skills in .claude/skills/ provide reference documentation for Claude:

Skill Description
jira-api Jira REST API v3 documentation, endpoints, JQL patterns
jira-builders CLI usage guide and best practices
build-jira-document-format ADF builder patterns
work-with-adf Atlassian Document Format creation

Python API

from temet_jira import JiraClient, IssueBuilder, EpicBuilder

# Fetch an issue
client = JiraClient()
issue = client.get_issue("PROJ-123")

# Create a structured issue with ADF content
builder = IssueBuilder(title="New feature", story_points=8)
builder.add_description("Feature description")
builder.add_acceptance_criteria(["Criteria 1", "Criteria 2"])

client.create_issue({
    "project": {"key": "PROJ"},
    "summary": "New feature",
    "issuetype": {"name": "Story"},
    "description": builder.build(),
})

Also available: JiraDocumentBuilder (raw ADF builder), SubtaskBuilder, StateDurationAnalyzer.

Development

# Clone and install dev dependencies
git clone https://github.com/temet-ai/temet-jira.git
cd temet-jira
uv sync --extra dev

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=temet_jira

# Lint and type check
uv run ruff check src/ tests/
uv run mypy src/

# After code changes, rebuild the installed binary
uv build && uv tool install . --force --refresh-package temet-jira

Project Structure

temet-jira/
├── src/temet_jira/          # Main package
│   ├── client.py            # JiraClient API
│   ├── formatter.py         # Document builders (legacy entry point)
│   ├── cli.py               # CLI commands
│   ├── mcp_server.py        # MCP server
│   ├── document/            # ADF document builder
│   └── analysis/            # State duration analysis
├── .claude/
│   ├── commands/            # Slash commands for Claude Code
│   └── skills/              # Reference skills
├── tests/                   # Test suite
└── pyproject.toml

Requirements

  • Python 3.11+
  • uv or pipx for installation
  • Jira Cloud (REST API v3)
  • Valid Jira API token

License

MIT

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

temet_jira-0.1.0a4.tar.gz (397.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

temet_jira-0.1.0a4-py3-none-any.whl (89.2 kB view details)

Uploaded Python 3

File details

Details for the file temet_jira-0.1.0a4.tar.gz.

File metadata

  • Download URL: temet_jira-0.1.0a4.tar.gz
  • Upload date:
  • Size: 397.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for temet_jira-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 33bee2369e87996781720bd1e9bf6f299e17790018a1d7d6104db147992a4a3e
MD5 ead5a3dcbb483e7a21b2aef09924d223
BLAKE2b-256 a0de23c7b4ed4dbdbe5fb5d45211671192cfa6ff3f47b36eda23c17490008a4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for temet_jira-0.1.0a4.tar.gz:

Publisher: publish.yml on temet-ai/temet-jira

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file temet_jira-0.1.0a4-py3-none-any.whl.

File metadata

  • Download URL: temet_jira-0.1.0a4-py3-none-any.whl
  • Upload date:
  • Size: 89.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for temet_jira-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 0746ce5d9185f58ba9598ce1c7d31fe284365a9e46955f374cc48f1d1fa39595
MD5 4eff2d4a3d9d49656c0f1faf0eceddf8
BLAKE2b-256 ea07d0e7d43c17a2a92946648514f9d9171e0ef8f66717bac1956c236749e526

See more details on using hashes here.

Provenance

The following attestation bundles were made for temet_jira-0.1.0a4-py3-none-any.whl:

Publisher: publish.yml on temet-ai/temet-jira

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page