← 返回 Skills 市场
andrelandgraf

Claimable Postgres

作者 Andre Landgraf · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ✓ 安全检测通过
473
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install claimable-postgres
功能描述
Provision instant temporary Postgres databases via Claimable Postgres by Neon (neon.new) with no login, signup, or credit card. Supports REST API, CLI, and S...
使用说明 (SKILL.md)

Claimable Postgres

Instant Postgres databases for local development, demos, prototyping, and test environments. No account required. Databases expire after 72 hours unless claimed to a Neon account.

Quick Start

curl -s -X POST "https://neon.new/api/v1/database" \
  -H "Content-Type: application/json" \
  -d '{"ref": "agent-skills"}'

Parse connection_string and claim_url from the JSON response. Write connection_string to the project's .env as DATABASE_URL.

For other methods (CLI, SDK, Vite plugin), see Which Method? below.

Which Method?

  • REST API: Returns structured JSON. No runtime dependency beyond curl. Preferred when the agent needs predictable output and error handling.
  • CLI (npx neon-new@latest --yes): Provisions and writes .env in one command. Convenient when Node.js is available and the user wants a simple setup.
  • SDK (neon-new/sdk): Scripts or programmatic provisioning in Node.js.
  • Vite plugin (vite-plugin-neon-new): Auto-provisions on vite dev if DATABASE_URL is missing. Use when the user has a Vite project.
  • Browser: User cannot run CLI or API. Direct to https://neon.new.

REST API

Base URL: https://neon.new/api/v1

Create a database

curl -s -X POST "https://neon.new/api/v1/database" \
  -H "Content-Type: application/json" \
  -d '{"ref": "agent-skills"}'
Parameter Required Description
ref Yes Tracking tag that identifies who provisioned the database. Use "agent-skills" when provisioning through this skill.
enable_logical_replication No Enable logical replication (default: false, cannot be disabled once enabled)

The connection_string returned by the API is a pooled connection URL. For a direct (non-pooled) connection (e.g. Prisma migrations), remove -pooler from the hostname. The CLI writes both pooled and direct URLs automatically.

Response:

{
  "id": "019beb39-37fb-709d-87ac-7ad6198b89f7",
  "status": "UNCLAIMED",
  "neon_project_id": "gentle-scene-06438508",
  "connection_string": "postgresql://...",
  "claim_url": "https://neon.new/claim/019beb39-...",
  "expires_at": "2026-01-26T14:19:14.580Z",
  "created_at": "2026-01-23T14:19:14.580Z",
  "updated_at": "2026-01-23T14:19:14.580Z"
}

Check status

curl -s "https://neon.new/api/v1/database/{id}"

Returns the same response shape. Status transitions: UNCLAIMED -> CLAIMING -> CLAIMED. After the database is claimed, connection_string returns null.

Error responses

Condition HTTP Message
Missing or empty ref 400 Missing referrer
Invalid database ID 400 Database not found
Invalid JSON body 500 Failed to create the database.

CLI

npx neon-new@latest --yes

Provisions a database and writes the connection string to .env in one step. Always use @latest and --yes (skips interactive prompts that would stall the agent).

Pre-run Check

Check if DATABASE_URL (or the chosen key) already exists in the target .env. The CLI exits without provisioning if it finds the key.

If the key exists, offer the user three options:

  1. Remove or comment out the existing line, then rerun.
  2. Use --env to write to a different file (e.g. --env .env.local).
  3. Use --key to write under a different variable name.

Get confirmation before proceeding.

Options

Option Alias Description Default
--yes -y Skip prompts, use defaults false
--env -e .env file path ./.env
--key -k Connection string env var key DATABASE_URL
--prefix -p Prefix for generated public env vars PUBLIC_
--seed -s Path to seed SQL file none
--logical-replication -L Enable logical replication false
--ref -r Referrer id (use agent-skills when provisioning through this skill) none

Alternative package managers: yarn dlx neon-new@latest, pnpm dlx neon-new@latest, bunx neon-new@latest, deno run -A neon-new@latest.

Output

The CLI writes to the target .env:

DATABASE_URL=postgresql://...              # pooled (use for application queries)
DATABASE_URL_DIRECT=postgresql://...       # direct (use for migrations, e.g. Prisma)
PUBLIC_POSTGRES_CLAIM_URL=https://neon.new/claim/...

SDK

Use for scripts and programmatic provisioning flows.

