Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dependencies
node_modules/

# TypeScript build output (scripts/)
scripts/dist/

# Local secrets
.env
.env.local
scripts/.env
scripts/.env.local

# Logs & debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# OS / editor
.DS_Store
Thumbs.db
*.swp
.idea/
.vscode/
57 changes: 57 additions & 0 deletions scripts/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copy to .env and fill in values (never commit .env):
# cp .env.example .env
#
# Scripts load this file via dotenv when run from scripts/ (npm run …).
# Requires Node.js 20+. See MANAGEMENT_API_SAMPLES.md for per-script usage.

# --- Required for most scripts ---
NEON_API_KEY=

# --- Projects ---
# NEON_ORG_ID= # create-project, consumption-query (often required with personal keys)
# NEON_PROJECT_ID= # branch, snapshot, delete-project, auth-users, etc.
# NEON_PROJECT_NAME= # optional; default tenant-<timestamp>
# NEON_PROJECT_IDS= # transfer-project: comma-separated ids (or use NEON_PROJECT_ID)

# --- Branches ---
# NEON_PARENT_BRANCH_ID= # branch create: defaults to main/production
# NEON_BRANCH_ID= # auth-users, delete-branch
# NEON_PROD_BRANCH_ID= # promote-safe-production (optional)
# NEON_DEV_BRANCH_ID= # promote-safe-production promote / refresh-dev
# NEON_BOOTSTRAP_DEV_BRANCH_NAME= # default: dev

# --- Snapshots & versioning ---
# NEON_SNAPSHOT_NAME=
# NEON_SNAPSHOT_ID=
# NEON_SNAPSHOT_NEW_NAME= # rename-snapshot
# NEON_SNAPSHOT_EXPIRES_AT= # RFC 3339 (snapshot auto-deletion)
# NEON_SNAPSHOT_LSN= # advanced; mutually exclusive with default timestamp snapshot
# NEON_TARGET_BRANCH_ID= # restore-snapshot
# VERSION_BASELINE_NAME=
# VERSION_DEMO_BRANCH_NAME=

# --- Org transfer (personal API key) ---
# NEON_SOURCE_ORG_ID=
# NEON_DESTINATION_ORG_ID=

# --- Consumption API v2 ---
# CONSUMPTION_FROM= # RFC 3339, e.g. 2026-05-01T00:00:00Z
# CONSUMPTION_TO=
# CONSUMPTION_GRANULARITY=daily # hourly | daily | monthly
# CONSUMPTION_METRICS= # optional comma list
# CONSUMPTION_PROJECT_IDS= # optional comma-separated project ids
# CONSUMPTION_LIMIT=
# CONSUMPTION_CURSOR=

# --- Neon Auth (auth-users.ts) ---
# NEON_AUTH_DATABASE_NAME=
# USER_EMAIL=
# USER_NAME=
# AUTH_USER_ID=

# --- promote-safe-production (optional snapshot / restore labels) ---
# NEON_SNAPSHOT_BOOTSTRAP_NAME=
# NEON_SNAPSHOT_PRE_PROMOTION_NAME=
# NEON_SNAPSHOT_DEV_CANDIDATE_NAME=
# NEON_SNAPSHOT_REFRESH_NAME=
# NEON_RESTORE_BACKUP_BRANCH_NAME=
3 changes: 3 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
},
"keywords": ["neon", "postgres", "agent-skills", "ai-agents"],
"type": "module",
"engines": {
"node": ">=20"
},
"scripts": {
"fmt": "prettier --write \"**/*.ts\"",
"fmt:check": "prettier --check \"**/*.ts\"",
Expand Down