Metadata-Version: 2.4
Name: runtimecomputer-cli
Version: 0.1.0
Summary: RuntimeComputer CLI.
Requires-Python: >=3.13
Requires-Dist: runtimesdk<1,>=0.2.3
Requires-Dist: websockets<16,>=15
Description-Content-Type: text/markdown

# RuntimeComputer CLI

This package provides the `runtime` command-line interface.

Current commands:

- `runtime create <name>`
- `runtime console <name>`
- `runtime list`
- `runtime route <name>`
- `runtime share <name> [--public | --creator | --shared]`
- `runtime services <name>`
- `runtime service add <name> <service-name> --command ...`
- `runtime service delete <name> <service-name>`
- `runtime wake <name>`
- `runtime stop <name>`
- `runtime delete <name>`
- `runtime resolve <host>`

The CLI talks to the Django control plane over HTTP for control-plane requests
and over WebSockets for interactive console sessions.

Current auth note:

- `create`, `list`, `route`, `share`, `wake`, `stop`, and `delete` require `--auth-token` or `RUNTIMECOMPUTER_AUTH_TOKEN`
- the normal local flow is `runtime login`, which opens the Clerk-backed browser confirmation flow and stores `RUNTIMECOMPUTER_AUTH_TOKEN` locally
- `runtime resolve` is an operator/debug command. It requires the internal edge
  token via `--edge-token` or `RUNTIMECOMPUTER_EDGE_TOKEN`.

## Development

Install dependencies:

```bash
cd cli
uv sync
```

Run tests:

```bash
uv run python -m unittest discover -s tests
```

Examples:

```bash
uv run runtime login --api-origin http://127.0.0.1:8000
uv run runtime create my-app --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
printf 'pwd\nexit\n' | uv run runtime console my-app --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
uv run runtime share my-app --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
uv run runtime service add my-app web --command python --arg=-m --arg http.server --arg 3000 --port 3000 --cwd /workspace --env PORT=3000 --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
uv run runtime services my-app --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
uv run runtime list --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
uv run runtime delete my-app --api-origin http://127.0.0.1:8013 --auth-token "$RUNTIMECOMPUTER_AUTH_TOKEN"
uv run runtime resolve my-app.runruntime.dev --api-origin http://127.0.0.1:8013 --edge-token "$RUNTIMECOMPUTER_EDGE_TOKEN"
```
