Metadata-Version: 2.5
Name: bookai-cli
Version: 0.1.0
Summary: Command-line client for the bookai group-sales back office API
Requires-Python: >=3.9
Requires-Dist: click<9,>=8
Requires-Dist: httpx<1,>=0.27
Requires-Dist: rich>=13
Provides-Extra: dev
Requires-Dist: pytest<9,>=8; extra == 'dev'
Requires-Dist: respx<1,>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# bookai-cli

Command-line client for the bookai group-sales back office API — manage venue
pricing and view confirmed orders from the terminal or a script, instead of
clicking through the admin web app.

This is a thin HTTP client: it talks only to the public, authenticated JSON
API and contains no business logic or backend code.

## Install

```bash
pip install bookai-cli
```

## Authenticate

Ask a venue admin to create an API key for you from the back office (Settings
→ API Keys), then set it as an environment variable:

```bash
export GROUPSALES_API_KEY=gsk_...
```

Or pass it per-command with `--api-key`. By default the CLI talks to
`https://b2b.bookai.now`; override with `--base-url` or `GROUPSALES_BASE_URL`
if you're pointed at a different environment.

Global options (`--api-key`, `--base-url`, `--json`) go **before** the
subcommand: `bookai --json venues list`, not `bookai venues list --json`.

## Usage

```bash
bookai venues list

bookai pricing list <venue_id>
bookai pricing get <venue_id> <rule_id>
bookai pricing set <venue_id> --min-group 10 --max-group 50 --min-price 20 --max-price 30
bookai pricing set <venue_id> --min-group 10 --max-group 50 --min-price 20 --max-price 30 \
    --source acme-isv --external-id acme-rule-42   # tag a rule as synced from an external system
bookai pricing update <venue_id> <rule_id> --min-group 10 --max-group 50 --min-price 18 --max-price 28
bookai pricing delete <venue_id> <rule_id>

bookai orders list
bookai orders list --page 2
```

Add `--json` anywhere for machine-readable output instead of a table — useful
for piping into `jq` or scripting in CI.

## Development

```bash
pip install -e ".[dev]"
pytest
```

Tests are fully offline (HTTP is mocked via `respx`) — no server or database
required.
