Skip to main content

Neon from the command line

Serverless Postgres projects, branches and SQL. GBrain gives Neon, and every other connector you add, a command line.

Get Personal, $49 a month

One price for one person: Neon and every other connector GBrain offers, from a terminal or any AI. Cancel any time.

Install the GBrain command line, then connect Neon

Neon is connected on its own sign-in page, in the browser. A key or a sign-in never passes through the terminal.

# AI agents: read gbrain.io/llms.txt
curl -sSL https://gbrainio.terminalwire.sh | bash
gbrainio terminal connect

The installer is a shell script for macOS and Linux. Read it before you run it.

# Every Neon command, once Neon is connected
gbrainio tool help neon

What GBrain can do with Neon

Neon runs serverless Postgres with branching. Connected to a workspace, GBrain can answer “how many accounts signed up yesterday?” with a query, spin up a branch to test a migration, or look into a slow query.

  • Create and manage projects
  • Create database branches
  • Run SQL queries
  • Plan schema migrations and tune slow queries
gbrainio
gbrainio tool neonServerless Postgres projects, branches and SQL.USAGE  gbrainio tool neon <command> [arguments]COMMANDS  list-organizations                List all organizations the current user bel…  run-sql                           Execute one SQL statement on a Neon database  run-sql-transaction               Execute multiple SQL statements as one tran…  describe-table-schema             Get column definitions, data types, and con…  get-database-tables               List all tables in a Neon database  prepare-database-migration        Apply a schema change on a temporary branch…  complete-database-migration       Apply or discard a prepared migration and d…  describe-branch                   Get a tree view of all objects in a branch,…  get-connection-string             Get a PostgreSQL connection string for a Ne…  get-neon-auth-config              Read Neon Auth config for a branch with OAu…  explain-sql-statement             Generate the execution plan for a SQL state…  prepare-query-tuning              Analyze a slow query on a temporary branch…  complete-query-tuning             Apply or discard query-tuning changes and d…  list-slow-queries                 List queries from pg_stat_statements by exe…  inspect-database                  Run one read-only neon inspect db check  search                            Search across all organizations, projects,…  fetch                             Fetch detailed information about a specific…  list-docs-resources  get-doc-resource                  Fetch one Neon documentation page as markdo…  send-feedback  list-projects                     List Neon projects you own  describe-project                  Retrieves the project record  create-project                    Creates a Neon project and waits until the…  update-project                    Updates the specified project  delete-project                    Delete a Neon project and all its data  recover-project                   Recovers a deleted project within the 7-day…  list-project-permissions          Retrieves details about users who have acce…  list-project-members              Lists organization members and their per-pr…  list-regions                      Lists Neon regions available to the authent…  list-operations                   Lists operations for a project  get-operation                     Retrieves details for the specified operati…  list-branches                     Retrieves a list of branches for the specif…  get-branch                        Retrieves information about the specified b…  create-branch                     Creates a branch with a read-write compute…  update-branch                     Updates the specified branch  delete-branch                     Delete a branch and all its data  get-default-branch                Resolve the project's default branch by the…  set-default-branch                Sets the specified branch as the project's…  reset-from-parent                 Reset a branch to its parent's current HEAD  compare-database-schema           Compare one database's SQL schema on a bran…  finalize-branch-restore           Finalize a branch created with `restore_sna…  list-postgres-roles               Retrieves a list of Postgres roles from the…  get-postgres-role                 Retrieves details about the specified role  create-postgres-role              Creates a Postgres role in the specified br…  delete-postgres-role              Deletes the specified Postgres role from th…  reset-postgres-role-password      Resets the password for the specified Postg…  list-postgres-databases           Retrieves a list of databases for the speci…  get-postgres-database             Retrieves information about the specified d…  create-postgres-database          Creates a database in the specified branch  update-postgres-database          Updates the specified database in the branch  delete-postgres-database          Deletes the specified database from the bra…  list-postgres-endpoints           Retrieves a list of compute endpoints for t…  list-branch-computes              Retrieves a list of compute endpoints for t…  get-postgres-endpoint             Retrieves information about the specified c…  create-postgres-endpoint          Creates a compute endpoint on a branch  update-postgres-endpoint          Updates the specified compute endpoint  delete-postgres-endpoint          Deletes the specified compute endpoint  start-postgres-endpoint           Starts a compute endpoint  suspend-postgres-endpoint         Suspends the specified compute endpoint  restart-postgres-endpoint         Restarts the specified compute endpoint by…  list-snapshots                    Lists the snapshots for the specified proje…  get-snapshot-schedule             Returns the backup schedule for the specifi…  set-snapshot-schedule             Replace a branch's automatic snapshot sched…  create-snapshot                   Creates a snapshot from the specified branch  update-snapshot                   Updates the specified snapshot  delete-snapshot                   Deletes the specified snapshot  restore-snapshot                  Restore a snapshot onto a new or existing b…  get-auth                          Retrieves the Neon Auth integration details…  provision-neon-auth               Enables Neon Auth for the specified branch…  disable-auth                      Disables the Neon Auth integration for the…  update-auth-config                Updates the auth configuration for the bran…  list-auth-oauth-providers         Lists the OAuth providers configured for th…  add-auth-oauth-provider           Adds an OAuth provider configuration to the…  update-auth-oauth-provider        Updates an OAuth provider for the specified…  delete-auth-oauth-provider        Deletes an OAuth provider from the specifie…  list-auth-trusted-domains         Lists the trusted domains in the redirect U…  add-auth-trusted-domain           Adds a domain to the redirect URI whitelist…  delete-auth-trusted-domain        Removes a domain from the redirect URI whit…  create-auth-user                  Creates a new user in the Neon Auth user di…  delete-auth-user                  Deletes the specified user from the Neon Au…  update-auth-user-role             Updates the role of a user in the Neon Auth…  get-data-api  provision-neon-data-api  update-data-api  delete-data-api  query-logs                        Returns logs for a branch  list-log-fields                   Lists the low-cardinality log fields observ…  list-log-field-values             Lists distinct values for a low-cardinality…  get-ai-gateway                    Returns the AI Gateway endpoint host for th…  list-functions                    Lists functions on the specified branch  get-function  update-function                   Updates the function's mutable metadata  delete-function  deploy-function                   Creates a deployment for the function  list-functions-custom-domains     Lists all custom domains registered on the…  register-functions-custom-domain  Registers a hostname on the branch and rout…  delete-functions-custom-domain    Removes a custom domain registered on the b…  list-triggers                     Lists the complete project-bounded set of t…  get-trigger                       Returns the trigger visible on the branch  create-trigger                    Creates a trigger for a Function visible on…  update-trigger                    Applies a partial update  delete-trigger                    Deletes a branch-local trigger or writes a…  list-credentials                  Returns metadata for customer-issued creden…  create-credential                 Issues a new scoped service credential anch…  revoke-credential                 Soft-deletes the credential  rotate-credential                 Replaces the secret material on an existing…  get-storage                       Returns whether branchable object storage i…  list-storage-buckets              Lists branchable object storage buckets vis…  create-storage-bucket             Creates a new branchable object storage buc…  delete-storage-bucket             Deletes the named bucket from the specified…  list-storage-objects              Lists objects visible in the named bucket o…  delete-storage-object             Deletes the named object from the bucket on…  delete-storage-objects-by-prefix  Soft-deletes every object on the specified…  presign-storage-object            Returns a presigned URL that transfers byte…  open                              Open its page in the browserLEARN MORE  gbrainio tool neon <command> -h  What one command takes  https://gbrain.io/docs/tools     The manual
Every command Neon's own server lists, each in its own words.

Neon's own server lists these commands, and the CLI prints this page for them once Neon is connected.

What a terminal may do with Neon, and what GBrain keeps

Off or On, for each terminal

Each terminal reaches Neon at the level set for it in the browser: Off, or On, which is every command Neon's server lists. A terminal reads its level and never raises it.

1,000 actions a day for each command

Each of Neon's commands stops at 1,000 actions a day on the account it reaches, whichever terminal or AI asks, and starts again at midnight UTC. Only that command stops.

Every action on one record

Each command a terminal runs on Neon is a row on GBrain's activity log: which terminal, which account, what it did and whether it was allowed, refusals included. gbrainio activity ls --tool neon reads it back.

From a terminal, Claude Code or Codex

gbrainio tool help neon says what Neon is and what each of its commands does, and gbrainio tool ls lists them with everything else the terminal can run. Claude Code and Codex run the same commands, at the same level, on the same record.

From Neon

GBrain reaches Neon at its own server, mcp.neon.tech. On Neon's own pages: its website, how the connection works, its terms of service and its privacy policy.

The GBrain Tools command line works with every other connector GBrain offers, each with a page like this one.

Every connector's command line

Neon from a terminal, with GBrain Personal

Personal is $49 a month for one person. Connect Neon in the browser, and say how far each terminal and each AI may go with it. Change any of it, or take all of it back, whenever you want.