Skip to main content

A powerful CLI tool for managing Jira and Confluence

Project description

atlassian-cli

A powerful command-line tool for managing Jira and Confluence built on top of atlassian-python-api.

Languate - Python PyPI - License PyPI PyPI - Downloads

Features

  • ๐Ÿ› Jira: List, create, update, delete issues; manage projects, sprints, users
  • ๐Ÿ“„ Confluence: Manage spaces, pages, attachments; search with CQL
  • ๐Ÿ” Flexible auth: Config file + environment variable support
  • ๐ŸŽจ Rich output: Pretty, table, JSON, and lines formats (using rich)
  • ๐Ÿ“ Markdown support: Create pages from Markdown with code block conversion
  • ๐Ÿ’พ File output: Save page content to file (--output / -o)
  • โ˜๏ธ Cloud & Server: Supports both Atlassian Cloud and self-hosted instances

Installation

pip install python-atlassian-cli

Quick Start

1. Configure credentials

atlassian-cli config set

You'll be prompted for:

2. Or use environment variables

export ATLASSIAN_URL=https://mycompany.atlassian.net
export ATLASSIAN_USERNAME=user@example.com
export ATLASSIAN_API_TOKEN=your_api_token

3. Verify connection

atlassian-cli whoami

Jira Commands

Issues

# List issues (all / by project / assignee / status)
atlassian-cli jira issue list
atlassian-cli jira issue list --project MYPROJ
atlassian-cli jira issue list --assignee me
atlassian-cli jira issue list --status "In Progress"
atlassian-cli jira issue list --jql "project = MYPROJ AND sprint in openSprints()"

# Different output formats
atlassian-cli jira issue list --format table
atlassian-cli jira issue list --format json

# Get a specific issue
atlassian-cli jira issue get PROJ-123
atlassian-cli jira issue get PROJ-123 --format json

# Create an issue
atlassian-cli jira issue create --project PROJ --summary "Fix login bug" --type Bug --priority High
atlassian-cli jira issue create \
  --project PROJ \
  --summary "New feature" \
  --description "Detailed description here" \
  --type Story \
  --assignee alice@example.com \
  --labels backend --labels api

# Update an issue
atlassian-cli jira issue update PROJ-123 --summary "Updated title"
atlassian-cli jira issue update PROJ-123 --priority Highest --assignee bob@example.com

# Transition an issue
atlassian-cli jira issue transition PROJ-123 "In Progress"
atlassian-cli jira issue transition PROJ-123 Done

# Add a comment
atlassian-cli jira issue comment PROJ-123 "This is fixed in v2.1.0"

# Delete an issue (with confirmation)
atlassian-cli jira issue delete PROJ-123

Projects

# List all projects
atlassian-cli jira project list
atlassian-cli jira project list --format json

# Get project details
atlassian-cli jira project get MYPROJ

Sprints

# List sprints for a board
atlassian-cli jira sprint list 42
atlassian-cli jira sprint list 42 --state future
atlassian-cli jira sprint list 42 --state closed

Users

# Search for users
atlassian-cli jira user search "alice"
atlassian-cli jira user search "alice@example.com" --format json

Confluence Commands

Spaces

# List all spaces
atlassian-cli confluence space list
atlassian-cli confluence space list --limit 50

# Get space details
atlassian-cli confluence space get MYSPACE

# Create a new space
atlassian-cli confluence space create --key NEWSP --name "New Space" --description "Team workspace"

Pages

# List pages in a space
atlassian-cli confluence page list MYSPACE
atlassian-cli confluence page list MYSPACE --format table
atlassian-cli confluence page list MYSPACE --format lines  # one line per page
atlassian-cli confluence page list MYSPACE --parent 12345  # child pages

# Get a page
atlassian-cli confluence page get 67890
atlassian-cli confluence page get 67890 --format json
atlassian-cli confluence page get 67890 --format html  # raw HTML body
atlassian-cli confluence page get 67890 --format markdown  # convert to Markdown
atlassian-cli confluence page get 67890 --format brief  # brief info with ancestry (default)
atlassian-cli confluence page get 67890 -o page.md  # save to file

# Create a page
atlassian-cli confluence page create --space MYSPACE --title "Meeting Notes" --html "<p>Notes here</p>"
atlassian-cli confluence page create --space MYSPACE --title "From File" --html-file content.html
atlassian-cli confluence page create --space MYSPACE --title "From Markdown" --md "# Hello"
atlassian-cli confluence page create --space MYSPACE --title "From Markdown File" --md-file readme.md
atlassian-cli confluence page create --space MYSPACE --title "Subpage" --parent 12345

# Update a page
atlassian-cli confluence page update 67890 --title "Updated Title"
atlassian-cli confluence page update 67890 --html "<p>Updated</p>"
atlassian-cli confluence page update 67890 --html-file updated.html
atlassian-cli confluence page update 67890 --minor-edit

# Move a page
atlassian-cli confluence page move 67890 --parent 99999

# Delete a page (with confirmation)
atlassian-cli confluence page delete 67890

# Search pages with CQL
atlassian-cli confluence page search "deployment guide"
atlassian-cli confluence page search "API" --space TECH
atlassian-cli confluence page search "authentication" --format table
atlassian-cli confluence page search "" --creator me --space Testing  # pages I created
atlassian-cli confluence page search "" --creator "KevinHan" --space Testing  # by user

Attachments

# List attachments on a page
atlassian-cli confluence attachment list 67890

# Upload a file to a page
atlassian-cli confluence attachment upload 67890 ./diagram.png --comment "Architecture diagram"

Configuration

Config is stored at ~/.atlassian-cli/config.json with 600 permissions.

{
  "url": "https://mycompany.atlassian.net",
  "username": "user@example.com",
  "api_token": "your_api_token",
  "cloud": true
}

Environment variables take precedence over the config file:

Variable Description
ATLASSIAN_URL Atlassian instance URL
ATLASSIAN_USERNAME Your email address
ATLASSIAN_API_TOKEN Your API token
ATLASSIAN_CLOUD true (Cloud) or false (Server)

Show current config (token redacted):

atlassian-cli config show

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Lint
ruff check atlassian_cli/

# Format
black atlassian_cli/

# Type check
mypy atlassian_cli/

Project Structure

atlassian-cli/
โ”œโ”€โ”€ atlassian_cli/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py              # CLI entry point & top-level commands
โ”‚   โ”œโ”€โ”€ config.py            # Config file & env var management
โ”‚   โ”œโ”€โ”€ commands/
โ”‚   โ”‚   โ”œโ”€โ”€ jira_commands.py      # All Jira subcommands
โ”‚   โ”‚   โ””โ”€โ”€ confluence_commands.py # All Confluence subcommands
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ client.py        # Atlassian API client factory
โ”‚       โ””โ”€โ”€ formatter.py     # Output formatting helpers
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_cli.py          # Full test suite
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

License

MIT

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

python_atlassian_cli-0.1.1.tar.gz (19.6 kB view details)

Uploaded Source

File details

Details for the file python_atlassian_cli-0.1.1.tar.gz.

File metadata

  • Download URL: python_atlassian_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for python_atlassian_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 99dd1e5a2fd21c3dd49b1a0b6fef8f1378e43d1e03cf3844c34b842297d89d9d
MD5 e60335ebd667f774a0f866641e7686e4
BLAKE2b-256 b3f730fea178810274798c8ec037f6aac9e9e7f2ccd39056509c3b838e3ec187

See more details on using hashes here.

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