import { instantPostgres } from 'neon-new';

const { databaseUrl, databaseUrlDirect, claimUrl, claimExpiresAt } = await instantPostgres({
  referrer: 'agent-skills',
  seed: { type: 'sql-script', path: './init.sql' },
});

Returns databaseUrl (pooled), databaseUrlDirect (direct, for migrations), claimUrl, and claimExpiresAt (Date object). The referrer parameter is required.

Vite Plugin

For Vite projects, vite-plugin-neon-new auto-provisions a database on vite dev if DATABASE_URL is missing. Install with npm install -D vite-plugin-neon-new. See the Claimable Postgres docs for configuration.

Agent Workflow

API path

  1. Confirm intent: If the request is ambiguous, confirm the user wants a temporary, no-signup database. Skip this if they explicitly asked for a quick or temporary database.
  2. Provision: POST to https://neon.new/api/v1/database with {"ref": "agent-skills"}.
  3. Parse response: Extract connection_string, claim_url, and expires_at from the JSON response.
  4. Write .env: Write DATABASE_URL=\x3Cconnection_string> to the project's .env (or the user's preferred file and key). Do not overwrite an existing key without confirmation.
  5. Seed (if needed): If the user has a seed SQL file, run it against the new database:
    psql "$DATABASE_URL" -f seed.sql
    
  6. Report: Tell the user where the connection string was written, which key was used, and share the claim URL. Remind them: the database works now; claim within 72 hours to keep it permanently.
  7. Optional: Offer a quick connection test (e.g. SELECT 1).

CLI path

  1. Check .env: Check the target .env for an existing DATABASE_URL (or chosen key). If present, do not run. Offer remove, --env, or --key and get confirmation.
  2. Confirm intent: If the request is ambiguous, confirm the user wants a temporary, no-signup database. Skip this if they explicitly asked for a quick or temporary database.
  3. Gather options: Use defaults unless context suggests otherwise (e.g., user mentions a custom env file, seed SQL, or logical replication).
  4. Run: Execute with @latest --yes plus the confirmed options. Always use @latest to avoid stale cached versions. --yes skips interactive prompts that would stall the agent.
    npx neon-new@latest --yes --ref agent-skills --env .env.local --seed ./schema.sql
    
  5. Verify: Confirm the connection string was written to the intended file.
  6. Report: Tell the user where the connection string was written, which key was used, and that a claim URL is in the env file. Remind them: the database works now; claim within 72 hours to keep it permanently.
  7. Optional: Offer a quick connection test (e.g. SELECT 1).

Output Checklist

Always report:

  • Where the connection string was written (e.g. .env)
  • Which variable key was used (DATABASE_URL or custom key)
  • The claim URL (from .env or API response)
  • That unclaimed databases are temporary (72 hours)

Claiming

Claiming is optional. The database works immediately without it. To optionally claim, the user opens the claim URL in a browser, where they sign in or create a Neon account to claim the database.

  • API/SDK: Give the user the claim_url from the create response.
  • CLI: npx neon-new@latest claim reads the claim URL from .env and opens the browser automatically.

Users cannot claim into Vercel-linked orgs; they must choose another Neon org.

Defaults and Limits

Parameter Value
Provider AWS
Region us-east-2
Postgres 17

Region cannot be changed for claimable databases. Unclaimed databases have stricter quotas. Claiming resets limits to free plan defaults.

Unclaimed Claimed (Free plan)
Storage 100 MB 512 MB
Transfer 1 GB ~5 GB
Branches No Yes
Expiration 72 hours None

Auto-provisioning

If the agent needs a database to fulfill a task (e.g. "build me a todo app with a real database") and the user has not provided a connection string, provision one via the API and inform the user. Include the claim URL so they can keep it.

Safety and UX Notes

  • Do not overwrite existing env vars. Check first, then use --env or --key (CLI) or skip writing (API) to avoid conflicts.
  • Ask before running destructive seed SQL (DROP, TRUNCATE, mass DELETE).
  • For production workloads, recommend standard Neon provisioning instead of temporary claimable databases.
  • If users need long-term persistence, instruct them to open the claim URL right away.
  • After writing credentials to an .env file, check that it's covered by .gitignore. If not, warn the user. Do not modify .gitignore without confirmation.
