{"slug": "just-landed-in-the-neon-cli", "title": "Just landed in the Neon CLI", "summary": "Neon, the serverless Postgres provider, has renamed its CLI from neonctl to neon and introduced new commands for agent tooling, branch-first workflows, and diagnostics. The CLI now supports one-shot setup via `neon init`, MCP server and skills configuration, branch linking with `neon link`, `neon checkout`, and `neon env pull`, as well as `neon inspect db` for Postgres diagnostics, `neon open`, `neon status`, `neon api-keys`, `neon profile`, and `neon diff`. These updates aim to streamline local and agent-based development workflows.", "body_md": "The [Neon CLI](https://neon.com/docs/cli) moved fast over the last couple of months. It is a key tool for agents, who do all the work without ever opening the Console - let’s take a look at some of recent changes:\n\n## The CLI is now neon\n\nFirst things first, the npm package and docs use neon instead of neonctl. Same binary, shorter name.\n\nSo, to [install it](https://neon.com/docs/cli/install),\n\nFor agents, set up skills and the MCP server in one shot:\n\nneonctl still works as an alias - no re-auth is required if you already used the old name.\n\n## Agent tooling: neon init, mcp, and skills\n\nIf you're wiring up a coding agent, you have three focused entry points:\n\n- full onboarding: OAuth, API key, MCP server, editor extension, and agent skills`neon init`\n\n- MCP server only`neon mcp`\n\n- agent skills only`neon skills`\n\n`neon init`\n\nis the one-shot setup. Use `mcp`\n\nor `skills`\n\nwhen you only need one piece. To refresh skills you've already installed, run `neon skills update`\n\n.\n\n## New commands for branch-first workflows: link, checkout, env pull\n\nThese three commands are the [core loop for local (and agent) development](https://neon.com/blog/branch-first-dev-loop):\n\n[neon link](https://neon.com/docs/cli/link) writes a local .neon context (orgId, projectId, branchId). You can use --agent for non-interactive JSON mode. Once linked, you can drop --project-id / --branch on most commands. The CLI walks up parent folders to find .neon, and adds it to .gitignore on first write.\n\n[neon checkout](https://neon.com/docs/cli/checkout) pins the active branch in that context, the same way you'd switch a git branch.\n\n[neon env pull](https://neon.com/docs/cli/env) writes branch-scoped Neon variables (DATABASE_URL, unpooled URL, and credentials for enabled services). Only Neon-managed keys are rewritten; the rest of your [env](https://neon.com/docs/cli/env) file is left alone.\n\nA recent refinement - pull only the services you name (postgres, auth, data-api, object-storage, or ai-gateway):\n\n## Debug Postgres via neon inspect db\n\nThis [diagnostics tool](https://neon.com/docs/cli/inspect) bundles read-only diagnostics against Postgres stats and catalogs, with connection resolution handled by the CLI:\n\nExamples of what you get:\n\n- table/index sizes\n- bloat estimates\n- unused indexes\n- sequential scans\n- long-running and stalled queries\n- locks\n- pg_stat_statements outliers/calls\n- vacuum stats\n- replication slots/subscriptions\n- and Neon Local File Cache hit rate / working set (\n[inspect](https://neon.com/docs/cli/inspect),[deep dive](https://neon.com/blog/neon-inspect-db),[changelog](https://neon.com/docs/changelog/2026-07-24#debug-postgres-from-the-terminal-with-neon-inspect-db)).\n\nOmit the database name to inspect every database on the branch (the output adds a `database`\n\ncolumn). It works against a linked branch, or any Postgres URL via --db-url. Same checks are also available on the Neon MCP server as `inspect_database`\n\n.\n\n## Jump to the Console: neon open\n\nA cool trick: run\n\nTo [open](https://neon.com/docs/cli/open) the linked project's dashboard in your browser.\n\n## See the pinned branch: neon status\n\nThis command [prints the branch](https://neon.com/docs/cli/config#current-branch) in .neon with no network call, so it's safe for shell prompts:\n\n## Credentials: api-keys and profile\n\nWe shipped these two command groups together, useful for CI and multi-account work:\n\n### Mint scoped keys with neon api-keys\n\nA [project-scoped key](https://neon.com/docs/cli/api-keys) cannot create projects, mint more keys, or see other projects (i.e. what you’d want for an agent or a CI job).\n\n### Switch accounts with neon profile\n\nA profile is a named credentials set. Select it per command with [--profile](https://neon.com/docs/cli/profile):\n\n--mint signs in once, stores only the minted key, and leaves no browser session behind.\n\n## Print schema diffs with neon diff\n\n[neon diff](https://neon.com/docs/cli/diff) prints a git-style unified schema diff between the branch under review and a compare branch (by default, the reviewed branch's parent)\n\n- For a machine-readable output, run --output json or --output yaml\n- For a historical point in time (timestamp or LSN), use neon branches schema-diff instead\n\n## Call any Neon API route with neon api (agent fallback)\n\nMost humans will never need this - this is a fallback for agent automation. Coding agents can now reach for [ neon api](https://neon.com/docs/cli/api) when they need an API route that doesn't have a dedicated CLI command yet. It uses your existing CLI login:\n\n## Snapshots from the terminal: neon snapshots\n\n[Point-in-time branch backups](https://neon.com/docs/cli/snapshots) are now first-class in the CLI:\n\nYou can restore un-finalized (inspect first), then neon snapshots finalize, or pass --finalize to swap immediately. For schedules: neon snapshots schedule get / set.\n\n## What’s new in Auth, Data API, and psql\n\n### Enable Managed Better Auth via neon neon-auth\n\nYou can now directly enable Auth, configure OAuth providers and domains, tweak email/webhook settings, and manage users [from the terminal](https://neon.com/docs/cli/neon-auth):\n\n### Manage the Data API via neon data-api\n\nYou can also [provision and manage](https://neon.com/docs/cli/data-api) the Data API (create, get, update, refresh-schema, delete).\n\n### neon psql without a local psql install\n\n[neon psql](https://neon.com/docs/cli/psql) connects as a top-level command. If no native psql is on $PATH, the CLI falls back to a built-in client.\n\n## Project create flags and declarative config\n\n[neon projects create](https://neon.com/docs/cli/projects) now accepts more up-front control - e.g. you can specify Postgres version, protected branches, logical replication:\n\nFor declarative branch policy, neon config init scaffolds a starter [neon.ts](https://neon.com/docs/reference/neon-ts) and installs @neon/config / @neon/env. neon link can offer this as a final step.\n\n[Backend service commands](https://neon.com/docs/cli) such as neon functions and neon buckets are part of the same CLI surface as Object Storage, Functions, and AI Gateway roll out.\n\n## The latest commands at a glance\n\n| Goal | Command | Docs |\n|---|---|---|\n| Install / upgrade | `npm i -g neon@latest` |\n|\n\n`neon auth`\n\n[auth](https://neon.com/docs/cli/auth)`neon init`\n\n[init](https://neon.com/docs/cli/init)`neon mcp`\n\n[mcp](https://neon.com/docs/cli/mcp)`neon skills`\n\n[skills](https://neon.com/docs/cli/skills)`neon link`\n\n[link](https://neon.com/docs/cli/link)`neon checkout <name>`\n\n[checkout](https://neon.com/docs/cli/checkout)`neon env pull [--service …]`\n\n[env](https://neon.com/docs/cli/env)`neon open`\n\n[open](https://neon.com/docs/cli/open)`neon api-keys …`\n\n[api-keys](https://neon.com/docs/cli/api-keys)`neon profile …`\n\n[profile](https://neon.com/docs/cli/profile)`neon diff [branch]`\n\n[diff](https://neon.com/docs/cli/diff)`neon api <path>`\n\n[api](https://neon.com/docs/cli/api)`neon inspect db <check>`\n\n[inspect](https://neon.com/docs/cli/inspect)`neon snapshots …`\n\n[snapshots](https://neon.com/docs/cli/snapshots)`neon neon-auth …`\n\n[neon-auth](https://neon.com/docs/cli/neon-auth)`neon data-api …`\n\n[data-api](https://neon.com/docs/cli/data-api)`neon psql`\n\n[psql](https://neon.com/docs/cli/psql)## What to put in AGENTS.md\n\nDrop this into your project's AGENTS.md (or Cursor rules) so coding agents default to the branch-first loop:", "url": "https://wpnews.pro/news/just-landed-in-the-neon-cli", "canonical_source": "https://neon.com/blog/just-landed-in-the-neon-cli", "published_at": "2026-08-25 12:00:00+00:00", "updated_at": "2026-08-25 21:43:44.137025+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools"], "entities": ["Neon", "Neon CLI", "neonctl", "MCP server"], "alternates": {"html": "https://wpnews.pro/news/just-landed-in-the-neon-cli", "markdown": "https://wpnews.pro/news/just-landed-in-the-neon-cli.md", "text": "https://wpnews.pro/news/just-landed-in-the-neon-cli.txt", "jsonld": "https://wpnews.pro/news/just-landed-in-the-neon-cli.jsonld"}}