neon 8.7.2 → 8.8.0

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/README.md CHANGED
@@ -89,6 +89,9 @@ neon claim create
89
89
 
90
90
  # Request Managed Better Auth and the Data API too
91
91
  neon claim create --service auth --service data-api
92
+
93
+ # Create the project in another region (default: aws-us-east-2)
94
+ neon claim create --region-id aws-eu-central-1
92
95
  ```
93
96
 
94
97
  When the current directory has a `neon.ts`, `claim create` also requests every service
@@ -895,7 +898,7 @@ $ neon init -y --agent cursor --project-id <project-id> \
895
898
  --mcp-auth oauth --mcp-config-location project --mcp-project-scoped
896
899
  ```
897
900
 
898
- Without a TTY, pass `-y` or enough flags to answer every question. `-y` alone is Recommended. `-y` with `--skill`, MCP flags, `--no-agent-setup`, or `--claimable` is Custom: those flags, Recommended defaults for the rest. `--skill` selects skills (not the plugin). MCP flags select skills and MCP. `--agent` skips agent selection and, without `-y`, selects Custom. `--no-link` skips project linking without asking. `--no-config` skips `neon.ts`. `--services` implies creating `neon.ts`. `--org-id`, `--project-id`, `--project-name`, `--region-id`, and `--branch` select linking.
901
+ Without a TTY, pass `-y` or enough flags to answer every question. `-y` alone is Recommended. `-y` with `--skill`, MCP flags, `--no-agent-setup`, or `--claimable` is Custom: those flags, Recommended defaults for the rest. `--skill` selects skills (not the plugin). MCP flags select skills and MCP. `--agent` skips agent selection and, without `-y`, selects Custom. `--no-link` skips project linking without asking. `--no-config` skips `neon.ts`. `--services` implies creating `neon.ts`. `--org-id`, `--project-id`, `--project-name`, `--region-id`, and `--branch` select linking. With `--claimable`, `--region-id` picks the claimable project's region.
899
902
 
900
903
  `--project-id`, `--org-id`, `--project-name`, `--region-id`, and `--branch` are forwarded to `link`. They select linking. A linked directory is not relinked unless you pass one of those flags.
901
904
 
@@ -72,6 +72,7 @@ const parseRegistrationResponse = (value) => {
72
72
  project: {
73
73
  id: stringField(project, "id", action),
74
74
  branchId: stringField(project, "branch_id", action),
75
+ regionId: stringField(project, "region_id", action),
75
76
  expiresAt: stringField(project, "expires_at", action)
76
77
  },
77
78
  capabilities: capabilities.map((item) => parseCapabilityDecision(item, action))
@@ -180,6 +181,7 @@ var ClaimableClient = class {
180
181
  type: "anonymous",
181
182
  capabilities: input.capabilities,
182
183
  source: input.source,
184
+ ...input.regionId !== void 0 ? { region_id: input.regionId } : {},
183
185
  ...input.dataApi !== void 0 ? { data_api: input.dataApi } : {}
184
186
  }
185
187
  }));
