Quick Start: CLI
LegacyLegacy SPGCLI (`spgctl`) quick start. For new workflows, use Console or API v2.
Updated: March 5, 2026
SPGCLI (spgctl) is a legacy CLI on top of the Control Plane API. For new user workflows, use Console or REST API; the steps below are kept only for compatibility with existing automation.
1. Configure the environment
export CP_URL="https://<cp-host>"
export SPG99_TOKEN="<api-key>"
2. Create a tenant
spgctl tenant create --name t1
Save the issued pg_user, pg_password, and dsn_template.
3. Create a database
spgctl db create --tenant t1 --name d1 --size L1
In the current managed contract, you should not build the workflow around manual start / stop: the database will start automatically on the first client connection.
4. View the state
spgctl db describe --tenant t1 --db d1
5. Get the DSN and connect
psql "$(spgctl db dsn --tenant t1 --db d1)"
If the database was stopped, the first connection may be slightly slower because of cold start.
6. Cleanup
spgctl db delete --tenant t1 --db d1 --force
If you already have CLI-based automation, the path above still works, but for new processes prefer Console and API.
