Metadata-Version: 2.4
Name: qubi-cli
Version: 0.3.0
Summary: CLI for qubi Agentic Flows — validate, save, and deploy workflows
Project-URL: Homepage, https://github.com/Qbotica/qubi-cli
Project-URL: Documentation, https://github.com/Qbotica/qubi-cli#readme
Project-URL: Repository, https://github.com/Qbotica/qubi-cli
Project-URL: Issues, https://github.com/Qbotica/qubi-cli/issues
Author-email: Qbotica <dev@qbotica.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agentic,automation,cli,qubi,rpa,workflows
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.9
Requires-Dist: click>=8.0.0
Requires-Dist: requests>=2.28.0
Provides-Extra: browser
Requires-Dist: playwright>=1.40.0; extra == 'browser'
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: responses; extra == 'dev'
Description-Content-Type: text/markdown

# qubi-cli

CLI for [qubi Agentic Flows](https://agenthub.qubi.com) — validate, save, and deploy workflows from the command line.

## Install

```bash
pip install qubi-cli
```

For automated browser login (recommended):

```bash
pip install 'qubi-cli[browser]'
playwright install chromium
```

## Quick Start

```bash
# Login (prompts for credentials once, then fully automated)
qubi login

# List workflows
qubi flow list

# Validate a workflow JSON file
qubi flow validate my_workflow.json

# Push a workflow to the platform
qubi flow save my_workflow.json --workflow-id <id>

# Download a workflow
qubi flow get <workflow-id>

# List available AI agents
qubi agents list
```

## Commands

| Command | Purpose |
|---------|---------|
| `qubi login` | Authenticate (automated browser login) |
| `qubi login --headed` | Login with visible browser (debugging) |
| `qubi logout` | Clear session |
| `qubi status` | Show login status |
| `qubi flow list` | List all workflows |
| `qubi flow validate <file>` | Validate workflow JSON offline |
| `qubi flow get <id>` | Download a workflow |
| `qubi flow save <file> -w <id>` | Push workflow to qubi |
| `qubi flow run <id>` | Execute a workflow |
| `qubi flow use <#>` | Select workflow by list number |
| `qubi agents list` | List AI agents |
| `qubi rpa list` | List RPA automations |

## Authentication

On first run, `qubi login` prompts for your credentials and stores them at `~/.qubi/.env`. After that, login is fully automated — no password prompts.

The CLI uses Playwright to navigate the full OAuth2 flow headlessly and capture the correct session cookies.

## Workflow Format

Workflows are JSON graphs (React Flow format):

```json
{
  "nodes": [
    { "id": "uuid", "type": "Start", "position": {"x": 100, "y": 200}, "data": {"type": "Start", "name": "Start"} },
    { "id": "uuid", "type": "Http", "position": {"x": 300, "y": 200}, "data": {"type": "Http", "name": "Fetch", "method": "GET", "url": "https://..."} },
    { "id": "uuid", "type": "End", "position": {"x": 500, "y": 200}, "data": {"type": "End", "name": "End"} }
  ],
  "edges": [
    { "id": "xy-edge__src-tgt", "source": "node1-id", "target": "node2-id" }
  ],
  "viewport": { "x": 0, "y": 0, "zoom": 1 },
  "executionMode": "Sequential"
}
```

## Node Types

| Type | What It Does |
|------|-------------|
| Start | Entry point |
| End | Exit point |
| Agent | Calls an AI agent |
| Http | HTTP request |
| Code | JavaScript or Python |
| Branch | Conditional routing |
| Assign | Set variables |
| RPA | Desktop automation |
| DocumentAI | Document processing |
| Hitl | Human-in-the-loop |
| HitlTask | Structured human task |
| JsonParser | Parse JSON |
| TextParser | Regex extraction |

## License

MIT
