---
name: ulk-neon
description: "Manage Neon Postgres databases using neonctl CLI. Use for database branching, connection strings, and SQL operations. Replaces the Neon MCP."
---

# Neon Database via CLI

## Prerequisite
Verify: `command -v neonctl`
If absent: `npm i -g neonctl && neonctl auth`

## Branches
```bash
neonctl branches list
neonctl branches create --name feature-x
neonctl branches delete feature-x
neonctl branches reset main --parent
```

## Connection
```bash
neonctl connection-string                    # Default branch
neonctl connection-string --branch feature-x # Specific branch
```

## SQL
```bash
neonctl sql "SELECT count(*) FROM users"
neonctl sql --branch feature-x "SELECT * FROM migrations ORDER BY id DESC LIMIT 5"
```
