agentsclimarketplace

Neon cli

Skill arthjean/skills/skills/neon-cli

Public collection of Agent Skills for Codex, Claude Code, and compatible coding agents

Install
npx -y skills add arthjean/skills --skill neon-cli

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Operate Neon Postgres from a coding-agent terminal with the official neonctl CLI and psql, without relying on the Neon MCP server. Covers projects, local project linking, branches, databases, roles, connection strings, SQL execution, transactions, schema diffs, migrations, EXPLAIN, slow-query inspection, and Management API gaps. Use when the agent needs to inspect, query, or modify a Neon database; create, restore, reset, diff, or delete branches; run migrations; manage Neon projects or roles; or when the user says neon-cli, neonctl, query my Neon DB, create a Neon branch, or list my Neon projects. Do not use for application runtime integration with Neon, ORM schema design, continuous monitoring, or Neon MCP server configuration.

SKILL.md

7.8 KB, ~1.8k tokens by cl100k_base, as published. Nobody here has run it

Neon CLI

Operate Neon through bunx neonctl@latest, psql, and the bundled shell helpers. Keep the working directory in the user's project so neonctl can resolve the nearest local .neon context.

Operating contract

  1. Use the absolute directory containing this SKILL.md as NEON_SKILL_DIR. In a standard user installation:

    NEON_SKILL_DIR="${NEON_SKILL_DIR:-$HOME/.agents/skills/neon-cli}"
    
  2. Do not cd into the skill directory before running Neon commands. The current project directory determines which .neon context is active.

  3. Use bunx neonctl@latest. Do not install neonctl globally and do not use npm, npx, pnpm, or yarn.

  4. Prefer native neonctl commands. Use bundled scripts only for SQL workflows that need psql.

  5. Preserve secrets. Never print, log, commit, or return NEON_API_KEY, database passwords, connection strings, or generated .env values.

  6. Keep browser use opt-in. Do not run interactive neonctl auth unless the user explicitly requested browser authentication.

  7. Require an explicit destructive intent and an unambiguous target before project deletion, branch deletion, reset, restore, DROP, or destructive DML. Do not infer these actions from a general request to manage or fix a database.

Preflight

Run the bundled preflight only when the task actually needs Neon access:

bash "$NEON_SKILL_DIR/scripts/neon-ensure.sh"

It checks bun, current neonctl, psql, jq, NEON_API_KEY, local context, and authentication. It performs one read-only authentication request.

If inspecting CLI help, remove the API key from that subprocess because some neonctl versions render environment-backed defaults in help output:

env -u NEON_API_KEY bunx neonctl@latest branches create --help

Do not run install commands automatically. Detect the host OS first, then tell the user which missing client package is required.

Authentication and project targeting

Use a scoped API key through the environment:

export NEON_API_KEY=neon_api_xxxxxxxxxxxx

For a one-off operation, pass the project explicitly:

PID=polished-wind-123456
bunx neonctl@latest branches list --project-id "$PID" --output json

For repeated repository work, link the project non-interactively. link and checkout pull environment variables into .env by default, so disable that unless the user explicitly wants it:

bunx neonctl@latest link \
  --project-id "$PID" \
  --branch main \
  --agent \
  --no-env-pull

bunx neonctl@latest checkout feature/users --no-env-pull

set-context is deprecated. Use link and checkout. Do not create a .neon file merely to execute one command when --project-id is sufficient.

Bundled scripts resolve the project in this order:

  1. Explicit script argument
  2. NEON_PROJECT_ID
  3. The nearest .neon file resolved by neonctl

Execution workflow

  1. Identify the project, branch, database, role, and whether the request is read-only or mutating.
  2. Resolve missing targets with read-only commands such as projects list, branches list, or databases list.
  3. Use a native command from references/commands.md, or a bundled SQL helper from references/sql-execution.md.
  4. Before a destructive action, inspect the exact target. For branch deletion, verify it is not the default branch. For reset or restore, preserve the previous state under a backup name when rollback may matter.
  5. Execute the narrowest command that satisfies the request.
  6. Report the affected project, branch, and operation outcome. Scrub secrets and connection strings from all output.

Quick map

IntentCommand
List projectsbunx neonctl@latest projects list --output json
List branchesbunx neonctl@latest branches list --project-id "$PID" --output json
Get a direct connection stringbunx neonctl@latest cs main --project-id "$PID" --no-color
Open psqlbunx neonctl@latest psql main --project-id "$PID"
Run one SQL statementbash "$NEON_SKILL_DIR/scripts/neon-sql.sh" main "SELECT count(*) FROM users" pooled "$PID"
Run a transaction filebash "$NEON_SKILL_DIR/scripts/neon-tx.sh" main -f migration.sql direct "$PID"
List tablesbash "$NEON_SKILL_DIR/scripts/neon-tables.sh" main neondb "$PID"
Describe a tablebash "$NEON_SKILL_DIR/scripts/neon-describe.sh" main users public neondb "$PID"
Explain a read querybash "$NEON_SKILL_DIR/scripts/neon-explain.sh" main "SELECT * FROM users" "$PID"
Inspect slow queriesbash "$NEON_SKILL_DIR/scripts/neon-slow-queries.sh" main 20 neondb "$PID"
Create a branchbunx neonctl@latest branches create --name feature/users --parent main --project-id "$PID" --output json
Diff schemasbunx neonctl@latest branches schema-diff main feature/users --project-id "$PID" --database neondb
Call an API routebunx neonctl@latest api "/projects/$PID/operations" --output json

Connection choice

Use a direct connection for DDL, migrations, COPY, LISTEN/NOTIFY, prepared statements, and session-scoped settings. Use a pooled connection for ordinary application-style reads and single-statement writes.

The SQL helpers choose these defaults:

HelperDefault
neon-sql.shpooled
neon-tx.shdirect
neon-tables.shpooled
neon-describe.shpooled
neon-explain.shdirect
neon-slow-queries.shpooled

EXPLAIN ANALYZE executes the statement. Use neon-explain.sh --safe for mutating SQL so the helper wraps it in BEGIN and ROLLBACK, but still inspect untrusted SQL for functions or external side effects before execution.

Migration workflow

Use a temporary branch to preview non-trivial migrations:

PID=polished-wind-123456
BRANCH="migration/$(date +%Y%m%d-%H%M%S)"

bunx neonctl@latest branches create \
  --name "$BRANCH" \
  --parent main \
  --schema-only \
  --project-id "$PID" \
  --output json

bash "$NEON_SKILL_DIR/scripts/neon-tx.sh" \
  "$BRANCH" -f migration.sql direct "$PID"

bunx neonctl@latest branches schema-diff main "$BRANCH" \
  --project-id "$PID" \
  --database neondb

Apply the reviewed migration to the target branch only when the user's request includes that mutation. Keep or delete the preview branch according to the requested rollback window.

References

For flags not covered here, inspect current help with env -u NEON_API_KEY bunx neonctl@latest <command> --help. For version-sensitive Neon behavior, use Context7 or official Neon documentation rather than relying on this reference indefinitely.

What ships with it: 13 files

26.0 KB alongside SKILL.md, 8 of them executable

agents/

scripts/

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.