Skip to content

hanzhichao/atlassian-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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 (assigned to me by default / 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 (Tip: use 'jira project types PROJ' to see valid names/IDs)
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 \
  --field "Team=W-team" \               # Custom fields (Team, etc.)
  --link "blocks=PROJ-100"              # Issue links
  --link "relates=PROJ-200"

# 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, or -y to skip)
atlassian-cli jira issue delete PROJ-123
atlassian-cli jira issue delete PROJ-123 -y  # skip confirmation

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

# List valid issue types and IDs for a project
atlassian-cli jira project types 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

About

A powerful command-line tool for managing Jira and Confluence

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors