CLI reference
The comwit CLI is the command-line tool for Comwit Cloud. You use it from your
terminal to log in, deploy runtime apps, create databases, and manage project
domains and DNS records.
Under the hood every command talks to the public platform API at
https://api.cloud.comwit.io. The CLI never calls cloud infrastructure
directly, so anything you can do here you could also do with a plain HTTP
request — each section below shows the matching API route.
Install
Section titled “Install”The fastest way to get the CLI is the install script:
scripts/install-comwit.shThe installer first tries to download a GitHub release asset named like
comwit_<os>_<arch>.tar.gz. Until releases exist, it falls back to building the
CLI from the current checkout and installs the binary to ~/.local/bin/comwit.
You can influence the installer with environment variables:
COMWIT_VERSION=v0.1.0 scripts/install-comwit.shCOMWIT_INSTALL_DIR=/usr/local/bin scripts/install-comwit.shCOMWIT_INSTALL_REPO=comwit/comwit-cloud scripts/install-comwit.sh| Variable | What it does |
|---|---|
COMWIT_VERSION | Pin the release tag to download instead of the latest. |
COMWIT_INSTALL_DIR | Install the binary somewhere other than ~/.local/bin. |
COMWIT_INSTALL_REPO | Point the installer at a different GitHub repository. |
Build from source
Section titled “Build from source”If you are working from a checkout of the repository, you can build the CLI
directly. The source lives in tools/comwit.
just cli-testjust cli-build./dist/comwit versionAuthentication
Section titled “Authentication”Before any project command works you need to log in. The CLI stores a personal
access token (a cwt_ token) and uses it on every request.
comwit login # device flow (recommended)comwit login --project <project-id>comwit login --token <token> # paste an existing PATcomwit login --token <token> --project <project-id>comwit login with no token runs the device authorization flow: it opens
your browser so you can approve a short code, then stores the issued cwt_
token for you.
You can also paste a cwt_ personal access token that you created from the
dashboard at cloud.comwit.io/tokens (“API tokens”). The plaintext token is
shown only once at creation, so copy it then. Revoke a token from the same
dashboard page.
Your token is scoped to the projects you can access, so apps, deploy, and
databases only act on those projects — anything else returns HTTP 403.
Configuration and environment
Section titled “Configuration and environment”| Setting | Default / variable | Purpose |
|---|---|---|
| Token config file | ~/.config/comwit/config.json | Where the issued cwt_ token is stored. |
COMWIT_CONFIG | (overrides the path above) | Use a different config file location. |
COMWIT_PROJECT | (overrides the default) | Default project for commands that accept --project. |
The CLI always targets https://api.cloud.comwit.io. Local AWS, Louhi
management, brrrd-control, and registry calls are outside the CLI contract.
See Authentication for token scopes and details.
Projects
Section titled “Projects”comwit projects listMost other commands take a --project <project-id> flag (or read
COMWIT_PROJECT) to choose which project to act on.
Runtime apps
Section titled “Runtime apps”Runtime apps are the deployable services in a project. You list them, create them, push a deployment, and inspect builds.
comwit apps list --project <project-id>comwit apps create --project <project-id> --name webcomwit deploy --project <project-id> --app <app-id> --package ./apps/web/dist/brrrdcomwit apps builds --project <project-id> --app <app-id>Deploy
Section titled “Deploy”The deploy command accepts either a prebuilt package file or a brrrd output
directory. When you point --package at a directory, the CLI uses local
tar --zstd to create a temporary .tar.zst archive for upload.
Deploy also accepts several optional flags:
comwit deploy \ --project <project-id> \ --app <app-id> \ --package ./dist/brrrd \ --host app.example.com \ --env-ref brrrd/env/app \ --max-concurrent-requests 100| Flag | Required | Purpose |
|---|---|---|
--project | yes | Project that owns the app. |
--app | yes | App to deploy to. |
--package | yes | Prebuilt package file, or a brrrd output directory to archive and upload. |
--host | no | Hostname to serve this deployment on. |
--env-ref | no | Reference to the environment configuration to apply. |
--max-concurrent-requests | no | Cap on concurrent requests for the deployment. |
Domains
Section titled “Domains”Project-domain commands manage delegated DNS through the platform API using your
cwt_ token. The CLI never calls AWS directly.
comwit domains list --project <project-id>comwit domains add --project <project-id> --domain example.comcomwit domains check --project <project-id> --domain example.comcomwit domains delete --project <project-id> --domain example.com| Command | What it does |
|---|---|
domains add | Creates a Route 53 public hosted zone through platform-api and prints the nameservers you must set at your current registrar. |
domains check | Asks platform-api to resolve authoritative NS records and report whether the domain is managed. |
domains delete | Removes a domain from Comwit management. Platform-api deletes active Route 53 records (including platform-owned app records), then deletes the hosted zone and soft-deletes product state. |
See Bring your own domain for the end-to-end setup flow.
DNS records
Section titled “DNS records”DNS record management uses nested commands under domains records.
comwit domains records list --project <project-id> --domain example.comcomwit domains records create \ --project <project-id> \ --domain example.com \ --name www \ --type CNAME \ --value target.example.net \ --ttl 300comwit domains records update \ --project <project-id> \ --domain example.com \ --record <record-id> \ --value target2.example.net \ --ttl 300comwit domains records delete \ --project <project-id> \ --domain example.com \ --record <record-id>Record flags
Section titled “Record flags”| Flag | Used by | Purpose |
|---|---|---|
--name | create, update | Record name (e.g. www). Loaded from the existing record on update if omitted. |
--type | create, update | Record type (e.g. CNAME). Loaded from the existing record on update if omitted. |
--value | create, update | Record value(s). Supplying one or more replaces the record values. |
--ttl | create, update | Time-to-live in seconds. Loaded from the existing record on update if omitted. |
--record | update, delete | Record id to target. |
Scopes and locking
Section titled “Scopes and locking”Required scopes are domain:read for list and read operations, and
domain:write for add, check, create, update, and delete.
Domain purchase is not in the CLI
Section titled “Domain purchase is not in the CLI”Domain purchase commands are intentionally not part of the CLI until Route 53 Domains billing, contact, auto-renew, and transfer-out policy is implemented.
Databases
Section titled “Databases”comwit databases create --project <project-id> --name productioncomwit databases list --project <project-id>These commands call the project-scoped database routes through platform-api and print the database id, status, and URL. Databases created from the CLI also appear in the dashboard.
See Create and connect a database for how to get a connection string and start running SQL.
API routes used by the CLI
Section titled “API routes used by the CLI”Every command above maps to a route on the public, project-shaped platform API. If you prefer to call the API directly, these are the routes the CLI uses:
GET /v1/projects/{projectId}/appsPOST /v1/projects/{projectId}/appsPOST /v1/projects/{projectId}/apps/{appId}/deploymentsGET /v1/projects/{projectId}/apps/{appId}/buildsGET /v1/projects/{projectId}/domainsPOST /v1/projects/{projectId}/domainsGET /v1/projects/{projectId}/domains/{domain}DELETE /v1/projects/{projectId}/domains/{domain}POST /v1/projects/{projectId}/domains/{domain}/delegation-checkGET /v1/projects/{projectId}/domains/{domain}/recordsPOST /v1/projects/{projectId}/domains/{domain}/recordsPUT /v1/projects/{projectId}/domains/{domain}/records/{recordId}DELETE /v1/projects/{projectId}/domains/{domain}/records/{recordId}| CLI command | Route |
|---|---|
apps list | GET /v1/projects/{projectId}/apps |
apps create | POST /v1/projects/{projectId}/apps |
deploy | POST /v1/projects/{projectId}/apps/{appId}/deployments |
apps builds | GET /v1/projects/{projectId}/apps/{appId}/builds |
domains list | GET /v1/projects/{projectId}/domains |
domains add | POST /v1/projects/{projectId}/domains |
domains check | POST /v1/projects/{projectId}/domains/{domain}/delegation-check |
domains delete | DELETE /v1/projects/{projectId}/domains/{domain} |
domains records list | GET /v1/projects/{projectId}/domains/{domain}/records |
domains records create | POST /v1/projects/{projectId}/domains/{domain}/records |
domains records update | PUT /v1/projects/{projectId}/domains/{domain}/records/{recordId} |
domains records delete | DELETE /v1/projects/{projectId}/domains/{domain}/records/{recordId} |
For more on the API itself, see the API overview and Authentication.