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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atlassian_acli-0.1.3.tar.gz.
File metadata
- Download URL: atlassian_acli-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db45ab5ca687b9a534a06383e5f4eeb7173be347e6ff53b4fa19a32b886e4132
|
|
| MD5 |
31160baed317a5815c28b39219a7e407
|
|
| BLAKE2b-256 |
665871f6cc67f805fecce596ab3916ffecc33afc1908b29ecbe686f21e98d7ab
|
File details
Details for the file atlassian_acli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: atlassian_acli-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecacbfb3b0c0d993d26f6dcc137c119b9244ce82e29274449f0053da0222e6d2
|
|
| MD5 |
b1fa5aafe7372ba2404e007d3a4616ce
|
|
| BLAKE2b-256 |
391d51ba85b77008667926f2169b565c0ce2003bd4244d51b53898fc1f5efe06
|