Just landed in the Neon CLI
The Neon CLI is renamed from neonctl to neon (old name kept as an alias) and gains a branch-first workflow built on `neon link`, `neon checkout` and `neon env pull`, which store project/branch context in a local .neon file and rewrite only Neon-managed env vars. New commands include `neon inspect db` for read-only Postgres diagnostics (bloat, unused indexes, locks, pg_stat_statements outliers, cache hit rate), `neon diff` for git-style schema diffs, snapshots, project-scoped API keys and credential profiles for CI and agents, and a raw `neon api` fallback. `neon init` sets up MCP and agent skills in one step, and a suggested AGENTS.md snippet steers coding agents toward the branch-per-feature loop.
Related posts
- A branch-first dev loop for Neon: link, checkout and env pull
Neon mediumAdept
Neon's CLI adds three commands for branch-first Postgres development. `neon link` binds a workspace to a project and branch via a git-ignored `.neon` file. `neon checkout` creates or switches database branches, much like `git checkout -b`. `neon env pull` writes only the Neon-managed connection strings and service secrets for the current branch into `.env`. Link and checkout run env pull automatically, which suits coding agents that need an isolated database per feature. Teams that keep secrets off disk can pass `--no-env-pull` and inject env at runtime with `@neondatabase/env` (`neon-env run`, `fetchEnv`) or export it into varlock.
- Behind Modem.dev’s Product Velocity
Neon mediumAdept
Modem, a startup building an AI agent that centralizes user feedback from Slack, Discord and GitHub, uses Neon Postgres branching as its development workflow. Every PR with a migration gets its own database branch, where the migration is applied and a schema diff is posted to the PR. The process is repeated against a fresh branch at merge time to catch conflicting migrations, and each Vercel preview runs on an ephemeral branch with automatic cleanup. Two practical tips: script branching through the Neon CLI so coding agents can drive it, and tag OAuth refresh tokens with the originating branch so preview environments can't invalidate production tokens.
- Branching Postgres databases with the Neon API
Neon mediumAdept
Neon branches are copy-on-write clones of a Postgres database that can be created and deleted through the Neon API, giving CI pipelines an isolated copy of production data for end-to-end tests. Two experimental GitHub Actions, neondatabase/create-branch-action and neondatabase/delete-branch-action, wrap the API. A sample pull-request workflow creates a branch from a parent branch, runs the test steps, then deletes the branch. The actions were beta at the time and still being hardened for production use.
- Neon for Agent Platforms: A Companion Skill for the AI Agent Program
Neon mediumAdept
neon-for-agent-platforms is an open-source companion Agent Skill and set of TypeScript scripts for running fleets of Neon Postgres databases on agent platforms. It covers a dual-org model that separates sponsored free-tier and paid customers, with one project per tenant transferred to the paid org on upgrade. It also covers copy-on-write dev and preview branches with shorter suspend timeouts to keep costs predictable, branch-based compound checkpoints, and the consumption API for per-customer cost attribution. Both skills install via npx, and the scripts can also be run directly against a Neon API key and org ID.
- Automating Neon branch creation with Githooks
Neon mediumAdept
A Git post-checkout hook can create a Neon database branch for each new Git branch, giving every feature branch an isolated copy of the main Postgres database without a local install or seed scripts. The shell script reads the hook's arguments to detect branch checkouts and counts reflog entries to spot first-time checkouts. It asks the user for confirmation via /dev/tty, checks the Neon API for an existing branch, creates one with a POST request, and uses jq to write the returned connection URI to .env as DATABASE_URL.