vybekiit 0.7.3 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +16607 -7527
- package/dist/global-skills/aws-cdk/SKILL.md +2 -1
- package/dist/global-skills/aws-cloudformation/SKILL.md +2 -1
- package/dist/global-skills/aws-serverless/SKILL.md +45 -44
- package/dist/global-skills/aws-serverless/assets/powertools-handler.py +2 -1
- package/dist/global-skills/aws-serverless/references/api-gateway.md +50 -470
- package/dist/global-skills/aws-serverless/references/architecture.md +47 -186
- package/dist/global-skills/aws-serverless/references/concurrency.md +44 -158
- package/dist/global-skills/aws-serverless/references/deployment.md +1 -1
- package/dist/global-skills/aws-serverless/references/event-sources.md +72 -391
- package/dist/global-skills/aws-serverless/references/lambda.md +69 -428
- package/dist/global-skills/aws-serverless/references/orchestration.md +65 -384
- package/dist/global-skills/aws-serverless/references/production.md +78 -415
- package/dist/global-skills/aws-serverless/references/troubleshooting.md +92 -619
- package/dist/global-skills/claimable-postgres/SKILL.md +60 -49
- package/dist/global-skills/design-my-data/SKILL.md +2 -0
- package/dist/global-skills/eas-app-stores/SKILL.md +8 -0
- package/dist/global-skills/eas-app-stores/references/play-store.md +2 -0
- package/dist/global-skills/eas-hosting/SKILL.md +8 -0
- package/dist/global-skills/eas-observe/SKILL.md +30 -8
- package/dist/global-skills/eas-observe/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-observe/references/metrics.md +54 -3
- package/dist/global-skills/eas-observe/references/queries.md +78 -17
- package/dist/global-skills/eas-observe/references/setup.md +164 -5
- package/dist/global-skills/eas-observe/references/third-party.md +136 -0
- package/dist/global-skills/eas-simulator/SKILL.md +63 -11
- package/dist/global-skills/eas-simulator/references/controllers.md +21 -2
- package/dist/global-skills/eas-simulator/references/run-your-app.md +16 -11
- package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -5
- package/dist/global-skills/eas-update-insights/SKILL.md +8 -0
- package/dist/global-skills/eas-workflows/SKILL.md +15 -10
- package/dist/global-skills/eas-workflows/scripts/package.json +2 -7
- package/dist/global-skills/email-best-practices/.github/workflows/sync-skills.yml +30 -0
- package/dist/global-skills/email-best-practices/README.md +63 -0
- package/dist/global-skills/email-best-practices/references/accessibility.md +189 -0
- package/dist/global-skills/email-best-practices/references/compliance.md +125 -0
- package/dist/global-skills/email-best-practices/references/deliverability.md +121 -0
- package/dist/global-skills/email-best-practices/references/email-capture.md +129 -0
- package/dist/global-skills/email-best-practices/references/email-types.md +173 -0
- package/dist/global-skills/email-best-practices/references/list-management.md +157 -0
- package/dist/global-skills/email-best-practices/references/marketing-emails.md +115 -0
- package/dist/global-skills/email-best-practices/references/sending-reliability.md +155 -0
- package/dist/global-skills/email-best-practices/references/transactional-email-catalog.md +418 -0
- package/dist/global-skills/email-best-practices/references/transactional-emails.md +92 -0
- package/dist/global-skills/email-best-practices/references/webhooks-events.md +167 -0
- package/dist/global-skills/email-best-practices/tests/README.md +35 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/01-spam-deliverability.md +46 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/02-multi-region-compliance.md +48 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/03-retry-idempotency.md +36 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/04-webhook-bounce-handling.md +52 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/05-new-saas-email-plan.md +51 -0
- package/dist/global-skills/expo-animation/LICENSE +21 -0
- package/dist/global-skills/expo-animation/RECIPES.md +385 -0
- package/dist/global-skills/expo-animation/SKILL.md +267 -0
- package/dist/global-skills/expo-animation/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-app-clip/SKILL.md +8 -0
- package/dist/global-skills/expo-brownfield/SKILL.md +8 -0
- package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +53 -4
- package/dist/global-skills/expo-data-fetching/SKILL.md +8 -0
- package/dist/global-skills/expo-design-system/SKILL.md +356 -0
- package/dist/global-skills/expo-design-system/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-design-system/references/audit.md +185 -0
- package/dist/global-skills/expo-dev-client/SKILL.md +8 -0
- package/dist/global-skills/expo-dom/SKILL.md +8 -0
- package/dist/global-skills/expo-examples/SKILL.md +8 -0
- package/dist/global-skills/expo-migrate-module/SKILL.md +113 -0
- package/dist/global-skills/expo-migrate-module/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-migrate-module/references/compatibility.md +73 -0
- package/dist/global-skills/expo-migrate-module/references/example.md +212 -0
- package/dist/global-skills/expo-migrate-module/references/migration-map.md +306 -0
- package/dist/global-skills/expo-module/SKILL.md +11 -1
- package/dist/global-skills/expo-native-ui/SKILL.md +8 -0
- package/dist/global-skills/expo-project-structure/SKILL.md +114 -0
- package/dist/global-skills/expo-project-structure/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-router/SKILL.md +8 -0
- package/dist/global-skills/expo-skill-feedback/SKILL.md +66 -33
- package/dist/global-skills/expo-skill-feedback/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-tailwind-setup/SKILL.md +8 -0
- package/dist/global-skills/expo-ui/SKILL.md +8 -0
- package/dist/global-skills/expo-upgrade/SKILL.md +15 -1
- package/dist/global-skills/expo-web-to-native/SKILL.md +8 -0
- package/dist/global-skills/extension-to-functions-codebase/SKILL.md +129 -0
- package/dist/global-skills/extension-to-functions-codebase/references/configuration-migration.md +161 -0
- package/dist/global-skills/extension-to-functions-codebase/references/destructuring-shim.md +122 -0
- package/dist/global-skills/extension-to-functions-codebase/references/signature-mapping.md +84 -0
- package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +61 -19
- package/dist/global-skills/firebase-ai-logic-basics/references/flutter_setup.md +6 -3
- package/dist/global-skills/firebase-app-hosting-basics/SKILL.md +5 -1
- package/dist/global-skills/firebase-auth-basics/SKILL.md +4 -2
- package/dist/global-skills/firebase-basics/SKILL.md +5 -5
- package/dist/global-skills/firebase-crashlytics/SKILL.md +2 -0
- package/dist/global-skills/firebase-data-connect/SKILL.md +2 -0
- package/dist/global-skills/firebase-firestore/SKILL.md +3 -6
- package/dist/global-skills/firebase-hosting-basics/SKILL.md +4 -1
- package/dist/global-skills/firebase-remote-config-basics/SKILL.md +5 -1
- package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +4 -1
- package/dist/global-skills/harden/SKILL.md +2 -1
- package/dist/global-skills/instrument-feature-flags/SKILL.md +1 -0
- package/dist/global-skills/instrument-feature-flags/references/COMMANDMENTS.md +5 -0
- package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/android.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/api.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/best-practices.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/django.md +38 -5
- package/dist/global-skills/instrument-feature-flags/references/dotnet.md +10 -4
- package/dist/global-skills/instrument-feature-flags/references/elixir.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/flask.md +17 -5
- package/dist/global-skills/instrument-feature-flags/references/flutter.md +7 -5
- package/dist/global-skills/instrument-feature-flags/references/go.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/ios.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/java.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/laravel.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/next-js.md +74 -8
- package/dist/global-skills/instrument-feature-flags/references/nodejs.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/php.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/python.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/react-native.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/react.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/ruby.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/rust.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/usage.md +41 -4
- package/dist/global-skills/instrument-feature-flags/references/web.md +7 -5
- package/dist/global-skills/instrument-product-analytics/SKILL.md +2 -1
- package/dist/global-skills/instrument-product-analytics/references/COMMANDMENTS.md +5 -0
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +12 -14
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +25 -21
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-django.md +75 -55
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-fastapi.md +3 -6
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-flask.md +26 -16
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-nuxt-3-6.md +8 -5
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-nuxt-4.md +4 -4
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-react-react-router-7-framework.md +3 -3
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +8 -4
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-tanstack-start.md +20 -8
- package/dist/global-skills/instrument-product-analytics/references/android.md +46 -4
- package/dist/global-skills/instrument-product-analytics/references/angular.md +41 -5
- package/dist/global-skills/instrument-product-analytics/references/astro.md +41 -5
- package/dist/global-skills/instrument-product-analytics/references/configuration.md +7 -4
- package/dist/global-skills/instrument-product-analytics/references/django.md +38 -5
- package/dist/global-skills/instrument-product-analytics/references/dotnet.md +10 -4
- package/dist/global-skills/instrument-product-analytics/references/elixir.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/flask.md +17 -5
- package/dist/global-skills/instrument-product-analytics/references/flutter.md +49 -4
- package/dist/global-skills/instrument-product-analytics/references/go.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/identify-users.md +38 -7
- package/dist/global-skills/instrument-product-analytics/references/ios.md +14 -4
- package/dist/global-skills/instrument-product-analytics/references/laravel.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/next-js.md +74 -8
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +39 -7
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +40 -4
- package/dist/global-skills/instrument-product-analytics/references/php.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +21 -17
- package/dist/global-skills/instrument-product-analytics/references/python.md +15 -5
- package/dist/global-skills/instrument-product-analytics/references/react-native.md +41 -7
- package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/ruby.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/svelte.md +42 -6
- package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +31 -7
- package/dist/global-skills/instrument-product-analytics/references/usage.md +41 -4
- package/dist/global-skills/instrument-product-analytics/references/vue-js.md +42 -6
- package/dist/global-skills/manifest.json +6 -1
- package/dist/global-skills/neon/SKILL.md +235 -121
- package/dist/global-skills/neon-ai-gateway/SKILL.md +95 -16
- package/dist/global-skills/neon-functions/SKILL.md +242 -152
- package/dist/global-skills/neon-functions/references/ai-sdk.md +9 -3
- package/dist/global-skills/neon-functions/references/mastra-studio.md +1 -1
- package/dist/global-skills/neon-functions/references/mcp.md +13 -4
- package/dist/global-skills/neon-functions/references/sentry.md +165 -52
- package/dist/global-skills/neon-functions/references/sse.md +23 -6
- package/dist/global-skills/neon-object-storage/SKILL.md +40 -16
- package/dist/global-skills/neon-postgres/SKILL.md +63 -262
- package/dist/global-skills/neon-postgres-branches/SKILL.md +61 -50
- package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +22 -3
- package/dist/global-skills/resend/SKILL.md +6 -6
- package/dist/global-skills/resend/references/automations.md +2 -2
- package/dist/global-skills/resend/references/broadcasts.md +11 -3
- package/dist/global-skills/resend/references/domains.md +25 -3
- package/dist/global-skills/resend/references/installation.md +7 -7
- package/dist/global-skills/setup-payments/SKILL.md +4 -5
- package/dist/global-skills/stripe-best-practices/SKILL.md +32 -7
- package/dist/global-skills/stripe-best-practices/references/billing.md +11 -1
- package/dist/global-skills/stripe-best-practices/references/payments.md +23 -2
- package/dist/global-skills/stripe-best-practices/references/security.md +21 -11
- package/dist/global-skills/stripe-best-practices/references/tax.md +116 -11
- package/dist/global-skills/supabase/CHANGELOG.md +25 -0
- package/dist/global-skills/supabase/SKILL.md +5 -1
- package/dist/global-skills/supabase-postgres-best-practices/CHANGELOG.md +30 -0
- package/dist/global-skills/supabase-postgres-best-practices/SKILL.md +1 -1
- package/dist/global-skills/use-kit-mcp/SKILL.md +5 -5
- package/dist/global-skills/use-railway/SKILL.md +4 -4
- package/dist/global-skills/use-railway/references/iac.md +206 -57
- package/dist/global-skills/use-railway/scripts/railway-api.sh +7 -2
- package/dist/global-skills/xcode-project-setup/SKILL.md +2 -0
- package/package.json +12 -9
- package/LICENSE.md +0 -47
- package/dist/global-skills/eas-workflows/scripts/validate.js +0 -84
- package/dist/global-skills/expo-skill-feedback/scripts/skill-feedback.cjs +0 -118
- package/dist/global-skills/neon-functions/references/hono-websockets.md +0 -145
|
@@ -1,54 +1,69 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neon
|
|
3
3
|
description: >-
|
|
4
|
-
Overview of
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
4
|
+
Overview of Neon, a complete set of cloud backend primitives for apps and
|
|
5
|
+
agents, spanning Lakebase Postgres, Auth, the Data API, Object Storage, Compute
|
|
6
|
+
Functions, and the AI Gateway. Start here to route to the right Neon skill, set
|
|
7
|
+
up the CLI or MCP server, and follow the branch-first workflow. Use when "Neon"
|
|
8
|
+
or "Lakebase Postgres" is mentioned, or when any of its individual capabilities
|
|
9
|
+
are the trigger: "object storage" or "S3", "buckets", "serverless functions",
|
|
10
|
+
"AI gateway", "call an LLM", "logs", "branch logs", "query logs",
|
|
11
|
+
"log export", "Loki", "Grafana", "observability", "telemetry", "postgres",
|
|
12
|
+
"database", or "backend".
|
|
13
|
+
metadata:
|
|
14
|
+
source: https://github.com/neondatabase/agent-skills/tree/main/skills/neon
|
|
11
15
|
---
|
|
12
16
|
|
|
13
17
|
# Neon
|
|
14
18
|
|
|
15
|
-
Important: Neon is no longer just a
|
|
19
|
+
Important: 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.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
**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.
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
A 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.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
## Backend Primitives
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
- **Auth** — Managed authentication with users and sessions stored in Postgres. _Generally available._
|
|
25
|
-
- **Object Storage** — S3-compatible object storage that branches with your projects. _Preview / early access._
|
|
26
|
-
- **Compute Functions** — Long-running serverless functions running close to your database — for WebSocket servers, long agent HTTP streams, APIs, and server-sent event servers. _Preview / early access._
|
|
27
|
-
- **AI Gateway** — One API for all frontier and open-source models, with routing, logging, and cost controls, powered by Databricks. _Preview / early access._
|
|
27
|
+
Neon bundles several backend primitives for building apps and agents that all branch together:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
- **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._
|
|
30
|
+
- **Auth** — Managed Better Auth with users and sessions stored in Postgres. _Generally available._
|
|
31
|
+
- **Object Storage** — S3-compatible object storage that branches with your projects. _Public beta._
|
|
32
|
+
- **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._
|
|
33
|
+
- **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._
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
### Public Beta Service Availability
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
Object Storage, Functions, and AI Gateway are in public beta.
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
Beta 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.
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
## Architecture: How to Use Neon
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
Neon 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.
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
- **Reach for Neon Functions when you outgrow the host's limits** — a WebSocket or SSE server, or long-running agents that risk timing out on short, lambda-style serverless. Run that one piece on a Neon Function, next to your data.
|
|
45
|
+
Recommended architectures:
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
**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).
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
**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.
|
|
50
|
+
|
|
51
|
+
**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/response 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).
|
|
52
|
+
|
|
53
|
+
Because Functions are just your backend, they compose with a full-stack app that already has one (Next.js route handlers, etc.), too.
|
|
47
54
|
|
|
48
55
|
## Neon Documentation
|
|
49
56
|
|
|
50
57
|
The 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.
|
|
51
58
|
|
|
59
|
+
### Finding the Right Page
|
|
60
|
+
|
|
61
|
+
Look 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:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
https://neon.com/docs/llms.txt
|
|
65
|
+
```
|
|
66
|
+
|
|
52
67
|
### Fetching Docs as Markdown
|
|
53
68
|
|
|
54
69
|
Any Neon doc page can be fetched as markdown in two ways:
|
|
@@ -58,29 +73,27 @@ Any Neon doc page can be fetched as markdown in two ways:
|
|
|
58
73
|
|
|
59
74
|
Both return the same markdown content. Use whichever method your tools support.
|
|
60
75
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
The docs index lists every available page with its URL and a short description:
|
|
76
|
+
## Choosing the Right Skill
|
|
64
77
|
|
|
65
|
-
|
|
66
|
-
https://neon.com/docs/llms.txt
|
|
67
|
-
```
|
|
78
|
+
Neon 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.
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
The skills below live in the [`neondatabase/agent-skills`](https://github.com/neondatabase/agent-skills) repo:
|
|
70
81
|
|
|
71
|
-
|
|
82
|
+
| Skill | Use it for |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `neon-postgres` | Working with databases, including connections, schemas, queries, and autoscaling: SQL development, schema design, performance optimization, and scaling decisions. |
|
|
85
|
+
| `neon-postgres-branches` | Choosing or creating the right branch type for dev, preview, test, or CI workflows. Use this skill as a slash command. |
|
|
86
|
+
| `neon-object-storage` | Storing and serving files (uploads, images, blobs), including branching them with the database. |
|
|
87
|
+
| `neon-functions` | Deploying long-running or streaming serverless functions — APIs, agents, SSE/WebSocket servers. |
|
|
88
|
+
| `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 `/v1/models` endpoint. |
|
|
89
|
+
| `claimable-postgres` | Provisioning instant, claimable temporary Postgres databases (for example, one per end user or demo). |
|
|
90
|
+
| `neon-postgres-egress-optimizer` | Diagnosing or fixing excessive Postgres egress (network data-transfer) costs in a codebase. |
|
|
72
91
|
|
|
73
|
-
|
|
74
|
-
- Choosing or creating the right branch type for dev, preview, test, or CI workflows → `neon-postgres-branches`.
|
|
75
|
-
- Storing and serving files (uploads, images, blobs) that branch with the database → `neon-object-storage`.
|
|
76
|
-
- Deploying long-running or streaming serverless functions — APIs, agents, SSE/WebSocket servers — next to the database → `neon-functions`.
|
|
77
|
-
- Calling an LLM or routing across model providers with one credential → `neon-ai-gateway`.
|
|
78
|
-
- Provisioning instant, claimable temporary Postgres databases (for example, one per end user or demo) → `claimable-postgres`.
|
|
79
|
-
- Diagnosing or fixing excessive Postgres egress (network data-transfer) costs in a codebase → `neon-postgres-egress-optimizer`.
|
|
92
|
+
For 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/neon-for-agent-platforms`](https://github.com/neondatabase/neon-for-agent-platforms).
|
|
80
93
|
|
|
81
94
|
### Installing the Right Skill
|
|
82
95
|
|
|
83
|
-
First 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 with `npx`/`bunx`:
|
|
96
|
+
First 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`/`bunx`:
|
|
84
97
|
|
|
85
98
|
```bash
|
|
86
99
|
npx skills add neondatabase/agent-skills -s <skill-name>
|
|
@@ -98,95 +111,66 @@ For example, to install the object storage skill globally for a specific agent w
|
|
|
98
111
|
npx skills add neondatabase/agent-skills -s neon-object-storage -g -y -a <agent-name>
|
|
99
112
|
```
|
|
100
113
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Use this section when guiding a user through first-time Neon setup, or when adding a new Neon service (Auth, object storage, functions, and so on) to a project that is already onboarded (for example, one already using Neon Postgres).
|
|
114
|
+
If you don't have access to the `skills` CLI, you can visit https://neon.com/.well-known/agent-skills for a registry of all available Neon skills and fetch them manually.
|
|
104
115
|
|
|
105
|
-
###
|
|
116
|
+
### Updating Skills
|
|
106
117
|
|
|
107
|
-
|
|
118
|
+
Keep the skills up to date: for every new session, update them so you are working with the latest best practices.
|
|
108
119
|
|
|
109
|
-
|
|
110
|
-
- Existing `.neon` or `neon.ts` files in the workspace
|
|
111
|
-
- Existing Neon MCP server or Neon CLI configuration
|
|
112
|
-
- Existence of a `.env` file and `DATABASE_URL` environment variable
|
|
113
|
-
- Existing ORM (Prisma, Drizzle, TypeORM) configuration
|
|
120
|
+
Use 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.
|
|
114
121
|
|
|
115
|
-
|
|
122
|
+
## Getting Started with Neon
|
|
116
123
|
|
|
117
|
-
|
|
124
|
+
The easiest way to get started with Neon is to use our CLI and the project bootstrap wizard:
|
|
118
125
|
|
|
119
126
|
```bash
|
|
120
|
-
npx
|
|
127
|
+
npx neon@latest init --agent
|
|
121
128
|
```
|
|
122
129
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
If `init` is not suitable, the individual steps can be run non-interactively, using the user's preferred package manager (npm, bun, pnpm):
|
|
126
|
-
|
|
127
|
-
- **CLI:** `npm i -g neon`
|
|
128
|
-
- **Extension:** `cursor --install-extension databricks.neon-local-connect`
|
|
129
|
-
- **MCP server:** `npx -y add-mcp https://mcp.neon.tech/mcp -g -n Neon -y -a <agent-name>`
|
|
130
|
-
- **Agent skill:** `npx skills add neondatabase/agent-skills --skill neon-postgres --skill neon --agent <agent-name> -y`
|
|
131
|
-
|
|
132
|
-
Prefer the CLI over the MCP server unless the user instructs otherwise, since it provides more capabilities, including deploying Neon Functions. For full CLI installation options, see https://neon.com/docs/reference/cli-install.md
|
|
133
|
-
|
|
134
|
-
### Setup Flow
|
|
135
|
-
|
|
136
|
-
Once the CLI, MCP server, and agent skills are installed, ensure the local workspace is linked to a Neon project through the `neon init` flow. If it isn't, run `npx -y neon link` to let the user interactively link a project. This produces a `.neon` file pointing to the organization, project, and branch the user wants to work with.
|
|
137
|
-
|
|
138
|
-
For each Neon service, consult that component's agent skill for service-specific setup instructions (Functions, Postgres, Object Storage, Gateway, and so on).
|
|
139
|
-
|
|
140
|
-
### Resume Support
|
|
141
|
-
|
|
142
|
-
If resuming setup, check what's already configured (MCP connection, `.env` with `DATABASE_URL`, dependencies, schema) and continue from the next incomplete step.
|
|
143
|
-
|
|
144
|
-
### Security Reminders
|
|
130
|
+
Use the `--agent` flag to run in a non-interactive, state-machine mode.
|
|
145
131
|
|
|
146
|
-
|
|
132
|
+
This init command will guide you through installation of suggested Neon development tools. Everything is customizable. The defaults are:
|
|
147
133
|
|
|
148
|
-
|
|
134
|
+
- Neon CLI installed globally
|
|
135
|
+
- Neon MCP server installed globally
|
|
136
|
+
- Neon Agent skills installed into the project
|
|
149
137
|
|
|
150
|
-
|
|
138
|
+
If `init` is run in an empty project, it will run the `bootstrap` command, offering to install one of our project templates.
|
|
151
139
|
|
|
152
|
-
|
|
153
|
-
- `neon checkout <branch-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.
|
|
154
|
-
- `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.
|
|
140
|
+
### Getting Started with the Neon CLI
|
|
155
141
|
|
|
156
|
-
|
|
142
|
+
**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.
|
|
157
143
|
|
|
158
|
-
|
|
159
|
-
neon link # once; also pulls the linked branch's env
|
|
160
|
-
neon checkout dev-add-search # per feature; also pulls the branch's env
|
|
161
|
-
```
|
|
144
|
+
The 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://neon.com/docs/cli/install.md
|
|
162
145
|
|
|
163
|
-
|
|
146
|
+
#### Useful CLI Commands
|
|
164
147
|
|
|
165
|
-
|
|
148
|
+
These commands are included in the `init` command but can be run manually as needed.
|
|
166
149
|
|
|
167
|
-
|
|
150
|
+
1. `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.
|
|
151
|
+
2. `neon checkout <branch-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.
|
|
152
|
+
3. `neon config init` — Initializes a `neon.ts` file, which declares how you provision and manage Neon services, in the root of the project.
|
|
153
|
+
4. `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.
|
|
168
154
|
|
|
169
|
-
|
|
170
|
-
- **`neon set-context --project-id <id> --org-id <id> --branch-id <id>`** — when you already know the IDs, write all three into `.neon` in one shot. This is a **destructive write**: it replaces the file's contents entirely with exactly these fields, so it's the most direct way to point `.neon` at a specific org / project / branch.
|
|
155
|
+
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`.
|
|
171
156
|
|
|
172
|
-
|
|
157
|
+
### Getting Started with the Neon MCP Server
|
|
173
158
|
|
|
174
|
-
|
|
159
|
+
The above `init` command will install the Neon MCP server globally, but it can also be installed manually using: `npx -y add-mcp https://mcp.neon.tech/mcp -g -n Neon -y -a <agent-name>` or through your IDE plugin.
|
|
175
160
|
|
|
176
|
-
|
|
161
|
+
For all available plugins, see: https://neon.com/docs/ai/ai-agents-tools.md
|
|
177
162
|
|
|
178
|
-
|
|
179
|
-
- `neon-env export` (from `@neon/env`) 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://varlock.dev) can bulk-load it from a `.env.schema` with `@setValuesBulk(exec("neon-env export --format json"), format=json)`.
|
|
180
|
-
- `fetchEnv` from `@neon/env` 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`.
|
|
181
|
-
- `neon dev` injects the same vars into your local dev server — it's part of Neon Functions local development (a private preview feature).
|
|
163
|
+
For full MCP server installation options, see https://neon.com/docs/ai/connect-mcp-clients-to-neon.md
|
|
182
164
|
|
|
183
|
-
|
|
165
|
+
Useful MCP tools to initialize a project:
|
|
184
166
|
|
|
185
|
-
|
|
167
|
+
- `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.
|
|
168
|
+
- `create_project` — Creates a new Neon project in your Neon account. A project acts as a container for branches, databases, roles, and computes.
|
|
169
|
+
- `get_connection_string` — Returns your database connection string.
|
|
186
170
|
|
|
187
171
|
## Neon Infrastructure as Code
|
|
188
172
|
|
|
189
|
-
`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 Neon
|
|
173
|
+
`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/config`:
|
|
190
174
|
|
|
191
175
|
```bash
|
|
192
176
|
npm i @neon/config
|
|
@@ -197,14 +181,26 @@ npm i @neon/config
|
|
|
197
181
|
import { defineConfig } from "@neon/config/v1";
|
|
198
182
|
|
|
199
183
|
export default defineConfig({
|
|
200
|
-
|
|
201
|
-
|
|
184
|
+
preview: {
|
|
185
|
+
aiGateway: true,
|
|
186
|
+
buckets: {
|
|
187
|
+
images: {
|
|
188
|
+
access: "private",
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
functions: {
|
|
192
|
+
imagegen: {
|
|
193
|
+
name: "AI SDK image agent",
|
|
194
|
+
source: "src/index.ts",
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
202
198
|
});
|
|
203
199
|
```
|
|
204
200
|
|
|
205
201
|
### Provision services with neon config
|
|
206
202
|
|
|
207
|
-
Every project ships with
|
|
203
|
+
Every 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:
|
|
208
204
|
|
|
209
205
|
```typescript
|
|
210
206
|
// neon.ts
|
|
@@ -212,9 +208,13 @@ export default defineConfig({
|
|
|
212
208
|
auth: true,
|
|
213
209
|
dataApi: true,
|
|
214
210
|
preview: {
|
|
215
|
-
functions: {
|
|
216
|
-
|
|
217
|
-
|
|
211
|
+
functions: {
|
|
212
|
+
/* ... */
|
|
213
|
+
}, // see the neon-functions skill
|
|
214
|
+
buckets: {
|
|
215
|
+
/* ... */
|
|
216
|
+
}, // see the neon-object-storage skill
|
|
217
|
+
aiGateway: true, // see the neon-ai-gateway skill
|
|
218
218
|
},
|
|
219
219
|
});
|
|
220
220
|
```
|
|
@@ -222,17 +222,16 @@ export default defineConfig({
|
|
|
222
222
|
Reconcile the declaration from the CLI — the Neon equivalent of `terraform status` / `plan` / `apply`:
|
|
223
223
|
|
|
224
224
|
```bash
|
|
225
|
-
neon
|
|
225
|
+
neon status # print the branch's live config (read-only). Alias for `neon config status`.
|
|
226
226
|
neon config plan # dry-run diff of what apply would change (read-only)
|
|
227
|
-
neon
|
|
228
|
-
neon deploy # alias for `neon config apply`
|
|
227
|
+
neon deploy # provision the declared services. Alias for `neon config apply`
|
|
229
228
|
```
|
|
230
229
|
|
|
231
|
-
`
|
|
230
|
+
`apply` / `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.
|
|
232
231
|
|
|
233
232
|
### Type-safe env vars with parseEnv
|
|
234
233
|
|
|
235
|
-
`@neon/env`'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
|
|
234
|
+
`@neon/env`'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.
|
|
236
235
|
|
|
237
236
|
```bash
|
|
238
237
|
npm i @neon/env
|
|
@@ -248,7 +247,7 @@ console.log(env.postgres.databaseUrl);
|
|
|
248
247
|
console.log(env.auth.baseUrl);
|
|
249
248
|
```
|
|
250
249
|
|
|
251
|
-
By default `parseEnv` requires _every_ variable your config implies. When
|
|
250
|
+
By 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).
|
|
252
251
|
|
|
253
252
|
```typescript
|
|
254
253
|
import { parseEnv } from "@neon/env";
|
|
@@ -258,15 +257,11 @@ import config from "./neon";
|
|
|
258
257
|
const { postgres } = parseEnv(config, ["DATABASE_URL"]);
|
|
259
258
|
console.log(postgres.databaseUrl);
|
|
260
259
|
|
|
261
|
-
// Selecting across services — only these keys are validated
|
|
260
|
+
// Selecting across services — only these keys are validated.
|
|
262
261
|
const env = parseEnv(config, ["DATABASE_URL", "NEON_AUTH_BASE_URL"]);
|
|
263
262
|
console.log(env.postgres.databaseUrl, env.auth.baseUrl);
|
|
264
263
|
```
|
|
265
264
|
|
|
266
|
-
### How checkout composes with neon.ts
|
|
267
|
-
|
|
268
|
-
When 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.
|
|
269
|
-
|
|
270
265
|
### Branch configuration
|
|
271
266
|
|
|
272
267
|
Beyond 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:
|
|
@@ -320,12 +315,131 @@ export default defineConfig({ auth: true, dataApi: true });
|
|
|
320
315
|
|
|
321
316
|
// 2. Or verify a third-party IdP instead of Neon Auth:
|
|
322
317
|
export default defineConfig({
|
|
323
|
-
dataApi: {
|
|
318
|
+
dataApi: {
|
|
319
|
+
authProvider: "external",
|
|
320
|
+
jwksUrl: "https://your-idp/.well-known/jwks.json",
|
|
321
|
+
},
|
|
324
322
|
});
|
|
325
323
|
```
|
|
326
324
|
|
|
327
325
|
Treat a `neon.ts` type error as the config telling you which services must go together — read the message, it spells out the valid combinations.
|
|
328
326
|
|
|
327
|
+
See https://neon.com/docs/reference/neon-ts.md for documentation on the `neon.ts` file.
|
|
328
|
+
|
|
329
|
+
## Branch-First Dev Flow
|
|
330
|
+
|
|
331
|
+
Neon 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.
|
|
332
|
+
|
|
333
|
+
Create a Neon branch any time you would create a git branch. Use the following commands if you have CLI access:
|
|
334
|
+
|
|
335
|
+
- `neon checkout <branch-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.
|
|
336
|
+
- `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.
|
|
337
|
+
- `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.
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
neon link # once; also pulls the linked branch's env
|
|
341
|
+
neon checkout dev-add-search # per feature; also pulls the branch's env
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Because `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.
|
|
345
|
+
|
|
346
|
+
### How checkout composes with neon.ts
|
|
347
|
+
|
|
348
|
+
When 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.
|
|
349
|
+
|
|
350
|
+
### Opting out of local env vars
|
|
351
|
+
|
|
352
|
+
If 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` / `checkout` and supply the env another way:
|
|
353
|
+
|
|
354
|
+
- `neon-env run -- <your dev command>` (from `@neon/env`) 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`.
|
|
355
|
+
- `neon-env export` (from `@neon/env`) 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://varlock.dev) can bulk-load it from a `.env.schema` with `@setValuesBulk(exec("neon-env export --format json"), format=json)`.
|
|
356
|
+
- `fetchEnv` from `@neon/env` 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`.
|
|
357
|
+
- `neon dev` injects the same vars into your local dev server — it's part of Neon Functions local development (a public beta feature).
|
|
358
|
+
|
|
359
|
+
When an agent should not write a local `.env`, instruct it (for example in your `AGENTS.md`) to run `neon checkout <branch> --no-env-pull` and rely on runtime injection.
|
|
360
|
+
|
|
361
|
+
For 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.
|
|
362
|
+
|
|
363
|
+
## Observability
|
|
364
|
+
|
|
365
|
+
Neon 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.
|
|
366
|
+
|
|
367
|
+
Use 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.
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
neon logs query --since 1h
|
|
371
|
+
neon logs query --branch production --source function --minimum-severity error --since 6h
|
|
372
|
+
neon logs query --source storage --since 1h --output json
|
|
373
|
+
neon logs fields
|
|
374
|
+
neon logs field-values service_name --since 1h
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
`--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.
|
|
378
|
+
|
|
379
|
+
`--logql` replaces the structured filters with a raw stream selector or line filter. Its stream label is `entity_type`, not `source`:
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
neon logs query --since 1h --logql '{entity_type="function"} |= "timeout"'
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
If 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.
|
|
386
|
+
|
|
387
|
+
In TypeScript applications, use `@neon/sdk`. Project and branch are positional, and `query` returns a lazy paginated iterable rather than a promise:
|
|
388
|
+
|
|
389
|
+
```typescript
|
|
390
|
+
for await (const record of neon.logs.query(projectId, branchId, {
|
|
391
|
+
since: "1h",
|
|
392
|
+
source: "function",
|
|
393
|
+
})) {
|
|
394
|
+
console.log(record.timestamp, record.severity_text, record.message);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const { data: fields } = await neon.logs.fields(projectId, branchId);
|
|
398
|
+
const { data: serviceNames } = await neon.logs.fieldValues(projectId, branchId, "service_name");
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
`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.
|
|
402
|
+
|
|
403
|
+
### Loki-compatible read API
|
|
404
|
+
|
|
405
|
+
For direct HTTP reads, authenticate with `Authorization: Bearer <NEON_API_KEY>` and use this branch-scoped base URL:
|
|
406
|
+
|
|
407
|
+
```text
|
|
408
|
+
https://console.neon.tech/telemetry/v1/projects/{projectId}/branches/{branchId}/loki
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
The available endpoints are:
|
|
412
|
+
|
|
413
|
+
- `GET /api/v1/query_range`
|
|
414
|
+
- `GET /api/v1/labels`
|
|
415
|
+
- `GET /api/v1/label/{name}/values`
|
|
416
|
+
|
|
417
|
+
This 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`/`end`, `limit`, and `direction`; it does not support aggregations, parsers, or formatting stages.
|
|
418
|
+
|
|
419
|
+
The paths above are the ones to call directly. A Loki client that builds its own paths — a Grafana data source appends `/loki/api/v1` 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.
|
|
420
|
+
|
|
421
|
+
## Manage Neon Resources
|
|
422
|
+
|
|
423
|
+
Recommended: Use `@neon/sdk` to manage Neon resources programmatically, such as creating projects, branches, and snapshots for dev scripts, CI/CD automations, and platforms building on top of Neon.
|
|
424
|
+
|
|
425
|
+
`@neon/sdk` is the official TypeScript client for the [Neon API](https://neon.com/docs/reference/api-reference.md): **Fetch-based, zero-dependency, ESM-only**, generated from Neon's [OpenAPI spec](https://neon.com/api_spec/release/v2.json) with an ergonomic layer on top. It is the successor to [`@neondatabase/api-client`](https://www.npmjs.com/package/@neondatabase/api-client) (axios-based, generated-only). The old client is **not deprecated** and is safe to keep using, but new code should prefer `@neon/sdk`.
|
|
426
|
+
|
|
427
|
+
### Neon for (Agentic) Platforms
|
|
428
|
+
|
|
429
|
+
If 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.
|
|
430
|
+
|
|
431
|
+
Neon features for agents:
|
|
432
|
+
|
|
433
|
+
- Instant Provisioning: your users never wait for infrastructure.
|
|
434
|
+
- Snapshots: let users toggle between checkpoints of code and state together.
|
|
435
|
+
- Low cost-per-Database: automatic scale to zero and 350ms cold starts.
|
|
436
|
+
- Full-Stack, Batteries-Included: Neon Auth, Data API included at no added charge.
|
|
437
|
+
- Granular API Controls: Track and control usage for flexible limits and invoicing.
|
|
438
|
+
|
|
439
|
+
All details here: https://neon.com/programs/agents.md
|
|
440
|
+
|
|
441
|
+
Apply for the Neon Agent Program for special program pricing here: https://neon.com/programs/agents
|
|
442
|
+
|
|
329
443
|
## Gotchas
|
|
330
444
|
|
|
331
445
|
### Neon Auth: "invalid domain"
|