CLI
For help getting started with the CLI see the quickstart guide.
Available CLI Commands
You can find the full directory of commands on the CLI with cb --help.
| Command | Description |
|---|---|
| backup | See a backup list, start a new backup, or retrieve a token to view backups in storage |
| config-param | Manage configuration parameters |
| create | Create a new cluster, fork, or replica. Input platform, zone, and machine specifications to create a new cluster |
| destroy | Delete a cluster |
| detach | Detach a cluster |
| firewall | Manage firewall rules |
| help | Shows the help |
| info | Detailed cluster info including plan, region, network, and firewall |
| list | List the active clusters for all teams in your account |
| logdest | View or update the log destinations for a cluster |
| login | Store your application ID and application secret for a session in the CLI |
| logout | Remove stored API key and tokens |
| logs | View live cluster logs |
| maintenance | View or modify cluster maintenance information |
| network | Manage networks |
| psql | Input the cluster id to connect to cluster with psql as postgres user |
| rename | Change a cluster name |
| restart | Restart a cluster |
| resume | Resume a suspended cluster |
| role | Manage cluster roles |
| scope | Run a helpful set of queries to get insights into your cluster and database health |
| suspend | Suspend a cluster's operations while saving the database in storage |
| tailscale | Manage Tailscale configuration |
| team | Manage teams |
| team-member | Manage team members |
| teamcert | Show the certificate for a team, which can be used to check certificates |
| token | Returns a token that is required for use when interacting with the API. Read more about tokens in the API docs |
| upgrade | Manage a cluster upgrade |
| uri | Display connection URI for a cluster |
| version | Show the version and last updated date of the CLI tool |
| whoami | Show information about the currently logged in CLI user |
psql :menu
We have also created some preset queries in your psql when you connect with
cb. To access these saved queries, you will connect to your database with
cb psql <database> and then use :menu to show the menu of available queries.
These are the current menu queries.
Cache
1 – Cache and index hit rates
Size Information
2 – Database sizes
3 – Table sizes
Query Performance
4 – Queries consuming the most system time
5 – Queries running over 1 minute
6 – Slowest average queries
Connection Management
7 – Connection count by state
8 – Connection count by user and application
Indexes
9 – Duplicate indexes
10 – List of indexes
11 – Unused indexes
Locks
12 – Blocking queries
Extensions
13 – Available extensions
14 – Installed extensionsChoosing a number will run that query against your database.