Metadata-Version: 2.4
Name: qubi-cli
Version: 0.3.6
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, deploy workflows, and install AI skills from the command line.

## Install

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

For automated browser login (recommended):

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

## Quick Start

```bash
# First-time setup
qubi skills install   # Install qubi skills for Claude Code
qubi login            # Authenticate (prompts credentials once, then automated)

# Manage workflows
qubi flow list
qubi flow validate my_workflow.json
qubi flow save my_workflow.json --workflow-id <id>
qubi flow get <workflow-id>

# Discover platform resources
qubi agents list
qubi rpa list
```

## Skills

qubi skills teach AI coding agents (Claude Code) how to build, validate, and deploy qubi Agentic Flows — including generating workflow JSON from client documents like PDDs, SDDs, and BRDs.

```bash
# Install skills into Claude Code (~/.claude/skills/)
qubi skills install

# List installed skills
qubi skills list

# Update to latest
qubi skills update

# Remove all skills
qubi skills uninstall
```

After installing, Claude Code automatically uses qubi skills when relevant. Drop a PDD, SDD, or BRD into Claude Code and it will generate valid qubi workflow JSON.

## Commands

| Command | Purpose |
|---------|---------|
| **Skills** | |
| `qubi skills install` | Download and install qubi skills for Claude Code |
| `qubi skills list` | List installed skills |
| `qubi skills update` | Update skills to latest version |
| `qubi skills uninstall` | Remove all installed skills |
| **Auth** | |
| `qubi login` | Authenticate (automated browser login) |
| `qubi login --headed` | Login with visible browser (debugging) |
| `qubi login --no-browser` | Direct API login (no Playwright) |
| `qubi logout` | Clear session |
| `qubi status` | Show login status |
| **Workflows** | |
| `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 |
| **Resources** | |
| `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 automate the full OAuth2 flow headlessly. If Chromium isn't installed, it auto-installs it for you.

## 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 |

## How It All Works Together

```
┌─────────────────────────────────────────────────────┐
│  Client gives you a PDD / SDD / BRD                 │
└──────────────────────┬──────────────────────────────┘
                       ▼
┌─────────────────────────────────────────────────────┐
│  Claude Code (with qubi skills installed)            │
│  Reads the document → generates workflow JSON        │
└──────────────────────┬──────────────────────────────┘
                       ▼
┌─────────────────────────────────────────────────────┐
│  qubi flow validate workflow.json                    │
│  qubi flow save workflow.json -w <id>               │
│  → Deployed to qubi platform                        │
└─────────────────────────────────────────────────────┘
```

## License

MIT
