[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77TWFNZ98CFMAFF4YEPGE8H":3,"skill-same:01M77TWFNZ98CFMAFF4YEPGE8H":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M77TWFNZ98CFMAFF4YEPGE8H","neon",null,"Overview of Neon, a complete set of cloud backend primitives for apps and agents, spanning Lakebase Postgres, Auth, the Data API, Object Storage, Compute Functions, and the AI Gateway. Start here to route to the right Neon skill, set up the CLI or MCP server, and follow the branch-first workflow. Use when \"Neon\" or \"Lakebase Postgres\" is mentioned, or when any of its individual capabilities are the trigger: \"object storage\" or \"S3\", \"buckets\", \"serverless functions\", \"AI gateway\", \"call an LLM\", \"logs\", \"branch logs\", \"query logs\", \"log export\", \"Loki\", \"Grafana\", \"observability\", \"telemetry\", \"postgres\", \"database\", or \"backend\".","Reihantt6\u002Fsns-myagent","Reihantt6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219822095?v=4","01M77KK94PV8B7C2D9XWXNS8DJ","Mohamad Reihan tegar prasetya","01M77KK958QFMTHYXGXFV7KZ79",2,"MIT","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fneon\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"Overview of Neon, a complete set of cloud backend primitives for apps and agents, spanning Lakebase Postgres, Auth, the Data API, Object Storage, Compute Functions, and the AI Gateway. Start here to route to the right Neon skill, set up the CLI or MCP server, and follow the branch-first workflow. Use when \\\"Neon\\\" or \\\"Lakebase Postgres\\\" is mentioned, or when any of its individual capabilities are the trigger: \\\"object storage\\\" or \\\"S3\\\", \\\"buckets\\\", \\\"serverless functions\\\", \\\"AI gateway\\\", \\\"call an LLM\\\", \\\"logs\\\", \\\"branch logs\\\", \\\"query logs\\\", \\\"log export\\\", \\\"Loki\\\", \\\"Grafana\\\", \\\"observability\\\", \\\"telemetry\\\", \\\"postgres\\\", \\\"database\\\", or \\\"backend\\\".\"\nmetadata: {\"source\":\"https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills\u002Ftree\u002Fmain\u002Fskills\u002Fneon\"}\n---\n# Neon\n\nImportant: Neon is no longer just a Postgres provider. Neon is a complete set of cloud backend primitives built around Lakebase Postgres, for developers, startups, and agent platforms, from Databricks — bundling Lakebase Postgres, Auth (managed Better Auth), long-running Functions, Object Storage, and an AI Gateway, all instant, branchable, and serverless.\n\n**Lakebase Postgres** is the database itself. It is one product, reached two ways: through Neon, with a free plan and the full set of backend primitives above, or through Databricks, alongside the rest of the Databricks suite. Same infrastructure, same features, same engineering team. Call the database Lakebase Postgres, and use \"Neon\" for the brand and for this access path — not as a name for the database.\n\nA Neon branch is an isolated, copy-on-write clone of your data, taken from its current state or from a past state within your project's retained history window. You can freely modify or delete it. It shares data with its parent until writes cause it to diverge, and those writes are stored independently as deltas.\n\n## Backend Primitives\n\nNeon bundles several backend primitives for building apps and agents that all branch together:\n\n- **Lakebase Postgres** — Postgres that scales and branches with your app, built on the lakebase architecture: OLTP directly on cloud object storage, with storage decoupled from compute. _Generally available._\n- **Auth** — Managed Better Auth with users and sessions stored in Postgres. _Generally available._\n- **Object Storage** — S3-compatible object storage that branches with your projects. _Public beta._\n- **Functions** — Neon's compute offering: long-running serverless functions that run close to your database, for WebSocket servers, long agent HTTP streams, APIs, and server-sent event servers. _Public beta._\n- **AI Gateway** — One API for frontier and open-source models, supporting the chat completions API and the responses API, powered by Databricks Unity AI Gateway. _Public beta._\n\n### Public Beta Service Availability\n\nObject Storage, Functions, and AI Gateway are in public beta.\n\nBeta access features are only available on projects in the `us-east-2` region. Before guiding a user through any of these services, confirm they are working in `us-east-2`. If not, they will need to create a new project in that region.\n\n## Architecture: How to Use Neon\n\nNeon is **not** a place to host your app frontend. Neon provides the backend primitives (Lakebase Postgres, Auth, Object Storage, Functions, AI Gateway) that **compose with** the application platform you already use.\n\nRecommended architectures:\n\n**Full-stack app on Vercel** (or Netlify) augmented with Neon — the app framework (Next.js, TanStack Start, etc.) owns your UI and routes and talks directly to your Neon services (Lakebase Postgres, Auth, Object Storage, Functions, AI Gateway).\n\n**Reach for Neon Functions when you outgrow the host's limits** — a WebSocket or SSE server, long-running agents, or an MCP server that risks timing out on short, lambda-style serverless functions. As long as there is an active connection, a Neon Function can run up to 24 hours without interruption, with the added benefit of running close to your data.\n\n**Move your whole backend control plane onto Neon Functions** — especially useful when the frontend is **client-only** rather than full-stack: TanStack Router, React Router in client mode, and similar SPAs hosted on Vercel or Netlify. The client talks **directly to Neon Functions**, where you build REST APIs and request\u002Fresponse agents. Secure these functions like any standalone REST API — verify a JWT or API key at the top of each handler (see the `neon-functions` skill).\n\nBecause Functions are just your backend, they compose with a full-stack app that already has one (Next.js route handlers, etc.), too.\n\n## Neon Documentation\n\nThe Neon documentation is the source of truth for all Neon-related information. Always verify claims against the official docs before responding. Neon features and APIs evolve, so prefer fetching current docs over relying on training data.\n\n### Finding the Right Page\n\nLook the page up before you fetch it — **don't guess URLs!** The docs index lists every available page with its URL and a short description:\n\n```\nhttps:\u002F\u002Fneon.com\u002Fdocs\u002Fllms.txt\n```\n\n### Fetching Docs as Markdown\n\nAny Neon doc page can be fetched as markdown in two ways:\n\n1. **Append `.md` to the URL** (simplest): https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching.md\n2. **Request `text\u002Fmarkdown`** on the standard URL: `curl -H \"Accept: text\u002Fmarkdown\" https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching`\n\nBoth return the same markdown content. Use whichever method your tools support.\n\n## Choosing the Right Skill\n\nNeon provides a set of agent skills in addition to the official documentation. When a task matches one of the rows below, work from that skill rather than from this overview. You may have some of these skills already installed, or you may need to install them.\n\nThe skills below live in the [`neondatabase\u002Fagent-skills`](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills) repo:\n\n| Skill | Use it for |\n| --- | --- |\n| `neon-postgres` | Working with databases, including connections, schemas, queries, and autoscaling: SQL development, schema design, performance optimization, and scaling decisions. |\n| `neon-postgres-branches` | Choosing or creating the right branch type for dev, preview, test, or CI workflows. Use this skill as a slash command. |\n| `neon-object-storage` | Storing and serving files (uploads, images, blobs), including branching them with the database. |\n| `neon-functions` | Deploying long-running or streaming serverless functions — APIs, agents, SSE\u002FWebSocket servers. |\n| `neon-ai-gateway` | Calling an LLM or routing across model providers with one credential, including discovering the branch's servable models at runtime via the OpenAI-compatible `\u002Fv1\u002Fmodels` endpoint. |\n| `claimable-postgres` | Provisioning instant, claimable temporary Postgres databases (for example, one per end user or demo). |\n| `neon-postgres-egress-optimizer` | Diagnosing or fixing excessive Postgres egress (network data-transfer) costs in a codebase. |\n\nFor guidance on agent platforms that provision and operate Lakebase Postgres on Neon at scale, use `neon-postgres-agent-platforms`, which lives in a separate repo: [`neondatabase\u002Fneon-for-agent-platforms`](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fneon-for-agent-platforms).\n\n### Installing the Right Skill\n\nFirst check whether the target skill is already installed and accessible (for example, it appears in the available skills list or its `SKILL.md` is present). If it is, use it directly. If it is not installed, install it via the `skills` CLI, if available, with `npx`\u002F`bunx`:\n\n```bash\nnpx skills add neondatabase\u002Fagent-skills -s \u003Cskill-name>\n```\n\nReplace `\u003Cskill-name>` with the skill you need (for example, `neon-object-storage`, `neon-functions`, or `neon-ai-gateway`). Useful flags:\n\n- `-g` — install globally instead of into the current project.\n- `-y` — non-interactive mode (skip prompts).\n- `-a \u003Cagent-name>` — pick the target agent(s) for non-interactive mode.\n\nFor example, to install the object storage skill globally for a specific agent without prompts:\n\n```bash\nnpx skills add neondatabase\u002Fagent-skills -s neon-object-storage -g -y -a \u003Cagent-name>\n```\n\nIf you don't have access to the `skills` CLI, you can visit https:\u002F\u002Fneon.com\u002F.well-known\u002Fagent-skills for a registry of all available Neon skills and fetch them manually.\n\n### Updating Skills\n\nKeep the skills up to date: for every new session, update them so you are working with the latest best practices.\n\nUse the same method that was used to install them. With the `skills` CLI, run the install command above with `update` in place of `add`, or run `npx skills update` to update all Neon skills. If the skills were installed via a plugin, they are updated automatically.\n\n## Getting Started with Neon\n\nThe easiest way to get started with Neon is to use our CLI and the project bootstrap wizard:\n\n```bash\nnpx neon@latest init --agent\n```\n\nUse the `--agent` flag to run in a non-interactive, state-machine mode.\n\nThis init command will guide you through installation of suggested Neon development tools. Everything is customizable. The defaults are:\n\n- Neon CLI installed globally\n- Neon MCP server installed globally\n- Neon Agent skills installed into the project\n\nIf `init` is run in an empty project, it will run the `bootstrap` command, offering to install one of our project templates.\n\n### Getting Started with the Neon CLI\n\n**Prefer the CLI over the MCP server** unless the user instructs otherwise, the CLI is unavailable or blocked in your environment, or it is not authenticated, since it provides more capabilities, including deploying Neon Functions.\n\nThe above `init` command will install the Neon CLI, but the CLI can also be installed manually with `npm i -g neon` or `bun i -g neon`. For full CLI installation options, see https:\u002F\u002Fneon.com\u002Fdocs\u002Fcli\u002Finstall.md\n\n#### Useful CLI Commands\n\nThese commands are included in the `init` command but can be run manually as needed.\n\n1. `neon link` — Interactively links the workspace to a Neon org, project, and branch, writing the IDs to a git-ignored `.neon` file. Run once per project. Once linked, project- and branch-scoped commands no longer need `--project-id` or `--branch` (for example, `neon branch list`). `neon link --agent` can be used to run in a non-interactive, state-machine mode.\n2. `neon checkout \u003Cbranch-name>` — Pins a different branch in `.neon`, creating it if it doesn't exist yet, and pulls that branch's env. It drives the [Branch-First Dev Flow](#branch-first-dev-flow) described below.\n3. `neon config init` — Initializes a `neon.ts` file, which declares how you provision and manage Neon services, in the root of the project.\n4. `neon env pull` — Fetches the current branch's Neon environment variables (`DATABASE_URL`, …) into your existing `.env`, or `.env.local` if you don't have one (override the target with `--file`). No branch ID needed; it reads `.neon`. **`link` and `checkout` run this for you by default**, so you rarely call it directly.\n\n   Without `neon.ts` it pulls the vars of every service the branch actually has (Postgres, plus Neon Auth, the Data API, and bucket `AWS_*` once provisioned); with `neon.ts` it pulls only the services declared there and errors if the branch is missing one — and the AI Gateway vars are never pulled unless `neon.ts` declares `aiGateway`.\n\n### Getting Started with the Neon MCP Server\n\nThe above `init` command will install the Neon MCP server globally, but it can also be installed manually using: `npx -y add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp -g -n Neon -y -a \u003Cagent-name>` or through your IDE plugin.\n\nFor all available plugins, see: https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fai-agents-tools.md\n\nFor full MCP server installation options, see https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fconnect-mcp-clients-to-neon.md\n\nUseful MCP tools to initialize a project:\n\n- `list_projects` — Lists the first 10 Neon projects in your account, providing a summary of each project. If you can't find a specific project, increase the limit by passing a higher value to the `limit` parameter.\n- `create_project` — Creates a new Neon project in your Neon account. A project acts as a container for branches, databases, roles, and computes.\n- `get_connection_string` — Returns your database connection string.\n\n## Neon Infrastructure as Code\n\n`neon.ts` is Neon's branch config and infrastructure-as-code file: declare which Neon services your project's branches should have, get type-safe env vars, and program branch settings — all in TypeScript. It's the config layer for your Neon services, and it composes with the branch-first loop below. Add it with `@neon\u002Fconfig`:\n\n```bash\nnpm i @neon\u002Fconfig\n```\n\n```typescript\n\u002F\u002F neon.ts\nimport { defineConfig } from \"@neon\u002Fconfig\u002Fv1\";\n\nexport default defineConfig({\n  preview: {\n    aiGateway: true,\n    buckets: {\n      images: {\n        access: \"private\",\n      },\n    },\n    functions: {\n      imagegen: {\n        name: \"AI SDK image agent\",\n        source: \"src\u002Findex.ts\",\n      },\n    },\n  },\n});\n```\n\n### Provision services with neon config\n\nEvery project ships with Lakebase Postgres; `neon.ts` lets you also declare Neon Auth and the Data API today, with Functions, buckets, and the AI Gateway under a `preview` block — every service for the branch composes in one file:\n\n```typescript\n\u002F\u002F neon.ts\nexport default defineConfig({\n  auth: true,\n  dataApi: true,\n  preview: {\n    functions: {\n      \u002F* ... *\u002F\n    }, \u002F\u002F see the neon-functions skill\n    buckets: {\n      \u002F* ... *\u002F\n    }, \u002F\u002F see the neon-object-storage skill\n    aiGateway: true, \u002F\u002F see the neon-ai-gateway skill\n  },\n});\n```\n\nReconcile the declaration from the CLI — the Neon equivalent of `terraform status` \u002F `plan` \u002F `apply`:\n\n```bash\nneon status          # print the branch's live config (read-only). Alias for `neon config status`.\nneon config plan     # dry-run diff of what apply would change (read-only)\nneon deploy          # provision the declared services. Alias for `neon config apply`\n```\n\n`apply` \u002F `deploy` provision the declared services **and then pull the branch's env into your local `.env.local`** (e.g. `Pulled 5 Neon variables into .env.local: DATABASE_URL, …`), so your local env always matches what's deployed.\n\n### Type-safe env vars with parseEnv\n\n`@neon\u002Fenv`'s `parseEnv` takes your `neon.ts` config object and returns a parsed, typed env object, validated against the services you declared. The shape of `env` follows your config, and missing variables are flagged with clear errors.\n\n```bash\nnpm i @neon\u002Fenv\n```\n\n```typescript\nimport { parseEnv } from \"@neon\u002Fenv\";\nimport config from \".\u002Fneon\";\n\nconst env = parseEnv(config);\n\nconsole.log(env.postgres.databaseUrl);\nconsole.log(env.auth.baseUrl);\n```\n\nBy default `parseEnv` requires _every_ variable your config implies. When one of your apps only uses a subset, for example when you need to read `DATABASE_URL` but never the unpooled URL, pass an array of env-var keys to require and validate only those. The keys are typesafe: autocomplete only offers variables your config enables, and the returned shape is narrowed to exactly what you selected (so unselected variables are neither enforced nor present).\n\n```typescript\nimport { parseEnv } from \"@neon\u002Fenv\";\nimport config from \".\u002Fneon\";\n\n\u002F\u002F Only DATABASE_URL is required and returned; DATABASE_URL_UNPOOLED is not enforced.\nconst { postgres } = parseEnv(config, [\"DATABASE_URL\"]);\nconsole.log(postgres.databaseUrl);\n\n\u002F\u002F Selecting across services — only these keys are validated.\nconst env = parseEnv(config, [\"DATABASE_URL\", \"NEON_AUTH_BASE_URL\"]);\nconsole.log(env.postgres.databaseUrl, env.auth.baseUrl);\n```\n\n### Branch configuration\n\nBeyond services, `neon.ts` can program what configuration _new_ branches receive via the `branch` property — a function of the branch being evaluated that returns its settings:\n\n```typescript\n\u002F\u002F neon.ts\nimport { defineConfig } from \"@neon\u002Fconfig\u002Fv1\";\n\nexport default defineConfig({\n  auth: true,\n  dataApi: true,\n  branch: (branch) => {\n    if (branch.exists) {\n      \u002F\u002F leave existing branches untouched\n      return {};\n    }\n    if (branch.name.startsWith(\"dev\")) {\n      return {\n        ttl: \"7d\", \u002F\u002F clean up the branch after 7 days\n        postgres: {\n          computeSettings: {\n            autoscalingLimitMinCu: 0.25, \u002F\u002F scale to zero\n            autoscalingLimitMaxCu: 1, \u002F\u002F keep it cheap\n            suspendTimeout: \"5m\",\n          },\n        },\n      };\n    }\n    return {};\n  },\n});\n```\n\nThe `branch` function receives the target branch (its `name`, whether it `exists` yet, whether it's the default, and more) and returns the tuning you want. Here new `dev-*` branches get a 7-day TTL so they clean themselves up, plus a cheap scale-to-zero compute profile, while existing branches and everything else fall through to the defaults. Because `neon checkout` applies this policy on create, a fresh `dev-*` branch comes up with these settings already in place.\n\n### Type-safe config: invalid setups don't compile\n\nBecause `neon.ts` is TypeScript, the compiler catches invalid infrastructure before you ever deploy — and Neon encodes the actual rules (and their fixes) into the types, so the error tells you what to do rather than failing with a useless `Type 'true' is not assignable to type 'never'`. The canonical case: the Data API verifies requests with Neon Auth by default, so enabling it on its own is a type error _on_ `dataApi`:\n\n```typescript\nexport default defineConfig({\n  dataApi: true, \u002F\u002F type error: `dataApi` (default authProvider 'neon') requires Neon Auth\n});\n```\n\nThe message names both fixes, so pick one:\n\n```typescript\n\u002F\u002F 1. Enable Neon Auth (the default Data API auth provider):\nexport default defineConfig({ auth: true, dataApi: true });\n\n\u002F\u002F 2. Or verify a third-party IdP instead of Neon Auth:\nexport default defineConfig({\n  dataApi: {\n    authProvider: \"external\",\n    jwksUrl: \"https:\u002F\u002Fyour-idp\u002F.well-known\u002Fjwks.json\",\n  },\n});\n```\n\nTreat a `neon.ts` type error as the config telling you which services must go together — read the message, it spells out the valid combinations.\n\nSee https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fneon-ts.md for documentation on the `neon.ts` file.\n\n## Branch-First Dev Flow\n\nNeon branches enable a branch-first development flow, which we recommend when using Neon services. This and `neon.ts` above are the two halves of the recommended setup — `neon.ts` declares what every branch should have, and the branch-first loop is how you move between those branches day to day. Each works on its own, and they compose.\n\nCreate a Neon branch any time you would create a git branch. Use the following commands if you have CLI access:\n\n- `neon checkout \u003Cbranch-name>` — Creates the branch if it doesn't exist, or checks out the existing one, by updating only the branch pointer in `.neon`. Run without a name for an interactive picker. It does not touch code or local Postgres.\n- `neon env pull` — Fetches the current branch's Neon environment variables into your `.env` (see [Useful CLI Commands](#useful-cli-commands) above). **`link` and `checkout` run this for you by default**, so you rarely call it directly.\n- `neon diff` — Shows the schema diff between the child branch and its parent. Run this to see what changes have been made to the schema since the last branch was created and before you commit your changes.\n\n```bash\nneon link                     # once; also pulls the linked branch's env\nneon checkout dev-add-search  # per feature; also pulls the branch's env\n```\n\nBecause `link` and `checkout` pull env by default, the branch's `DATABASE_URL` lands in your local `.env` automatically — build against it, then `checkout` the next branch and repeat. As the agent, drive this loop yourself: run `checkout` between tasks.\n\n### How checkout composes with neon.ts\n\nWhen a `neon.ts` is present, `neon checkout` applies your policy as it **creates** a branch, so a fresh branch comes up with its declared settings and services already in place. Checking out an _existing_ branch never reconciles it — apply config changes to it explicitly with `neon config apply` (or `neon deploy`). The bundled `env pull` also checks `neon.ts` against the linked branch and fails fast if the branch is missing a declared service, pointing you at `neon deploy` to provision it, so your local env and the remote branch never drift apart silently.\n\n### Opting out of local env vars\n\nIf env vars are injected at runtime instead of written to disk — or you simply don't want secrets in the working tree — pass `--no-env-pull` to `link` \u002F `checkout` and supply the env another way:\n\n- `neon-env run -- \u003Cyour dev command>` (from `@neon\u002Fenv`) fetches the branch's vars from your `neon.ts` and injects them into the child process at runtime — no `.env` file needed. This is the runtime counterpart to the on-disk `env pull`.\n- `neon-env export` (from `@neon\u002Fenv`) prints the branch's env to stdout as dotenv lines or, with `--format json`, JSON — for piping into another env manager rather than running a command. For example, [varlock](https:\u002F\u002Fvarlock.dev) can bulk-load it from a `.env.schema` with `@setValuesBulk(exec(\"neon-env export --format json\"), format=json)`.\n- `fetchEnv` from `@neon\u002Fenv` is the programmatic version of the same thing: resolve the branch's env in code at runtime instead of shelling out to `neon-env run`.\n- `neon dev` injects the same vars into your local dev server — it's part of Neon Functions local development (a public beta feature).\n\nWhen an agent should not write a local `.env`, instruct it (for example in your `AGENTS.md`) to run `neon checkout \u003Cbranch> --no-env-pull` and rely on runtime injection.\n\nFor reading env you _already_ have on disk (typed and validated against your `neon.ts`), use `parseEnv` — see [Type-safe env vars with parseEnv](#type-safe-env-vars-with-parseenv) above.\n\n## Observability\n\nNeon exposes branch-scoped logs. **Today they cover Neon Functions and Object Storage only.** Postgres computes and the AI Gateway are coming; until then, neither emits records. Logs are region-gated like the other beta services above — only `us-east-2` is enabled today, and a branch in any other region answers `404` with reason `telemetry_not_enabled` rather than an empty result.\n\nUse Neon CLI 3.1 or newer first. **Decide which branch you are querying.** Without `--branch`, the CLI uses the branch pinned in `.neon`, or the project's default branch when the workspace isn't linked. A deployed function or bucket usually lives on a different branch than the one checked out for development, so an empty result is more often the wrong branch than a missing log.\n\n```bash\nneon logs query --since 1h\nneon logs query --branch production --source function --minimum-severity error --since 6h\nneon logs query --source storage --since 1h --output json\nneon logs fields\nneon logs field-values service_name --since 1h\n```\n\n`--source` accepts `function`, `storage`, and `pg_endpoint`, but only `function` and `storage` return records today — `pg_endpoint` is accepted and comes back empty until Postgres logs ship. The window defaults to 1h on `query` and 6h on `field-values`, and cannot exceed 7d on either. If Neon reports `--minimum-severity` as unsupported on a branch, use `--severity-text` instead. Run `neon logs --help` for the full filter and pagination interface.\n\n`--logql` replaces the structured filters with a raw stream selector or line filter. Its stream label is `entity_type`, not `source`:\n\n```bash\nneon logs query --since 1h --logql '{entity_type=\"function\"} |= \"timeout\"'\n```\n\nIf the CLI is unavailable, fall back to the Neon MCP server's read-only `query_logs`, `list_log_fields`, and `list_log_field_values` tools.\n\nIn TypeScript applications, use `@neon\u002Fsdk`. Project and branch are positional, and `query` returns a lazy paginated iterable rather than a promise:\n\n```typescript\nfor await (const record of neon.logs.query(projectId, branchId, {\n  since: \"1h\",\n  source: \"function\",\n})) {\n  console.log(record.timestamp, record.severity_text, record.message);\n}\n\nconst { data: fields } = await neon.logs.fields(projectId, branchId);\nconst { data: serviceNames } = await neon.logs.fieldValues(projectId, branchId, \"service_name\");\n```\n\n`query`'s iterator always throws on error, but `fields` and `fieldValues` follow the client's `throwOnError`, which defaults to `false` and hands back `{ data, error }`. `fieldValues` resolves to the whole response, not a bare array: read `serviceNames.values`, and treat them as an arbitrary subset whenever `serviceNames.is_truncated` is true.\n\n### Loki-compatible read API\n\nFor direct HTTP reads, authenticate with `Authorization: Bearer \u003CNEON_API_KEY>` and use this branch-scoped base URL:\n\n```text\nhttps:\u002F\u002Fconsole.neon.tech\u002Ftelemetry\u002Fv1\u002Fprojects\u002F{projectId}\u002Fbranches\u002F{branchId}\u002Floki\n```\n\nThe available endpoints are:\n\n- `GET \u002Fapi\u002Fv1\u002Fquery_range`\n- `GET \u002Fapi\u002Fv1\u002Flabels`\n- `GET \u002Fapi\u002Fv1\u002Flabel\u002F{name}\u002Fvalues`\n\nThis is a read-only Loki-compatible subset, not a push endpoint or complete Loki deployment. `query_range` supports LogQL stream selectors and line filters, plus `since` or `start`\u002F`end`, `limit`, and `direction`; it does not support aggregations, parsers, or formatting stages.\n\nThe paths above are the ones to call directly. A Loki client that builds its own paths — a Grafana data source appends `\u002Floki\u002Fapi\u002Fv1` to whatever URL it is given — may need a different root, so confirm the data-source URL against the Neon docs rather than pasting this base.\n\n## Manage Neon Resources\n\nRecommended: Use `@neon\u002Fsdk` to manage Neon resources programmatically, such as creating projects, branches, and snapshots for dev scripts, CI\u002FCD automations, and platforms building on top of Neon.\n\n`@neon\u002Fsdk` is the official TypeScript client for the [Neon API](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fapi-reference.md): **Fetch-based, zero-dependency, ESM-only**, generated from Neon's [OpenAPI spec](https:\u002F\u002Fneon.com\u002Fapi_spec\u002Frelease\u002Fv2.json) with an ergonomic layer on top. It is the successor to [`@neondatabase\u002Fapi-client`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@neondatabase\u002Fapi-client) (axios-based, generated-only). The old client is **not deprecated** and is safe to keep using, but new code should prefer `@neon\u002Fsdk`.\n\n### Neon for (Agentic) Platforms\n\nIf you're building agents that generate apps from prompts, your users want to build apps, not manage databases. Industry-leading platforms like Replit and V0 create databases on Neon because it aligns with how agents work: an instant, branchable, serverless Lakebase Postgres data layer, invisible to users.\n\nNeon features for agents:\n\n- Instant Provisioning: your users never wait for infrastructure.\n- Snapshots: let users toggle between checkpoints of code and state together.\n- Low cost-per-Database: automatic scale to zero and 350ms cold starts.\n- Full-Stack, Batteries-Included: Neon Auth, Data API included at no added charge.\n- Granular API Controls: Track and control usage for flexible limits and invoicing.\n\nAll details here: https:\u002F\u002Fneon.com\u002Fprograms\u002Fagents.md\n\nApply for the Neon Agent Program for special program pricing here: https:\u002F\u002Fneon.com\u002Fprograms\u002Fagents\n\n## Gotchas\n\n### Neon Auth: \"invalid domain\"\n\nNeon Auth only redirects back to domains on its trusted-domains list. Anytime the domain your app runs on changes — a new production custom domain, a new deploy\u002Fpreview URL, moving from `localhost` to a hosted environment, and so on — you must register the new domain with Neon Auth. Otherwise sign-in and OAuth callbacks fail with an **`invalid domain`** error because the redirect target isn't trusted.\n\nThe easiest way to fix this is the CLI. With the workspace linked to the project (see the branch-first flow above), add the new domain to the trusted list:\n\n```bash\nneon neon-auth domain add \u003Cdomain>   # e.g. neon neon-auth domain add https:\u002F\u002Fapp.example.com\nneon neon-auth domain list           # verify what's currently trusted\nneon neon-auth domain delete \u003Cdomain> # remove one you no longer use\n```\n\nIf the workspace isn't linked, pass `--project-id \u003Cid>` (and `--branch \u003Cid|name>`) explicitly. For local development, `neon neon-auth domain allow-localhost` manages whether `localhost` is permitted. Register the domain before pointing users at the new URL, so they never hit the `invalid domain` error.\n","# Neon\n\nImportant: Neon is no longer just a Postgres provider. Neon is a complete set of cloud backend primitives built around Lakebase Postgres, for developers, startups, and agent platforms, from Databricks — bundling Lakebase Postgres, Auth (managed Better Auth), long-running Functions, Object Storage, and an AI Gateway, all instant, branchable, and serverless.\n\n**Lakebase Postgres** is the database itself. It is one product, reached two ways: through Neon, with a free plan and the full set of backend primitives above, or through Databricks, alongside the rest of the Databricks suite. Same infrastructure, same features, same engineering team. Call the database Lakebase Postgres, and use \"Neon\" for the brand and for this access path — not as a name for the database.\n\nA Neon branch is an isolated, copy-on-write clone of your data, taken from its current state or from a past state within your project's retained history window. You can freely modify or delete it. It shares data with its parent until writes cause it to diverge, and those writes are stored independently as deltas.\n\n## Backend Primitives\n\nNeon bundles several backend primitives for building apps and agents that all branch together:\n\n- **Lakebase Postgres** — Postgres that scales and branches with your app, built on the lakebase architecture: OLTP directly on cloud object storage, with storage decoupled from compute. _Generally available._\n- **Auth** — Managed Better Auth with users and sessions stored in Postgres. _Generally available._\n- **Object Storage** — S3-compatible object storage that branches with your projects. _Public beta._\n- **Functions** — Neon's compute offering: long-running serverless functions that run close to your database, for WebSocket servers, long agent HTTP streams, APIs, and server-sent event servers. _Public beta._\n- **AI Gateway** — One API for frontier and open-source models, supporting the chat completions API and the responses API, powered by Databricks Unity AI Gateway. _Public beta._\n\n### Public Beta Service Availability\n\nObject Storage, Functions, and AI Gateway are in public beta.\n\nBeta access features are only available on projects in the `us-east-2` region. Before guiding a user through any of these services, confirm they are working in `us-east-2`. If not, they will need to create a new project in that region.\n\n## Architecture: How to Use Neon\n\nNeon is **not** a place to host your app frontend. Neon provides the backend primitives (Lakebase Postgres, Auth, Object Storage, Functions, AI Gateway) that **compose with** the application platform you already use.\n\nRecommended architectures:\n\n**Full-stack app on Vercel** (or Netlify) augmented with Neon — the app framework (Next.js, TanStack Start, etc.) owns your UI and routes and talks directly to your Neon services (Lakebase Postgres, Auth, Object Storage, Functions, AI Gateway).\n\n**Reach for Neon Functions when you outgrow the host's limits** — a WebSocket or SSE server, long-running agents, or an MCP server that risks timing out on short, lambda-style serverless functions. As long as there is an active connection, a Neon Function can run up to 24 hours without interruption, with the added benefit of running close to your data.\n\n**Move your whole backend control plane onto Neon Functions** — especially useful when the frontend is **client-only** rather than full-stack: TanStack Router, React Router in client mode, and similar SPAs hosted on Vercel or Netlify. The client talks **directly to Neon Functions**, where you build REST APIs and request\u002Fresponse agents. Secure these functions like any standalone REST API — verify a JWT or API key at the top of each handler (see the `neon-functions` skill).\n\nBecause Functions are just your backend, they compose with a full-stack app that already has one (Next.js route handlers, etc.), too.\n\n## Neon Documentation\n\nThe Neon documentation is the source of truth for all Neon-related information. Always verify claims against the official docs before responding. Neon features and APIs evolve, so prefer fetching current docs over relying on training data.\n\n### Finding the Right Page\n\nLook the page up before you fetch it — **don't guess URLs!** The docs index lists every available page with its URL and a short description:\n\n```\nhttps:\u002F\u002Fneon.com\u002Fdocs\u002Fllms.txt\n```\n\n### Fetching Docs as Markdown\n\nAny Neon doc page can be fetched as markdown in two ways:\n\n1. **Append `.md` to the URL** (simplest): https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching.md\n2. **Request `text\u002Fmarkdown`** on the standard URL: `curl -H \"Accept: text\u002Fmarkdown\" https:\u002F\u002Fneon.com\u002Fdocs\u002Fintroduction\u002Fbranching`\n\nBoth return the same markdown content. Use whichever method your tools support.\n\n## Choosing the Right Skill\n\nNeon provides a set of agent skills in addition to the official documentation. When a task matches one of the rows below, work from that skill rather than from this overview. You may have some of these skills already installed, or you may need to install them.\n\nThe skills below live in the [`neondatabase\u002Fagent-skills`](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills) repo:\n\n| Skill | Use it for |\n| --- | --- |\n| `neon-postgres` | Working with databases, including connections, schemas, queries, and autoscaling: SQL development, schema design, performance optimization, and scaling decisions. |\n| `neon-postgres-branches` | Choosing or creating the right branch type for dev, preview, test, or CI workflows. Use this skill as a slash command. |\n| `neon-object-storage` | Storing and serving files (uploads, images, blobs), including branching them with the database. |\n| `neon-functions` | Deploying long-running or streaming serverless functions — APIs, agents, SSE\u002FWebSocket servers. |\n| `neon-ai-gateway` | Calling an LLM or routing across model providers with one credential, including discovering the branch's servable models at runtime via the OpenAI-compatible `\u002Fv1\u002Fmodels` endpoint. |\n| `claimable-postgres` | Provisioning instant, claimable temporary Postgres databases (for example, one per end user or demo). |\n| `neon-postgres-egress-optimizer` | Diagnosing or fixing excessive Postgres egress (network data-transfer) costs in a codebase. |\n\nFor guidance on agent platforms that provision and operate Lakebase Postgres on Neon at scale, use `neon-postgres-agent-platforms`, which lives in a separate repo: [`neondatabase\u002Fneon-for-agent-platforms`](https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fneon-for-agent-platforms).\n\n### Installing the Right Skill\n\nFirst check whether the target skill is already installed and accessible (for example, it appears in the available skills list or its `SKILL.md` is present). If it is, use it directly. If it is not installed, install it via the `skills` CLI, if available, with `npx`\u002F`bunx`:\n\n```bash\nnpx skills add neondatabase\u002Fagent-skills -s \u003Cskill-name>\n```\n\nReplace `\u003Cskill-name>` with the skill you need (for example, `neon-object-storage`, `neon-functions`, or `neon-ai-gateway`). Useful flags:\n\n- `-g` — install globally instead of into the current project.\n- `-y` — non-interactive mode (skip prompts).\n- `-a \u003Cagent-name>` — pick the target agent(s) for non-interactive mode.\n\nFor example, to install the object storage skill globally for a specific agent without prompts:\n\n```bash\nnpx skills add neondatabase\u002Fagent-skills -s neon-object-storage -g -y -a \u003Cagent-name>\n```\n\nIf you don't have access to the `skills` CLI, you can visit https:\u002F\u002Fneon.com\u002F.well-known\u002Fagent-skills for a registry of all available Neon skills and fetch them manually.\n\n### Updating Skills\n\nKeep the skills up to date: for every new session, update them so you are working with the latest best practices.\n\nUse the same method that was used to install them. With the `skills` CLI, run the install command above with `update` in place of `add`, or run `npx skills update` to update all Neon skills. If the skills were installed via a plugin, they are updated automatically.\n\n## Getting Started with Neon\n\nThe easiest way to get started with Neon is to use our CLI and the project bootstrap wizard:\n\n```bash\nnpx neon@latest init --agent\n```\n\nUse the `--agent` flag to run in a non-interactive, state-machine mode.\n\nThis init command will guide you through installation of suggested Neon development tools. Everything is customizable. The defaults are:\n\n- Neon CLI installed globally\n- Neon MCP server installed globally\n- Neon Agent skills installed into the project\n\nIf `init` is run in an empty project, it will run the `bootstrap` command, offering to install one of our project templates.\n\n### Getting Started with the Neon CLI\n\n**Prefer the CLI over the MCP server** unless the user instructs otherwise, the CLI is unavailable or blocked in your environment, or it is not authenticated, since it provides more capabilities, including deploying Neon Functions.\n\nThe above `init` command will install the Neon CLI, but the CLI can also be installed manually with `npm i -g neon` or `bun i -g neon`. For full CLI installation options, see https:\u002F\u002Fneon.com\u002Fdocs\u002Fcli\u002Finstall.md\n\n#### Useful CLI Commands\n\nThese commands are included in the `init` command but can be run manually as needed.\n\n1. `neon link` — Interactively links the workspace to a Neon org, project, and branch, writing the IDs to a git-ignored `.neon` file. Run once per project. Once linked, project- and branch-scoped commands no longer need `--project-id` or `--branch` (for example, `neon branch list`). `neon link --agent` can be used to run in a non-interactive, state-machine mode.\n2. `neon checkout \u003Cbranch-name>` — Pins a different branch in `.neon`, creating it if it doesn't exist yet, and pulls that branch's env. It drives the [Branch-First Dev Flow](#branch-first-dev-flow) described below.\n3. `neon config init` — Initializes a `neon.ts` file, which declares how you provision and manage Neon services, in the root of the project.\n4. `neon env pull` — Fetches the current branch's Neon environment variables (`DATABASE_URL`, …) into your existing `.env`, or `.env.local` if you don't have one (override the target with `--file`). No branch ID needed; it reads `.neon`. **`link` and `checkout` run this for you by default**, so you rarely call it directly.\n\n   Without `neon.ts` it pulls the vars of every service the branch actually has (Postgres, plus Neon Auth, the Data API, and bucket `AWS_*` once provisioned); with `neon.ts` it pulls only the services declared there and errors if the branch is missing one — and the AI Gateway vars are never pulled unless `neon.ts` declares `aiGateway`.\n\n### Getting Started with the Neon MCP Server\n\nThe above `init` command will install the Neon MCP server globally, but it can also be installed manually using: `npx -y add-mcp https:\u002F\u002Fmcp.neon.tech\u002Fmcp -g -n Neon -y -a \u003Cagent-name>` or through your IDE plugin.\n\nFor all available plugins, see: https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fai-agents-tools.md\n\nFor full MCP server installation options, see https:\u002F\u002Fneon.com\u002Fdocs\u002Fai\u002Fconnect-mcp-clients-to-neon.md\n\nUseful MCP tools to initialize a project:\n\n- `list_projects` — Lists the first 10 Neon projects in your account, providing a summary of each project. If you can't find a specific project, increase the limit by passing a higher value to the `limit` parameter.\n- `create_project` — Creates a new Neon project in your Neon account. A project acts as a container for branches, databases, roles, and computes.\n- `get_connection_string` — Returns your database connection string.\n\n## Neon Infrastructure as Code\n\n`neon.ts` is Neon's branch config and infrastructure-as-code file: declare which Neon services your project's branches should have, get type-safe env vars, and program branch settings — all in TypeScript. It's the config layer for your Neon services, and it composes with the branch-first loop below. Add it with `@neon\u002Fconfig`:\n\n```bash\nnpm i @neon\u002Fconfig\n```\n\n```typescript\n\u002F\u002F neon.ts\nimport { defineConfig } from \"@neon\u002Fconfig\u002Fv1\";\n\nexport default defineConfig({\n  preview: {\n    aiGateway: true,\n    buckets: {\n      images: {\n        access: \"private\",\n      },\n    },\n    functions: {\n      imagegen: {\n        name: \"AI SDK image agent\",\n        source: \"src\u002Findex.ts\",\n      },\n    },\n  },\n});\n```\n\n### Provision services with neon config\n\nEvery project ships with Lakebase Postgres; `neon.ts` lets you also declare Neon Auth and the Data API today, with Functions, buckets, and the AI Gateway under a `preview` block — every service for the branch composes in one file:\n\n```typescript\n\u002F\u002F neon.ts\nexport default defineConfig({\n  auth: true,\n  dataApi: true,\n  preview: {\n    functions: {\n      \u002F* ... *\u002F\n    }, \u002F\u002F see the neon-functions skill\n    buckets: {\n      \u002F* ... *\u002F\n    }, \u002F\u002F see the neon-object-storage skill\n    aiGateway: true, \u002F\u002F see the neon-ai-gateway skill\n  },\n});\n```\n\nReconcile the declaration from the CLI — the Neon equivalent of `terraform status` \u002F `plan` \u002F `apply`:\n\n```bash\nneon status          # print the branch's live config (read-only). Alias for `neon config status`.\nneon config plan     # dry-run diff of what apply would change (read-only)\nneon deploy          # provision the declared services. Alias for `neon config apply`\n```\n\n`apply` \u002F `deploy` provision the declared services **and then pull the branch's env into your local `.env.local`** (e.g. `Pulled 5 Neon variables into .env.local: DATABASE_URL, …`), so your local env always matches what's deployed.\n\n### Type-safe env vars with parseEnv\n\n`@neon\u002Fenv`'s `parseEnv` takes your `neon.ts` config object and returns a parsed, typed env object, validated against the services you declared. The shape of `env` follows your config, and missing variables are flagged with clear errors.\n\n```bash\nnpm i @neon\u002Fenv\n```\n\n```typescript\nimport { parseEnv } from \"@neon\u002Fenv\";\nimport config from \".\u002Fneon\";\n\nconst env = parseEnv(config);\n\nconsole.log(env.postgres.databaseUrl);\nconsole.log(env.auth.baseUrl);\n```\n\nBy default `parseEnv` requires _every_ variable your config implies. When one of your apps only uses a subset, for example when you need to read `DATABASE_URL` but never the unpooled URL, pass an array of env-var keys to require and validate only those. The keys are typesafe: autocomplete only offers variables your config enables, and the returned shape is narrowed to exactly what you selected (so unselected variables are neither enforced nor present).\n\n```typescript\nimport { parseEnv } from \"@neon\u002Fenv\";\nimport config from \".\u002Fneon\";\n\n\u002F\u002F Only DATABASE_URL is required and returned; DATABASE_URL_UNPOOLED is not enforced.\nconst { postgres } = parseEnv(config, [\"DATABASE_URL\"]);\nconsole.log(postgres.databaseUrl);\n\n\u002F\u002F Selecting across services — only these keys are validated.\nconst env = parseEnv(config, [\"DATABASE_URL\", \"NEON_AUTH_BASE_URL\"]);\nconsole.log(env.postgres.databaseUrl, env.auth.baseUrl);\n```\n\n### Branch configuration\n\nBeyond services, `neon.ts` can program what configuration _new_ branches receive via the `branch` property — a function of the branch being evaluated that returns its settings:\n\n```typescript\n\u002F\u002F neon.ts\nimport { defineConfig } from \"@neon\u002Fconfig\u002Fv1\";\n\nexport default defineConfig({\n  auth: true,\n  dataApi: true,\n  branch: (branch) => {\n    if (branch.exists) {\n      \u002F\u002F leave existing branches untouched\n      return {};\n    }\n    if (branch.name.startsWith(\"dev\")) {\n      return {\n        ttl: \"7d\", \u002F\u002F clean up the branch after 7 days\n        postgres: {\n          computeSettings: {\n            autoscalingLimitMinCu: 0.25, \u002F\u002F scale to zero\n            autoscalingLimitMaxCu: 1, \u002F\u002F keep it cheap\n            suspendTimeout: \"5m\",\n          },\n        },\n      };\n    }\n    return {};\n  },\n});\n```\n\nThe `branch` function receives the target branch (its `name`, whether it `exists` yet, whether it's the default, and more) and returns the tuning you want. Here new `dev-*` branches get a 7-day TTL so they clean themselves up, plus a cheap scale-to-zero compute profile, while existing branches and everything else fall through to the defaults. Because `neon checkout` applies this policy on create, a fresh `dev-*` branch comes up with these settings already in place.\n\n### Type-safe config: invalid setups don't compile\n\nBecause `neon.ts` is TypeScript, the compiler catches invalid infrastructure before you ever deploy — and Neon encodes the actual rules (and their fixes) into the types, so the error tells you what to do rather than failing with a useless `Type 'true' is not assignable to type 'never'`. The canonical case: the Data API verifies requests with Neon Auth by default, so enabling it on its own is a type error _on_ `dataApi`:\n\n```typescript\nexport default defineConfig({\n  dataApi: true, \u002F\u002F type error: `dataApi` (default authProvider 'neon') requires Neon Auth\n});\n```\n\nThe message names both fixes, so pick one:\n\n```typescript\n\u002F\u002F 1. Enable Neon Auth (the default Data API auth provider):\nexport default defineConfig({ auth: true, dataApi: true });\n\n\u002F\u002F 2. Or verify a third-party IdP instead of Neon Auth:\nexport default defineConfig({\n  dataApi: {\n    authProvider: \"external\",\n    jwksUrl: \"https:\u002F\u002Fyour-idp\u002F.well-known\u002Fjwks.json\",\n  },\n});\n```\n\nTreat a `neon.ts` type error as the config telling you which services must go together — read the message, it spells out the valid combinations.\n\nSee https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fneon-ts.md for documentation on the `neon.ts` file.\n\n## Branch-First Dev Flow\n\nNeon branches enable a branch-first development flow, which we recommend when using Neon services. This and `neon.ts` above are the two halves of the recommended setup — `neon.ts` declares what every branch should have, and the branch-first loop is how you move between those branches day to day. Each works on its own, and they compose.\n\nCreate a Neon branch any time you would create a git branch. Use the following commands if you have CLI access:\n\n- `neon checkout \u003Cbranch-name>` — Creates the branch if it doesn't exist, or checks out the existing one, by updating only the branch pointer in `.neon`. Run without a name for an interactive picker. It does not touch code or local Postgres.\n- `neon env pull` — Fetches the current branch's Neon environment variables into your `.env` (see [Useful CLI Commands](#useful-cli-commands) above). **`link` and `checkout` run this for you by default**, so you rarely call it directly.\n- `neon diff` — Shows the schema diff between the child branch and its parent. Run this to see what changes have been made to the schema since the last branch was created and before you commit your changes.\n\n```bash\nneon link                     # once; also pulls the linked branch's env\nneon checkout dev-add-search  # per feature; also pulls the branch's env\n```\n\nBecause `link` and `checkout` pull env by default, the branch's `DATABASE_URL` lands in your local `.env` automatically — build against it, then `checkout` the next branch and repeat. As the agent, drive this loop yourself: run `checkout` between tasks.\n\n### How checkout composes with neon.ts\n\nWhen a `neon.ts` is present, `neon checkout` applies your policy as it **creates** a branch, so a fresh branch comes up with its declared settings and services already in place. Checking out an _existing_ branch never reconciles it — apply config changes to it explicitly with `neon config apply` (or `neon deploy`). The bundled `env pull` also checks `neon.ts` against the linked branch and fails fast if the branch is missing a declared service, pointing you at `neon deploy` to provision it, so your local env and the remote branch never drift apart silently.\n\n### Opting out of local env vars\n\nIf env vars are injected at runtime instead of written to disk — or you simply don't want secrets in the working tree — pass `--no-env-pull` to `link` \u002F `checkout` and supply the env another way:\n\n- `neon-env run -- \u003Cyour dev command>` (from `@neon\u002Fenv`) fetches the branch's vars from your `neon.ts` and injects them into the child process at runtime — no `.env` file needed. This is the runtime counterpart to the on-disk `env pull`.\n- `neon-env export` (from `@neon\u002Fenv`) prints the branch's env to stdout as dotenv lines or, with `--format json`, JSON — for piping into another env manager rather than running a command. For example, [varlock](https:\u002F\u002Fvarlock.dev) can bulk-load it from a `.env.schema` with `@setValuesBulk(exec(\"neon-env export --format json\"), format=json)`.\n- `fetchEnv` from `@neon\u002Fenv` is the programmatic version of the same thing: resolve the branch's env in code at runtime instead of shelling out to `neon-env run`.\n- `neon dev` injects the same vars into your local dev server — it's part of Neon Functions local development (a public beta feature).\n\nWhen an agent should not write a local `.env`, instruct it (for example in your `AGENTS.md`) to run `neon checkout \u003Cbranch> --no-env-pull` and rely on runtime injection.\n\nFor reading env you _already_ have on disk (typed and validated against your `neon.ts`), use `parseEnv` — see [Type-safe env vars with parseEnv](#type-safe-env-vars-with-parseenv) above.\n\n## Observability\n\nNeon exposes branch-scoped logs. **Today they cover Neon Functions and Object Storage only.** Postgres computes and the AI Gateway are coming; until then, neither emits records. Logs are region-gated like the other beta services above — only `us-east-2` is enabled today, and a branch in any other region answers `404` with reason `telemetry_not_enabled` rather than an empty result.\n\nUse Neon CLI 3.1 or newer first. **Decide which branch you are querying.** Without `--branch`, the CLI uses the branch pinned in `.neon`, or the project's default branch when the workspace isn't linked. A deployed function or bucket usually lives on a different branch than the one checked out for development, so an empty result is more often the wrong branch than a missing log.\n\n```bash\nneon logs query --since 1h\nneon logs query --branch production --source function --minimum-severity error --since 6h\nneon logs query --source storage --since 1h --output json\nneon logs fields\nneon logs field-values service_name --since 1h\n```\n\n`--source` accepts `function`, `storage`, and `pg_endpoint`, but only `function` and `storage` return records today — `pg_endpoint` is accepted and comes back empty until Postgres logs ship. The window defaults to 1h on `query` and 6h on `field-values`, and cannot exceed 7d on either. If Neon reports `--minimum-severity` as unsupported on a branch, use `--severity-text` instead. Run `neon logs --help` for the full filter and pagination interface.\n\n`--logql` replaces the structured filters with a raw stream selector or line filter. Its stream label is `entity_type`, not `source`:\n\n```bash\nneon logs query --since 1h --logql '{entity_type=\"function\"} |= \"timeout\"'\n```\n\nIf the CLI is unavailable, fall back to the Neon MCP server's read-only `query_logs`, `list_log_fields`, and `list_log_field_values` tools.\n\nIn TypeScript applications, use `@neon\u002Fsdk`. Project and branch are positional, and `query` returns a lazy paginated iterable rather than a promise:\n\n```typescript\nfor await (const record of neon.logs.query(projectId, branchId, {\n  since: \"1h\",\n  source: \"function\",\n})) {\n  console.log(record.timestamp, record.severity_text, record.message);\n}\n\nconst { data: fields } = await neon.logs.fields(projectId, branchId);\nconst { data: serviceNames } = await neon.logs.fieldValues(projectId, branchId, \"service_name\");\n```\n\n`query`'s iterator always throws on error, but `fields` and `fieldValues` follow the client's `throwOnError`, which defaults to `false` and hands back `{ data, error }`. `fieldValues` resolves to the whole response, not a bare array: read `serviceNames.values`, and treat them as an arbitrary subset whenever `serviceNames.is_truncated` is true.\n\n### Loki-compatible read API\n\nFor direct HTTP reads, authenticate with `Authorization: Bearer \u003CNEON_API_KEY>` and use this branch-scoped base URL:\n\n```text\nhttps:\u002F\u002Fconsole.neon.tech\u002Ftelemetry\u002Fv1\u002Fprojects\u002F{projectId}\u002Fbranches\u002F{branchId}\u002Floki\n```\n\nThe available endpoints are:\n\n- `GET \u002Fapi\u002Fv1\u002Fquery_range`\n- `GET \u002Fapi\u002Fv1\u002Flabels`\n- `GET \u002Fapi\u002Fv1\u002Flabel\u002F{name}\u002Fvalues`\n\nThis is a read-only Loki-compatible subset, not a push endpoint or complete Loki deployment. `query_range` supports LogQL stream selectors and line filters, plus `since` or `start`\u002F`end`, `limit`, and `direction`; it does not support aggregations, parsers, or formatting stages.\n\nThe paths above are the ones to call directly. A Loki client that builds its own paths — a Grafana data source appends `\u002Floki\u002Fapi\u002Fv1` to whatever URL it is given — may need a different root, so confirm the data-source URL against the Neon docs rather than pasting this base.\n\n## Manage Neon Resources\n\nRecommended: Use `@neon\u002Fsdk` to manage Neon resources programmatically, such as creating projects, branches, and snapshots for dev scripts, CI\u002FCD automations, and platforms building on top of Neon.\n\n`@neon\u002Fsdk` is the official TypeScript client for the [Neon API](https:\u002F\u002Fneon.com\u002Fdocs\u002Freference\u002Fapi-reference.md): **Fetch-based, zero-dependency, ESM-only**, generated from Neon's [OpenAPI spec](https:\u002F\u002Fneon.com\u002Fapi_spec\u002Frelease\u002Fv2.json) with an ergonomic layer on top. It is the successor to [`@neondatabase\u002Fapi-client`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@neondatabase\u002Fapi-client) (axios-based, generated-only). The old client is **not deprecated** and is safe to keep using, but new code should prefer `@neon\u002Fsdk`.\n\n### Neon for (Agentic) Platforms\n\nIf you're building agents that generate apps from prompts, your users want to build apps, not manage databases. Industry-leading platforms like Replit and V0 create databases on Neon because it aligns with how agents work: an instant, branchable, serverless Lakebase Postgres data layer, invisible to users.\n\nNeon features for agents:\n\n- Instant Provisioning: your users never wait for infrastructure.\n- Snapshots: let users toggle between checkpoints of code and state together.\n- Low cost-per-Database: automatic scale to zero and 350ms cold starts.\n- Full-Stack, Batteries-Included: Neon Auth, Data API included at no added charge.\n- Granular API Controls: Track and control usage for flexible limits and invoicing.\n\nAll details here: https:\u002F\u002Fneon.com\u002Fprograms\u002Fagents.md\n\nApply for the Neon Agent Program for special program pricing here: https:\u002F\u002Fneon.com\u002Fprograms\u002Fagents\n\n## Gotchas\n\n### Neon Auth: \"invalid domain\"\n\nNeon Auth only redirects back to domains on its trusted-domains list. Anytime the domain your app runs on changes — a new production custom domain, a new deploy\u002Fpreview URL, moving from `localhost` to a hosted environment, and so on — you must register the new domain with Neon Auth. Otherwise sign-in and OAuth callbacks fail with an **`invalid domain`** error because the redirect target isn't trusted.\n\nThe easiest way to fix this is the CLI. With the workspace linked to the project (see the branch-first flow above), add the new domain to the trusted list:\n\n```bash\nneon neon-auth domain add \u003Cdomain>   # e.g. neon neon-auth domain add https:\u002F\u002Fapp.example.com\nneon neon-auth domain list           # verify what's currently trusted\nneon neon-auth domain delete \u003Cdomain> # remove one you no longer use\n```\n\nIf the workspace isn't linked, pass `--project-id \u003Cid>` (and `--branch \u003Cid|name>`) explicitly. For local development, `neon neon-auth domain allow-localhost` manages whether `localhost` is permitted. Register the domain before pointing users at the new URL, so they never hit the `invalid domain` error.\n",{"metadata":24,"description":7},{"source":25},"https:\u002F\u002Fgithub.com\u002Fneondatabase\u002Fagent-skills\u002Ftree\u002Fmain\u002Fskills\u002Fneon","main","58843b159d7a4050d6b785a98b908cce505c0b92","agent\u002Fskills\u002Fneon",0,"https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent","https:\u002F\u002Fgithub.com\u002FReihantt6","reihsns.web.id","2026-08-19 20:08:18",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Reihantt6\u002Fsns-myagent --skill neon",{"tool":40,"command":41},"bunx","bunx skills add Reihantt6\u002Fsns-myagent --skill neon",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Reihantt6\u002Fsns-myagent --skill neon","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fneon\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M77XDCYZ407XYMF2T4P6F7VT","youtube-transcript","Extract transcripts from YouTube videos. Use when the user asks for a transcript, subtitles, or captions of a YouTube video and provides a YouTube URL (youtube.com\u002Fwatch?v=, youtu.be\u002F, or similar). Supports output with or without timestamps.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-transcript\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M77XD7PBC98J6MXGJJ2TJ8DX","youtube-thumbnail-design","YouTube thumbnail design with specific dimensions, contrast rules, and mobile preview optimization. Covers safe zones, text placement, face expression psychology, and A\u002FB testing. Use for: YouTube thumbnails, video cover images, click-through optimization. Triggers: youtube thumbnail, thumbnail design, video thumbnail, click through rate, ctr optimization, youtube cover, video cover image, thumbnail maker, thumbnail tips, youtube design, video preview image","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-thumbnail-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M77XD2541C8HXJ6RHYZP4NGJ","youtube-short-maker","Make YouTube Shorts that hold attention with Pexo — vertical 9:16, fast-paced, hook in the first 3 seconds. Describe your topic and Pexo writes the script, generates the shots, picks the models, and assembles a finished Short with music and captions. Use for YouTube Shorts: \"youtube short\", \"make a youtube short\", \"shorts video\", \"short-form video\". NOT for long-form or landscape video.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fyoutube-short-maker\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M77XCXKVSYK7KTZ3PQBVVGFD","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fxcode-project-setup\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M77XCR1DV8ZQK2NHWKVY4EWX","x402","Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — \"just use it\" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing touches your codebase) or \"build it in\" (install the SDK and write the key + code into your project). Walks through wallet setup, funding, .env, and a ~$1 test run. Use when the user asks about x402, pay-per-use, USDC payments, or wants Browser Use Cloud without an API key. For the free-tier signup (reverse-CAPTCHA → API key), use `browser-use cloud signup` or the `cloud` skill instead.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx402\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M77XCMD3R3ZBZQQSW6E0793B","x-twitter-scraper","Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, hosted Apify Actor runs, MCP tools, TweetClaw OpenClaw plugin installs, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation.","https:\u002F\u002Fgithub.com\u002FReihantt6\u002Fsns-myagent\u002Fblob\u002Fmain\u002Fagent\u002Fskills\u002Fx-twitter-scraper\u002FSKILL.md",[],[]]