Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Neon CLI

$ neonctl Official Med Risk
Neon · Database & Data · Apache-2.0 · macos / linux / windows

Neon CLI manages Neon serverless Postgres projects, copy-on-write branches, compute endpoints, and roles. Supports --output json across commands, non-interactive NEON_API_KEY auth, and ephemeral branch workflows ideal for AI coding agents.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
brew install neonctl
CLI vs MCP Decision Hybrid (CLI + MCP)

Use neonctl for deterministic branch lifecycle, CI scripting, and connection string retrieval; Neon's MCP server complements it for natural-language SQL exploration.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

First-class --output json / yaml / table support, non-interactive NEON_API_KEY auth, and predictable subcommand taxonomy.

  • Supports --output json across resource commands and NEON_API_KEY env auth
Trust & Safety 21 / 25

Copy-on-write branching enables safe isolated testing, though branches delete and projects delete require explicit guardrails.

  • Isolated branch creation protects production main; delete commands have remote impact
Setup & Portability 14 / 15

Available via brew, npm, npx, and standalone binaries across macOS, Linux, and Windows.

  • Multi-channel distribution via Homebrew and npm
Utility & Efficiency 14 / 15

Lets agents spin up disposable Postgres branches and obtain URIs in seconds.

  • Instant copy-on-write Postgres branching in a single command
Maintenance & Lineage 9 / 10

Official neondatabase/neonctl repository maintained by Neon under Apache-2.0.

  • Official neondatabase/neonctl repo
Docs & Verifiability 8 / 10

Well-documented CLI reference with per-command flag tables and examples.

  • Official reference at neon.tech/docs/reference/neon-cli

Security, Auth & Guardrails

Auth Modes
OAuth Browser Env API Key Config File
Credential Storage

OAuth credentials stored under ~/.config/neonctl/credentials.json or supplied via NEON_API_KEY / --api-key.

Side Effects
Read-Only Remote Write Destructive Billing Impact
Cost & Quotas

CLI is Apache-2.0 open-source; Neon offers a free tier with usage-based compute/storage billing on paid plans.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Neon CLI Agent Rules
- Always pass `--output json` and set `NEON_API_KEY` for headless runs.
- Create an isolated branch with `neonctl branches create` before running schema migrations.
- NEVER run `neonctl projects delete` or `neonctl branches delete main` autonomously.

Agent-Ready Command Recipes

Safe Read-Only Queries

List Neon projects as JSON
neonctl projects list --output json

Retrieves project IDs, regions, and Postgres versions in structured JSON.

Fetch a branch connection string without printing secrets to logs
neonctl connection-string main --project-id <project-id> --output json

Returns the PostgreSQL URI for a specific branch for downstream tooling.

Controlled Writes & Previews

Create an isolated preview database branch
neonctl branches create --name agent-test --project-id <project-id> --output json

Spins up a copy-on-write Postgres branch so agents never mutate main directly.

Strengths for Agents

  • + Consistent --output json output makes project and branch automation trivial.
  • + Copy-on-write branches create lets agents test migrations safely away from production.
  • + NEON_API_KEY enables clean headless CI and agent execution.

Caveats & Pitfalls

  • ! connection-string prints database credentials to stdout; mask output in shared logs.
  • ! Lacks a native --dry-run flag on destructive delete operations.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI