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.

backupSee a backup list, start a new backup, or retrieve a token to view backups in storage
createCreate a new cluster, fork, or replica. Input platform, zone, and machine specifications to create a new cluster
destroyDelete a cluster
detachDetach a cluster
firewallManage firewall rules
helpShows the help
infoDetailed cluster info including plan, region, network, and firewall
listList the active clusters for all teams in your account
logdestView or update the log destinations for a cluster
loginStore your application ID and application secret for a session in the CLI
logoutRemove stored API key and tokens
logsView live cluster logs
maintenanceView or modify cluster maintenance information
psqlInput the cluster id to connect to cluster with psql as postgres user
renameChange a cluster name
restartRestart a cluster
resumeResume a suspended cluster
roleManage cluster roles
scopeRun a helpful set of queries to get insights into your cluster and database health
suspendSuspend a cluster's operations while saving the database in storage
tailscaleManage Tailscale configuration
teamManage teams
team-memberManage team members
teamcertShow the certificate for a team, which can be used to check certificates
tokenReturns a token that is required for use when interacting with the API. Read more about tokens in the API docs
upgradeManage a cluster upgrade
uriDisplay connection URI for a cluster
versionShow the version and last updated date of the CLI tool
whoamiShow 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.

  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
  9 – Duplicate indexes
  10 – List of indexes
  11 – Unused indexes
  12 – Blocking queries
  13 – Available extensions
  14 – Installed extensions

Choosing a number will run that query against your database.