Skip to main content

Python async wrapper for Atlassian CLI (acli)

Project description

pyacli

Python async wrapper for Atlassian CLI (acli). Subprocess로 acli를 호출하고 --json 출력을 Pydantic 모델로 반환합니다.

설치

pip install atlassian-acli

환경변수

ATLASSIAN_SITE=your-site.atlassian.net
ATLASSIAN_EMAIL=user@example.com
ATLASSIAN_API_TOKEN=your-api-token
PYACLI_DEFAULT_PROJECT=WNVO
PYACLI_EPIC_MAP=frontend:WNVO-9,backend:WNVO-23,ai:WNVO-24

acli 바이너리가 필요합니다: brew tap atlassian/homebrew-acli && brew install acli

사용법

import asyncio
from pyacli import JiraClient

async def main():
    # env에서 자동 로드: PYACLI_DEFAULT_PROJECT, PYACLI_EPIC_MAP
    client = JiraClient()

    # 프로젝트 목록 조회
    projects = await client.list_projects()

    # 에픽 이름으로 이슈 생성 (epic map 사용)
    issue = await client.create_issue(
        summary="로그인 에러 수정",
        epic="frontend",            # → WNVO-9 밑에 생성
        labels=["bug", "backend"],
    )
    print(issue.key)  # WNVO-111
    print(issue.url)  # https://site.atlassian.net/browse/WNVO-111

    # 다른 에픽에 이슈 생성
    await client.create_issue(
        summary="API 에러 처리",
        epic="backend",             # → WNVO-23 밑에 생성
    )

    # 에픽 키를 직접 지정하는 것도 가능 (parent= 우선)
    await client.create_issue(
        summary="특수한 작업",
        parent="WNVO-24",          # 직접 에픽 키 지정
    )

    # 작업 밑에 하위작업 생성
    subtask = await client.create_issue(
        summary="UI 구현",
        issue_type="하위 작업",
        parent="WNVO-111",         # 작업 키
    )

    # 이슈 조회
    issue = await client.get_issue("WNVO-111")

    # 에픽의 하위 이슈 검색
    issues = await client.search_issues(
        jql="project = WNVO AND parent = WNVO-9",
    )

    # 상태 변경
    await client.transition_issue("WNVO-111", status="완료")

    # 등록된 에픽 목록 확인
    print(client.epics)
    # {"frontend": "WNVO-9", "backend": "WNVO-23", "ai": "WNVO-24"}

asyncio.run(main())

Jira 계층 구조

Project (WNVO)
├── [에픽] 기능구현-프론트 1차          ← parent 없이 생성
│   ├── [작업] 로그인 에러 수정         ← parent = 에픽 키
│   │   ├── [하위작업] UI 구현         ← parent = 작업 키
│   │   └── [하위작업] API 연동
│   └── [작업] 회원가입 구현
└── [에픽] 기능구현-백엔드 1차
레벨 이슈 타입 parent
최상위 에픽 없음
중간 작업 에픽 키
최하위 하위 작업 작업 키

Pydantic 입력 모델

파라미터가 많을 때 Request 모델을 사용할 수 있습니다:

from pyacli import JiraClient, CreateIssueRequest

client = JiraClient(project="WNVO")

req = CreateIssueRequest(
    summary="복잡한 이슈",
    description="상세 설명",
    type="Bug",
    assignee="user@example.com",
    labels=["bug", "urgent"],
    parent="WNVO-9",
)
issue = await client.create_issue(request=req)

MCP 서버

Claude Desktop/Claude Code에서 pyacli API 사용법을 조회할 수 있는 MCP 서버가 포함되어 있습니다.

{
  "mcpServers": {
    "pyacli": {
      "command": "python",
      "args": ["-m", "pyacli.mcp"]
    }
  }
}

제공 도구:

  • list_methods — JiraClient 메서드 목록
  • get_method_info — 메서드 시그니처, 파라미터, 설명
  • get_models — Pydantic 모델 JSON Schema

Docker

FROM your-org/pyacli:0.1
COPY . /app
RUN pip install -r requirements.txt
CMD ["python", "main.py"]
services:
  app:
    image: your-org/pyacli:0.1
    environment:
      - ATLASSIAN_SITE=${ATLASSIAN_SITE}
      - ATLASSIAN_EMAIL=${ATLASSIAN_EMAIL}
      - ATLASSIAN_API_TOKEN=${ATLASSIAN_API_TOKEN}
      - PYACLI_DEFAULT_PROJECT=${PYACLI_DEFAULT_PROJECT}
      - PYACLI_EPIC_MAP=${PYACLI_EPIC_MAP}

인증

환경 방식
로컬 개발 acli jira auth login --web (브라우저)
Docker / CI 환경변수 → 자동 로그인

기술 스택

  • Python 3.11+
  • Pydantic v2
  • MCP SDK
  • Poetry
  • acli CLI

라이선스

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

atlassian_acli-0.1.4.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

atlassian_acli-0.1.4-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file atlassian_acli-0.1.4.tar.gz.

File metadata

  • Download URL: atlassian_acli-0.1.4.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure

File hashes

Hashes for atlassian_acli-0.1.4.tar.gz
Algorithm Hash digest
SHA256 72ba9d0b8910a518c7dae1945ae9b6559088d159c8ffee63b83fe40c553ab4dd
MD5 ba65c5f661d49f2e18112379c565deb4
BLAKE2b-256 2a9bd3daff4ade488d6d1971b7166cf835c9b00baf636a2438f7dc59025c4f42

See more details on using hashes here.

File details

Details for the file atlassian_acli-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: atlassian_acli-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure

File hashes

Hashes for atlassian_acli-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cc318005f8ff7a51a459cc1d62618e075558853a9c72fbed5c2fe143eaeeeb85
MD5 8d35678c3b0794839a1ff475ad709ac6
BLAKE2b-256 45c86a8a12196dd40d38ffc5c17fde4026ccb40e62678604b1c5ffadeec72622

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