@@ -90,6 +90,7 @@ const CLAIM_LIST_FIELDS = [
90
90
  const CLAIM_CREATE_FIELDS = [
91
91
  "project_id",
92
92
  "branch_id",
93
+ "region_id",
93
94
  "state",
94
95
  "project_expires_at",
95
96
  "granted_capabilities",
@@ -110,7 +111,10 @@ const builder = (argv) => argv.usage("$0 claim <sub-command> [options]").option(
110
111
  allowed: CLAIMABLE_SERVICES,
111
112
  describe: "Services to request for the claimable project",
112
113
  also: "Postgres is always included. Services unavailable before claim are recorded and reported."
113
- })).option("file", {
114
+ })).option("region-id", {
115
+ describe: "Region ID for the new project (e.g. aws-eu-central-1). Defaults to aws-us-east-2",
116
+ type: "string"
117
+ }).option("file", {
114
118
  describe: "Target dotenv file. Defaults to an existing .env, otherwise .env.local",
115
119
  type: "string"
116
120
  }).option("config", {
@@ -206,6 +210,7 @@ const create = async (props) => {
206
210
  const registration = await client.register({
207
211
  capabilities: claimableCapabilities(props.services ?? []),
208
212
  source: "neon_cli",
213
+ ...props.regionId !== void 0 ? { regionId: props.regionId } : {},
209
214
  ...props.dataApi ? { dataApi: props.dataApi } : {}
210
215
  });
211
216
  const stored = {
@@ -263,6 +268,7 @@ const create = async (props) => {
263
268
  writer(props).end({
264
269
  project_id: registration.project.id,
265
270
  branch_id: registration.project.branchId,
271
+ region_id: registration.project.regionId,
266
272
  state: "unclaimed",
267
273
  project_expires_at: registration.project.expiresAt,
268
274
  granted_capabilities: granted,
@@ -64,7 +64,7 @@ const builder = (yargs) => yargs.usage("$0 init [options]").option("context-file
64
64
  describe: "Forwarded to link: name for a new project",
65
65
  type: "string"
66
66
  }).option("region-id", {
67
- describe: "Forwarded to link: region for a new project",
67
+ describe: "Region for a new project, forwarded to link or to the claimable project",
68
68
  type: "string"
69
69
  }).option("branch", {
70
70
  alias: "branch-id",
package/dist/init/copy.js CHANGED
@@ -35,7 +35,7 @@ const MCP_AUTH_API_KEY_TITLE = "Use a Neon API key";
35
35
  const MCP_AUTH_API_KEY_DESCRIPTION = "Reuse an existing MCP key or create a key after CLI authentication.";
36
36
  const CLAIMABLE_MCP_API_KEY = "Claimable project setup cannot create an account API key for MCP. Use --mcp-auth oauth.";
37
37
  const CLAIMABLE_NO_LINK = "--claimable cannot be combined with --no-link.";
38
- const CLAIMABLE_ACCOUNT_FLAGS = "--claimable cannot be combined with --org-id, --project-id, --project-name, --region-id, or --branch.";
38
+ const CLAIMABLE_ACCOUNT_FLAGS = "--claimable cannot be combined with --org-id, --project-id, --project-name, or --branch.";
39
39
  const CLAIMABLE_ALREADY_LINKED = "--claimable cannot run in a directory that is already linked. Omit --claimable, or unlink first.";
40
40
  const PROJECT_SETUP_MESSAGE = "How would you like to get a Neon project?";
41
41
  const PROJECT_SETUP_LINK_TITLE = "Sign in to Neon";
package/dist/init/run.js CHANGED
@@ -149,7 +149,8 @@ const defaultCreateClaimable = async (input) => {
149
149
  apiKey: input.apiKey,
150
150
  envPull: false,
151
151
  cwd: input.cwd,
152
- ...input.profile !== void 0 ? { profile: input.profile } : {}
152
+ ...input.profile !== void 0 ? { profile: input.profile } : {},
153
+ ...input.regionId !== void 0 ? { regionId: input.regionId } : {}
153
154
  });
154
155
  };
155
156
  const runInit = async (props) => {
@@ -191,7 +192,8 @@ const runInit = async (props) => {
191
192
  ...props.regionId ? { regionId: props.regionId } : {},
192
193
  ...props.branch ? { branch: props.branch } : {}
193
194
  };
194
- const hasExplicitLinkInputs = props.orgId !== void 0 || props.projectId !== void 0 || props.projectName !== void 0 || props.regionId !== void 0 || props.branch !== void 0;
195
+ const hasAccountLinkInputs = props.orgId !== void 0 || props.projectId !== void 0 || props.projectName !== void 0 || props.branch !== void 0;
196
+ const hasExplicitLinkInputs = hasAccountLinkInputs || props.regionId !== void 0;
195
197
  const funnel = createInitFunnel();
196
198
  let outcome = "error";
197
199
  let printed = false;
@@ -241,7 +243,7 @@ const runInit = async (props) => {
241
243
  const claimableExisting = alreadyLinked && readLinkedClaimableCredentials(configDir, readContextFile(contextFile)) !== null;
242
244
  if (props.claimable === true) {
243
245
  if (props.link === false) throw new Error(CLAIMABLE_NO_LINK);
244
- if (hasExplicitLinkInputs) throw new Error(CLAIMABLE_ACCOUNT_FLAGS);
246
+ if (hasAccountLinkInputs) throw new Error(CLAIMABLE_ACCOUNT_FLAGS);
245
247
  if (alreadyLinked) throw new Error(CLAIMABLE_ALREADY_LINKED);
246
248
  }
247
249
  const recommended = mode === "recommended";
@@ -424,7 +426,8 @@ const runInit = async (props) => {
424
426
  contextFile,
425
427
  output: props.output,
426
428
  apiKey: props.apiKey,
427
- ...props.profile !== void 0 ? { profile: props.profile } : {}
429
+ ...props.profile !== void 0 ? { profile: props.profile } : {},
430
+ ...props.regionId !== void 0 ? { regionId: props.regionId } : {}
428
431
  });
429
432
  funnel.link = "claimable";
430
433
  claimExpiresAt = readLinkedClaimableCredentials(configDir, readContextFile(contextFile))?.expiresAt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "8.7.2",
3
+ "version": "8.8.0",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -72,7 +72,7 @@
72
72
  "yoctocolors": "^2.1.2",
73
73
  "@neon/config": "1.9.2",
74
74
  "@neon/config-runtime": "1.10.1",
75
- "@neon/realtime": "0.1.0",
75
+ "@neon/realtime": "0.1.1",
76
76
  "@neon/sdk": "7.3.0"
77
77
  },
78
78
  "optionalDependencies": {
@@ -111,9 +111,9 @@
111
111
  "vitest": "^3.0.9",
112
112
  "@neon-internals/cli-core": "0.0.0",
113
113
  "@neon-internals/env-core": "0.0.33",
114
+ "@neon/e2e-harness": "0.0.0",
114
115
  "@neon/env": "1.6.3",
115
- "@neon/functions": "0.11.0",
116
- "@neon/e2e-harness": "0.0.0"
116
+ "@neon/functions": "0.11.0"
117
117
  },
118
118
  "publishConfig": {
119
119
  "access": "public",