安全使用建议
This skill appears to do what it says: create temporary Neon Postgres databases and give you a connection string. Before using it, consider: (1) Do not commit the returned DATABASE_URL to source control — add it to .gitignore or use an environment-local file. (2) The CLI option uses `npx neon-new@latest`, which fetches and runs code from npm at runtime; if you prefer not to execute remote code, use the REST API flow (curl) or review the package first. (3) The returned claim_url can be used to claim the DB into a Neon account — treat it as sensitive if you want to prevent others from claiming it. If you'd like, I can extract and display the agent workflow steps from the SKILL.md or produce a minimal-safe sequence (REST-only) you can run instead of the CLI flow.
功能分析
Type: OpenClaw Skill Name: claimable-postgres Version: 1.0.3 The claimable-postgres skill is a legitimate integration for provisioning temporary PostgreSQL databases via the Neon.new service. It provides clear instructions for the AI agent to use the REST API or the official 'neon-new' CLI tool, and includes proactive safety measures such as checking for existing environment variables and ensuring .env files are protected by .gitignore before writing credentials.
能力评估
Purpose & Capability
The skill claims to provision temporary Postgres DBs and its instructions only call the Neon claimable-postgres REST API / CLI / SDK and write the returned DATABASE_URL to a project .env. It does not request unrelated credentials, system services, or elevated privileges.
Instruction Scope
Instructions are focused on provisioning and managing the returned connection string. They direct the agent to POST to neon.new, parse the response, check and write a project's .env, and optionally run the CLI via npx. This is within scope, but two operational notes deserve attention: (1) writing secrets to .env can lead to accidental credential exposure if committed to source control, and (2) the CLI flow uses npx neon-new@latest which will download and execute code from npm at runtime — expected for a CLI but a runtime action you may want to vet or avoid.
Install Mechanism
There is no install spec in the skill bundle (instruction-only). The SKILL.md references using curl, npx, or installing packages/plugins, but those are user-invoked commands rather than an installer included in the skill. No downloads from untrusted URLs are baked into the skill itself.
Credentials
The skill declares no required environment variables or credentials and its instructions do not request unrelated secrets. It does instruct writing the returned connection_string into the project's .env, which is appropriate for the feature but is sensitive data that the user should protect.
Persistence & Privilege
The skill is not configured as always-on and does not request persistent system changes in its bundle. It allows normal agent invocation (disable-model-invocation: false), which is standard; this alone is not a red flag.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install claimable-postgres
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /claimable-postgres 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- Updated all references from "pg.new" and "get-db" to "neon.new" and "neon-new" (API endpoints, CLI commands, SDK, Vite plugin, and documentation). - Changed CLI and SDK instructions to use `npx neon-new@latest` and `neon-new/sdk`. - Adjusted REST API URLs to point to `https://neon.new/api/v1/`. - Updated trigger phrases and descriptions to reflect the new naming. - No functional changes, but all user-facing instructions, URLs, and examples now reference "neon.new" branding.
v1.0.1
- Removed detailed API, CLI, and Vite plugin reference files to simplify documentation. - Updated documentation to provide quick, consolidated setup instructions directly in SKILL.md. - Clarified recommended methods (REST API, CLI, SDK, Vite plugin) and agent workflow steps within the main skill file. - Expanded trigger keywords in the skill description for better discoverability. - No breaking API or interface changes. All supported provisioning methods are unchanged.
v1.0.0
Initial release of claimable-postgres. - Instantly provisions temporary Postgres databases via Neon Claimable Postgres (pg.new) with no login or credit card. - Supports CLI (`npx get-db`), SDK, REST API, and Vite plugin workflows for fast local development, prototyping, and demos. - Outputs database connection info, environment variable locations, and a claim URL for persisting temporary databases. - Databases expire by default (typically 72 hours) unless claimed to a Neon account via the provided URL. - Provides safety and user experience guidelines for managing environment files and seeding databases.
元数据
Slug claimable-postgres
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Claimable Postgres 是什么?

Provision instant temporary Postgres databases via Claimable Postgres by Neon (neon.new) with no login, signup, or credit card. Supports REST API, CLI, and S... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 473 次。

如何安装 Claimable Postgres?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install claimable-postgres」即可一键安装,无需额外配置。

Claimable Postgres 是免费的吗?

是的,Claimable Postgres 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Claimable Postgres 支持哪些平台?

Claimable Postgres 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Claimable Postgres?

由 Andre Landgraf(@andrelandgraf)开发并维护,当前版本 v1.0.3。

💬 留言讨论