Metadata-Version: 2.4
Name: opendraft-cli
Version: 0.1.0
Summary: Command-line interface for OpenDraft screenwriting platform
Project-URL: Homepage, https://github.com/Proteus-Technologies-Private-Limited/OpenDraft
Project-URL: Repository, https://github.com/Proteus-Technologies-Private-Limited/OpenDraft
Project-URL: Bug Tracker, https://github.com/Proteus-Technologies-Private-Limited/OpenDraft/issues
Author-email: Proteus Technologies <hello@opendraft.app>
License: MIT
Keywords: cli,fountain,opendraft,screenplay,screenwriting
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Artistic Software
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: click>=8.0
Requires-Dist: httpx>=0.27
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# opendraft-cli

Command-line interface for [OpenDraft](https://github.com/Proteus-Technologies-Private-Limited/OpenDraft) — the open-source screenwriting platform.

Manage projects, scripts, versions, exports, collaboration, and formatting templates directly from your terminal or AI agent (Claude Code / OpenClaw).

## Installation

```bash
pip install opendraft-cli
```

## Requirements

- Python 3.10+
- OpenDraft backend running (locally or remote)

## Quick Start

```bash
# Point at your OpenDraft backend (default: http://localhost:8000)
export OPENDRAFT_URL=http://localhost:8000

# List projects
opendraft --json projects list

# Create a project
opendraft --json projects create --name "My Screenplay"

# Create a script inside that project
opendraft --json scripts create <project-id> --title "Act One"

# Check in a version
opendraft --json versions checkin <project-id> --message "First draft"

# Export to Fountain
opendraft --json export fountain <script-id>
```

> **Note:** `--json` is a root-level flag and must come **before** the subcommand.
> `opendraft --json projects list` ✓  
> `opendraft projects list --json` ✗

## Command Reference

| Group | Commands |
|-------|----------|
| `projects` | `list` `create` `get` `update` `delete` |
| `scripts` | `list` `create` `get` `update` `duplicate` `delete` |
| `versions` | `list` `checkin` `diff` `restore` |
| `export` | `fountain` `pdf` `fdx` |
| `collab` | `invite` `sessions` `revoke` `revoke-all` |
| `templates` | `list` `create` `get` `update` `delete` `set-element` |

Run `opendraft --help` or `opendraft <group> --help` for full options.

## Output Format

All commands support `--json` for machine-readable output:

```json
{"ok": true, "data": {...}}
{"ok": false, "error": "Not found", "code": 404}
```

Human-readable output (default) uses rich tables and colored text.

## Configuration

| Env Var | Default | Description |
|---------|---------|-------------|
| `OPENDRAFT_URL` | `http://localhost:8000` | Backend base URL |

## AI Agent Integration

See [SKILL.md](SKILL.md) for Claude Code / OpenClaw integration instructions.

## License

MIT
