Metadata-Version: 2.4
Name: zcp-cli
Version: 0.1.0
Summary: ZCP CLI — deploy apps to the Zamp Control Plane
Project-URL: Homepage, https://github.com/sarafraghav/zcp
Project-URL: Repository, https://github.com/sarafraghav/zcp
Project-URL: Issues, https://github.com/sarafraghav/zcp/issues
Author: Raghav Saraf
License-Expression: MIT
License-File: LICENSE
Keywords: cli,deploy,paas,zamp,zcp
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.10
Requires-Dist: httpx>=0.28
Description-Content-Type: text/markdown

# zcp-cli

CLI for deploying apps to the [Zamp Control Plane](https://github.com/sarafraghav/zcp).

ZCP provisions databases (Neon Postgres), caches (Upstash Redis), and compute (Modal) from a single `zcp.json` manifest — no infra credentials needed on your machine.

## Install

```bash
pip install zcp-cli
```

## Quick start

```bash
# 1. Login with your API token (grab it from the ZCP dashboard)
zcp login --token zcp_...

# 2. Deploy (reads zcp.json in current directory)
zcp deploy

# Or point to a specific manifest
zcp deploy --file path/to/zcp.json --org-slug my-org
```

## Commands

### `zcp login`

Save your API token locally (`~/.zcp/config.json`, chmod 600).

```
zcp login --token <API_KEY> [--api-url https://your-zcp-server.com]
```

| Flag | Default | Description |
|------|---------|-------------|
| `--token` | (required) | API key from ZCP dashboard |
| `--api-url` | `http://localhost:8000` | ZCP server URL |

You can also set `ZCP_API_TOKEN` and `ZCP_API_URL` environment variables.

### `zcp deploy`

Package your app source and deploy via the ZCP server.

```
zcp deploy [--file PATH] [--org-slug SLUG]
```

| Flag | Default | Description |
|------|---------|-------------|
| `--file` | `./zcp.json` | Path to manifest |
| `--org-slug` | `name` from manifest | Target organization |

The CLI zips your source (excluding `node_modules`, `.git`, `.venv`, etc.), uploads it along with the manifest, and the server handles provisioning and deployment.

## `zcp.json` manifest

```json
{
  "name": "myapp",
  "services": [
    { "id": "db", "type": "postgres" },
    { "id": "cache", "type": "redis" },
    {
      "id": "api",
      "type": "web",
      "runtime": "python",
      "start": "gunicorn app:app --bind 0.0.0.0:5001",
      "port": 5001,
      "env": [
        { "name": "DATABASE_URL", "fromService": { "id": "db", "value": "connectionString" } },
        { "name": "REDIS_URL", "fromService": { "id": "cache", "value": "connectionString" } }
      ]
    }
  ]
}
```

## License

MIT
