Metadata-Version: 2.4
Name: qubecli
Version: 1.0.15
Summary: QubeCore CLI — Command Line Interface for QubeCore
License: MIT License
        
        Copyright (c) 2026 QubeCore Project
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: qubecore-client>=1.0.18
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# QubeCLI

Command Line Interface for QubeCore — Quantum Computing Operating System.

[![PyPI](https://img.shields.io/pypi/v/qubecli)](https://pypi.org/project/qubecli/)
[![Python](https://img.shields.io/pypi/pyversions/qubecli)](https://pypi.org/project/qubecli/)

---

## Installation

```bash
pip install qubecli
```

---

## Quick Start

```bash
qubecore config set host 192.168.1.100:50051   # 서버 주소 저장
qubecore login                                  # 로그인
qubecore submit --circuit '<QASM>' --shots 1000 # 회로 제출
qubecore result --job-id <job_id>               # 결과 확인
```

---

## Commands

### Auth

| 명령어 | 설명 |
|--------|------|
| `qubecore login [--username] [--password]` | 로그인 및 토큰 저장 |
| `qubecore logout` | 로그아웃 |
| `qubecore me` | 현재 로그인 유저 정보 |

### Config

서버 연결 없이 로컬(`~/.qubecore/config.json`)에서 동작합니다.

| 명령어 | 설명 |
|--------|------|
| `qubecore config set host <host:port>` | 서버 주소 저장 |
| `qubecore config get [KEY]` | 저장된 설정 조회 |
| `qubecore config unset <KEY>` | 설정 삭제 |
| `qubecore --host <host:port> <command>` | 해당 실행만 다른 서버로 연결 (저장 안 됨) |
| `qubecore -v` | 버전 출력 |
| `qubecore help` | 전체 명령어 안내 |

### Submit

| 명령어 | 필수 옵션 | 설명 |
|--------|-----------|------|
| `qubecore submit` | `--circuit` `--shots` | 게이트 회로 실행 |
| `qubecore submit-pulse` | `--pulse` `--shots` | 펄스 프로그램 실행 |
| `qubecore submit-reset` | `--qubits` `--shots` | 큐비트 액티브 리셋 |
| `qubecore submit-calibration` | `--calibration-type` `--params` | 캘리브레이션 |
| `qubecore stream` | `--template` `--params` `--shots` | 파라미터 스윕 스트리밍 |

**공통 선택 옵션**

| 옵션 | 설명 |
|------|------|
| `--priority 1-4` | 1=CRITICAL 2=HIGH 3=NORMAL(기본) 4=LOW |
| `--optimization-level 0-3` | 트랜스파일 최적화 레벨 (`submit`, `stream`만 해당) |

**`submit`** — `--circuit`은 QASM 2.0 / QASM 3.0 / JSON 형식 모두 지원 (`OPENQASM 2` 또는 `OPENQASM 3`으로 시작)

**`submit-reset`** — `--qubits`는 콤마로 구분된 큐비트 이름 (`qubit_0,qubit_1`)

**`submit-calibration`** — `--calibration-type`: `widescan` 또는 `punchout` / `--params`: JSON 객체

**`stream`** — `--template`의 `{param}` 플레이스홀더에 `--params` JSON 배열이 순서대로 치환됨

```bash
qubecore stream \
  --template 'OPENQASM 2.0; include "qelib1.inc"; qreg q[1]; creg c[1]; rx({theta}) q[0]; measure q[0]->c[0];' \
  --params '[{"theta": 0.0}, {"theta": 1.5707}, {"theta": 3.1415}]' \
  --shots 200
```

### Backend

| 명령어 | 설명 |
|--------|------|
| `qubecore backend-info` | 백엔드 정보 조회 (이름, 큐비트 수, 커플링 맵, 게이트) |
| `qubecore characterization` | 큐비트 캐릭터라이제이션 조회 (T1, T2, 주파수) |
| `qubecore update-characterization --data <JSON>` | 캐릭터라이제이션 업데이트 (admin) |
| `qubecore update-qchip --updates <JSON>` | QChip 파라미터 업데이트 (admin) |

**`update-characterization`** `--data` 형식:
```json
{"last_calibrated": "2026-05-13T00:00:00Z", "qubits": [{"index": 0, "t1": 1.1e-4, "t2": 9.8e-5, "frequency": 4.85e9}]}
```

**`update-qchip`** `--updates` 형식:
```json
[{"qubit": "qubit_0", "freq": 4.85e9, "readfreq": 6.5e9, "gates": [{"gate_name": "X90", "amp": 0.5, "twidth": 20e-9}]}]
```

### Job

| 명령어 | 필수 옵션 | 설명 |
|--------|-----------|------|
| `qubecore status` | `--job-id` | 잡 상태 확인 |
| `qubecore result` | `--job-id` | 잡 결과 조회 |
| `qubecore cancel` | `--job-id` | 잡 취소 (PENDING 상태만 가능) |
| `qubecore jobs` | — | 내 잡 목록 (`--page`, `--size` 선택) |

---

## Compatibility

| qubecli | qubecore-client | qubecore |
|---------|----------------|----------|
| 1.0.15+ | 1.0.18+ | 1.x |

---

## License

MIT
