neon 8.19.0 → 8.21.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
@@ -866,6 +866,8 @@ When a package cannot be bundled — a native addon with no esbuild loader, or a
866
866
 
867
867
  After scaffolding, an interactive terminal asks about dependency install and git, then finishes agent setup before asking whether to link a Neon project. Dependency install is last, except when the template has a `neon.ts` and you chose to link — then install runs first so the link flow can pull env. `--default` / `-y` skips the template, install, git, and agent pickers, then installs agent tooling for project folders, else the host CLI agent. If none are found, it exits: pass `--agent <name>`, run from a supported agent, or omit `--default` / `-y` in a terminal to pick. `--agent` / `-a` names coding agents, skips agent selection, and is forwarded to `plugins`, or to `skills` and `mcp`, not both. Linking uses `neon link -y`: the only organization and project are selected, or their IDs are printed and the command exits. `--no-agent-setup` and `--no-link` skip those steps. Non-interactive without `--default` prints next steps and does not install, set up agents, or link.
868
868
 
869
+ When the template has a `neon.ts` and its dependencies are installed and the project is linked, bootstrap checks the env vars its functions read against the env file link pulled into (`.env.local`). If all are set, a terminal asks `Deploy this project to Neon now?` and runs `neon deploy --env .env.local`; `--default` leaves that command under `Next:`. If some are unset, `Next:` names them. `--deploy` installs, links, and deploys without asking, and fails with `neon deploy`'s error when an env var is unset. It refuses `--no-install` and `--no-link`, and needs `--default` outside a terminal.
870
+
869
871
  Pass a target directory (or `.` for the current one). In an interactive terminal you pick the template from a list; in CI / non-interactive contexts pass `--template <id>`.
870
872
 
871
873
  ```bash
@@ -878,6 +880,9 @@ $ neon bootstrap . --template hono
878
880
  # Skip agent selection; install the plugin for those agents
879
881
  $ neon bootstrap my-app --agent cursor --agent claude-code
880
882
 
883
+ # Scaffold, install, link, and deploy without prompting
884
+ $ neon bootstrap my-app --template hono --default --deploy
885
+
881
886
  # List templates
882
887
  $ neon bootstrap --list-templates
883
888
 
@@ -1174,6 +1179,26 @@ neon credentials revoke nak_live_…
1174
1179
 
1175
1180
  All sub-commands honor the [global options](#global-options), including `--output json|yaml|table`.
1176
1181
 
1182
+ ## Postgres (`postgres`)
1183
+
1184
+ `neon postgres` (aliases `neon pg` and `neon lakebase`) groups the Postgres commands: `computes`, `databases`, `roles`, `connection-string` (`cs`), and `psql`. `neon postgres roles list` and `neon roles list` run the same command; the top-level spellings keep working.
1185
+
1186
+ `neon postgres computes` (aliases `compute`, `endpoints`, `endpoint`) manages the computes in a project:
1187
+
1188
+ ```bash
1189
+ neon postgres computes list # the .neon branch's computes, else every compute in the project
1190
+ neon postgres computes list --branch main
1191
+ neon postgres computes list --all-branches # every compute in the project, even when .neon pins a branch
1192
+ neon postgres computes get ep-cool-king-123456
1193
+ neon postgres computes update ep-cool-king-123456 --cu 0.25-2 --suspend-timeout 600
1194
+ neon postgres computes suspend ep-cool-king-123456
1195
+ neon postgres computes start ep-cool-king-123456
1196
+ neon postgres computes restart ep-cool-king-123456
1197
+ neon postgres computes delete ep-cool-king-123456
1198
+ ```
1199
+
1200
+ `update`, `start`, `suspend`, `restart`, and `delete` wait until the change is applied. `update`, `start`, `suspend`, and `restart` then print the compute as the API reports it; `delete` prints a confirmation on stderr. `--no-wait` returns as soon as the API accepts the request. `update` sends only the flags you pass and fails without one. To add a compute, use `neon branches add-compute`.
1201
+
1177
1202
  ## Database diagnostics (`inspect`)
1178
1203
 
1179
1204
  `neon inspect db stalled-queries` takes a read-only snapshot of active queries that have run for more than 30 seconds and groups parallel workers with their leader. Oldest group first. Table output shows duration, wait event, blocking pids, role, query group, and query. `--output json` adds timestamps, query IDs, pids, database, and the rest of the row. A blocking pid can belong to an idle-in-transaction backend this command does not list; `neon inspect db locks` shows lock holders.
@@ -1506,10 +1531,11 @@ Id Name Project Created At Last Used At Last
1506
1531
  | [ip-allow](https://neon.com/docs/reference/cli-ip-allow) | `list`, `add`, `remove`, `reset` | Manage IP Allow |
1507
1532
  | [me](https://neon.com/docs/reference/cli-me) | | Show current user |
1508
1533
  | [branches](https://neon.com/docs/reference/cli-branches) | `list`, `create`, `rename`, `add-compute`, `set-default`, `set-expiration`, `delete`, `get` | Manage branches |
1534
+ | postgres (`pg`, `lakebase`) | `computes`, `databases`, `roles`, `connection-string`, `psql` | Manage Postgres and connect to it |
1509
1535
  | [databases](https://neon.com/docs/reference/cli-databases) | `list`, `create`, `delete` | Manage databases |
1510
1536
  | function | `deploy`, `list`, `get`, `delete`, `domains list`, `domains register`, `domains delete` | Manage Neon Functions |
1511
1537
  | [roles](https://neon.com/docs/reference/cli-roles) | `list`, `create`, `delete` | Manage roles |
1512
- | [operations](https://neon.com/docs/reference/cli-operations) | `list` | Manage operations |
1538
+ | [operations](https://neon.com/docs/reference/cli-operations) | `list`, `get` | Manage operations |
1513
1539
  | logs | `query`, `fields`, `field-values` | Query branch logs (Beta) |
1514
1540
  | inspect | `db stalled-queries` | Inspect Postgres diagnostics |
1515
1541
  | snapshots | `list`, `get`, `create`, `update`, `delete`, `restore`, `finalize`, `schedule get`, `schedule set` | Manage snapshots |
@@ -4,9 +4,10 @@ import { log } from "../log.js";
4
4
  import { recordCommandSuccessExtras, recordScaffoldedTemplate } from "../analytics.js";
5
5
  import { getCliName } from "../utils/cli_name.js";
6
6
  import { helpCsv, helpEpilogue } from "../utils/help_text.js";
7
+ import { resolveEnvFilePath } from "../env_file.js";
7
8
  import { formatInstallCommand, inferPackageManager, installArgs, installedPackageManagers, resolvePackageManager, runCommand } from "../utils/package_manager.js";
8
9
  import { writer } from "../writer.js";
9
- import { FALLBACK_TEMPLATES, ensureTargetUsable, fetchTemplates, findTemplate, scaffoldTemplate, templateIds } from "../init/bootstrap.js";
10
+ import { BootstrapInputError, FALLBACK_TEMPLATES, ensureTargetUsable, fetchTemplates, findTemplate, scaffoldTemplate, templateIds } from "../init/bootstrap.js";
10
11
  import { agentSetupDoneLabel, formatInitDone, printInitBanner, printInitDone, shouldPrintInitBanner } from "../init/chrome.js";
11
12
  import { runAuthenticatedLink } from "../init/link.js";
12
13
  import { coerceAgentFlag } from "../utils/agent_flag.js";
@@ -77,8 +78,13 @@ const builder = (argv) => argv.usage("$0 bootstrap [directory] [options]").posit
77
78
  string: true,
78
79
  describe: "Coding agent to install into (repeatable). Forwarded to plugins, or to skills and mcp. Skips agent selection. Values listed below",
79
80
  coerce: coerceAgentFlag
81
+ },
82
+ deploy: {
83
+ describe: "Run `neon deploy` once dependencies are installed and the project is linked, without asking. Fails if neon.ts reads an env var that is not set yet",
84
+ type: "boolean",
85
+ default: false
80
86
  }
81
- }).example("$0 bootstrap my-app", "Create ./my-app from an interactively chosen template").example("$0 bootstrap . --template hono", "Scaffold the Hono template into the current directory").example("$0 bootstrap my-app --default", "Skip the pickers; if several orgs or projects exist, link prints IDs and exits").example("$0 bootstrap --list-templates --output json", "Print the template catalog as JSON").example("$0 bootstrap my-app --agent cursor --agent claude-code", "Skip agent selection; install the plugin for those agents").epilogue(helpEpilogue("--agent / -a is forwarded to plugins, or to skills and mcp, not both. It skips agent selection, including with --default.", helpCsv("Plugin agents", initPluginAgents()), helpCsv("Skills and MCP agents", initSkillsMcpAgents()))).strict();
87
+ }).example("$0 bootstrap my-app", "Create ./my-app from an interactively chosen template").example("$0 bootstrap . --template hono", "Scaffold the Hono template into the current directory").example("$0 bootstrap my-app --default", "Skip the pickers; if several orgs or projects exist, link prints IDs and exits").example("$0 bootstrap my-app --template hono --default --deploy", "Scaffold, install, link, and deploy without prompting").example("$0 bootstrap --list-templates --output json", "Print the template catalog as JSON").example("$0 bootstrap my-app --agent cursor --agent claude-code", "Skip agent selection; install the plugin for those agents").epilogue(helpEpilogue("--agent / -a is forwarded to plugins, or to skills and mcp, not both. It skips agent selection, including with --default.", helpCsv("Plugin agents", initPluginAgents()), helpCsv("Skills and MCP agents", initSkillsMcpAgents()))).strict();
82
88
  const handler = async (props) => {
83
89
  if (props.listTemplates) {
84
90
  const templates = await fetchTemplates();
@@ -109,12 +115,14 @@ const handler = async (props) => {
109
115
  ...props.default ? { yes: true } : {}
110
116
  });
111
117
  const interactive = !props.default && Boolean(process.stdout.isTTY) && !isCi();
118
+ if (props.deploy) assertDeployable(props, interactive);
112
119
  const template = props.selectedTemplate ?? await resolveSelectedTemplate(props, interactive, await resolveTemplateList(props));
113
120
  const targetDir = await resolveTargetDir(props, interactive, template);
114
121
  ensureTargetUsable(targetDir, props.force);
115
122
  await scaffold(template, targetDir);
116
123
  recordScaffoldedTemplate(template.id);
117
124
  printScaffolded(template, targetDir);
125
+ if (props.deploy && !hasNeonConfig(targetDir)) throw new BootstrapInputError(`Template "${template.id}" has no neon.ts, so there is nothing to deploy. Re-run without --deploy.`, "TEMPLATE_NOT_DEPLOYABLE");
118
126
  const result = await runPostScaffoldSteps(props, targetDir, interactive, template, named);
119
127
  recordCommandSuccessExtras({ agent_setup: result.agentSetup });
120
128
  return result;
@@ -198,7 +206,8 @@ const runPostScaffoldSteps = async (props, targetDir, interactive, template, nam
198
206
  agentSetup: "skip",
199
207
  linked: false,
200
208
  skippedLinkForDeps: false,
201
- agentsRan: false
209
+ agentsRan: false,
210
+ deployed: false
202
211
  };
203
212
  finishPostScaffold({
204
213
  heading: "Project scaffolded.",
@@ -206,13 +215,14 @@ const runPostScaffoldSteps = async (props, targetDir, interactive, template, nam
206
215
  targetDir,
207
216
  pm: defaultPm,
208
217
  ...outcome,
218
+ hasNeonConfig: neonConfig,
209
219
  suggestLink: true,
210
220
  skipPrint: props.skipDoneSummary === true
211
221
  });
212
222
  return nestedResult(template, targetDir, neonConfig, outcome);
213
223
  }
214
224
  let pm = defaultPm;
215
- const wantInstall = props.install && await confirm(installPrompt(inferred));
225
+ const wantInstall = props.install && (props.deploy === true || await confirm(installPrompt(inferred)));
216
226
  if (wantInstall) pm = inferred ?? await selectPackageManager();
217
227
  const wantGit = props.git && !isGitRepo(targetDir) && await confirm("Initialize a git repository?");
218
228
  const agentSetup = props.agentSetup === false ? "skip" : named.length > 0 ? chooseYesAgentTooling(named).setup : await (props.pickAgentSetup ?? pickAgentSetupInteractively)();
@@ -235,6 +245,7 @@ const runPostScaffoldSteps = async (props, targetDir, interactive, template, nam
235
245
  targetDir,
236
246
  pm,
237
247
  ...outcome,
248
+ hasNeonConfig: neonConfig,
238
249
  suggestLink: !outcome.linked,
239
250
  skipPrint: props.skipDoneSummary === true
240
251
  });
@@ -262,6 +273,7 @@ const runDefaultSteps = async (props, targetDir, pm, neonConfig, template, named
262
273
  targetDir,
263
274
  pm,
264
275
  ...outcome,
276
+ hasNeonConfig: neonConfig,
265
277
  suggestLink: !outcome.linked,
266
278
  skipPrint: props.skipDoneSummary === true
267
279
  });
@@ -326,7 +338,7 @@ const executePostScaffold = async (props, targetDir, choices) => {
326
338
  logSkippedLink(choices.pm);
327
339
  continue;
328
340
  }
329
- if (!(choices.yes || await (props.pickLink ?? pickInitLinkInteractively)())) continue;
341
+ if (!(choices.yes || props.deploy === true || await (props.pickLink ?? pickInitLinkInteractively)())) continue;
330
342
  await (props.linkProject ?? runAuthenticatedLink)({
331
343
  apiClient: props.apiClient,
332
344
  apiKey: props.apiKey,
@@ -349,6 +361,11 @@ const executePostScaffold = async (props, targetDir, choices) => {
349
361
  });
350
362
  linked = true;
351
363
  }
364
+ const deploy = installFailed || gitFailed ? { deployed: false } : await runDeployStep(props, targetDir, {
365
+ interactive: !choices.yes,
366
+ ready: choices.hasNeonConfig && installed && linked,
367
+ auth: kids.auth
368
+ });
352
369
  return {
353
370
  installed,
354
371
  installFailed,
@@ -357,9 +374,53 @@ const executePostScaffold = async (props, targetDir, choices) => {
357
374
  linked,
358
375
  skippedLinkForDeps,
359
376
  agentSetup,
360
- agentsRan
377
+ agentsRan,
378
+ ...deploy
361
379
  };
362
380
  };
381
+ /**
382
+ * `--deploy` installs and links without asking, so flags that skip those steps contradict
383
+ * it. Outside a terminal, only `-y` runs the post-scaffold steps at all.
384
+ */
385
+ const assertDeployable = (props, interactive) => {
386
+ if (props.install === false || props.link === false) throw new BootstrapInputError("--deploy needs installed dependencies and a linked project. Remove --no-install and --no-link.", "DEPLOY_NEEDS_INSTALL_AND_LINK");
387
+ if (!interactive && !props.default) throw new BootstrapInputError("--deploy outside an interactive terminal needs --default (-y).", "DEPLOY_NEEDS_DEFAULT");
388
+ };
389
+ /**
390
+ * The last step. `--deploy` always deploys and lets `neon deploy` report unset env. Otherwise
391
+ * a linked, installed template with neon.ts is offered a deploy in a terminal once every
392
+ * function env var it reads is set; when some are not, the done summary names them.
393
+ */
394
+ const runDeployStep = async (props, targetDir, input) => {
395
+ if (!props.deploy && !input.ready) return { deployed: false };
396
+ const envFile = resolveEnvFilePath({
397
+ cwd: targetDir,
398
+ contextFile: input.auth.contextFile
399
+ });
400
+ const envFileName = relative(targetDir, envFile);
401
+ const deployWithEnv = `${getCliName()} deploy --env ${envFileName}`;
402
+ const deployCommand = existsSync(envFile) ? deployWithEnv : `${getCliName()} deploy`;
403
+ const { deployInitProject, missingDeployEnv } = await import("../init/deploy.js");
404
+ const options = {
405
+ ...input.auth,
406
+ cwd: targetDir,
407
+ envFile
408
+ };
409
+ if (!props.deploy) {
410
+ const missing = await missingDeployEnv(options);
411
+ if (missing.length > 0) return {
412
+ deployed: false,
413
+ deployNext: `Set ${missing.join(", ")} in ${envFileName}, then run \`${deployWithEnv}\``
414
+ };
415
+ if (!input.interactive || !await confirm("Deploy this project to Neon now?")) return {
416
+ deployed: false,
417
+ deployNext: deployCommand
418
+ };
419
+ }
420
+ log.info("Deploying with `%s`…", deployCommand);
421
+ await (props.deployProject ?? deployInitProject)(options);
422
+ return { deployed: true };
423
+ };
363
424
  const isGitRepo = (dir) => existsSync(join(dir, ".git"));
364
425
  const NEON_CONFIG_FILENAMES = [
365
426
  "neon.ts",
@@ -438,6 +499,7 @@ const printDoneSummary = (input) => {
438
499
  if (!isCurrentDir(input.targetDir)) next.push(`cd ${displayDir(input.targetDir)}`);
439
500
  if (!input.installed) next.push(formatInstallCommand(input.pm));
440
501
  if (input.suggestLink) next.push(`${getCliName()} link`);
502
+ if (input.deployNext) next.push(input.deployNext);
441
503
  if (!unfinished) next.push("See the README to run it.");
442
504
  printInitDone(formatInitDone({
443
505
  heading,
@@ -468,7 +530,11 @@ const printDoneSummary = (input) => {
468
530
  {
469
531
  label: "Project",
470
532
  value: project
471
- }
533
+ },
534
+ ...input.hasNeonConfig ? [{
535
+ label: "Deploy",
536
+ value: input.deployed ? "deployed" : "not deployed"
537
+ }] : []
472
538
  ],
473
539
  next
474
540
  }));
@@ -0,0 +1,208 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
+ import { log } from "../log.js";
3
+ import { endpointUpdateRequest } from "../parameters.gen.js";
4
+ import { writer } from "../writer.js";
5
+ import { fillSingleProject, resolveBranchFromProps } from "../utils/enrichers.js";
6
+ import { getComputeUnits } from "../utils/compute_units.js";
7
+ // src/commands/computes.ts
8
+ var computes_exports = /* @__PURE__ */ __exportAll({
9
+ aliases: () => aliases,
10
+ builder: () => builder,
11
+ builderFor: () => builderFor,
12
+ command: () => command,
13
+ deleteCompute: () => deleteCompute,
14
+ describe: () => describe,
15
+ get: () => get,
16
+ handler: () => handler,
17
+ list: () => list,
18
+ restart: () => restart,
19
+ start: () => start,
20
+ suspend: () => suspend,
21
+ update: () => update
22
+ });
23
+ const COMPUTE_FIELDS = [
24
+ "id",
25
+ "branch_id",
26
+ "type",
27
+ "current_state",
28
+ "autoscaling_limit_min_cu",
29
+ "autoscaling_limit_max_cu"
30
+ ];
31
+ const COMPUTE_DETAIL_FIELDS = [
32
+ "id",
33
+ "name",
34
+ "branch_id",
35
+ "type",
36
+ "current_state",
37
+ "pending_state",
38
+ "host",
39
+ "region_id",
40
+ "autoscaling_limit_min_cu",
41
+ "autoscaling_limit_max_cu",
42
+ "suspend_timeout_seconds",
43
+ "disabled",
44
+ "last_active",
45
+ "created_at"
46
+ ];
47
+ const waitOption = { wait: {
48
+ describe: "Wait until the change is applied. Use --no-wait to return as soon as the API accepts it",
49
+ type: "boolean",
50
+ default: true
51
+ } };
52
+ const command = "computes";
53
+ const aliases = [
54
+ "compute",
55
+ "endpoints",
56
+ "endpoint"
57
+ ];
58
+ const describe = "Manage Postgres computes";
59
+ const builderFor = (usage) => (argv) => argv.usage(`$0 ${usage} <sub-command> [options]`).options({ "project-id": {
60
+ describe: "Project ID",
61
+ type: "string"
62
+ } }).middleware(fillSingleProject).command("list", "List computes. Lists the branch's computes when --branch is passed or .neon pins one, otherwise every compute in the project", (yargs) => yargs.options({
63
+ branch: {
64
+ describe: "Branch ID or name",
65
+ type: "string"
66
+ },
67
+ "all-branches": {
68
+ describe: "List every compute in the project, ignoring --branch and the branch .neon pins",
69
+ type: "boolean",
70
+ default: false
71
+ }
72
+ }), (args) => list(args)).command("get <id>", "Get a compute", (yargs) => yargs, (args) => get(args)).command("update <id>", "Update a compute's size, scale-to-zero timeout, name, or connection access", (yargs) => yargs.options({
73
+ cu: {
74
+ describe: "The number of Compute Units. Could be a fixed size (e.g. \"2\") or a range delimited by a dash (e.g. \"0.5-3\").",
75
+ type: "string"
76
+ },
77
+ "suspend-timeout": {
78
+ describe: endpointUpdateRequest["endpoint.suspend_timeout_seconds"].description,
79
+ type: "number"
80
+ },
81
+ name: {
82
+ describe: "Name of the compute",
83
+ type: "string"
84
+ },
85
+ disabled: {
86
+ describe: "Restrict connections to the compute. Disabling schedules a suspend. Use --disabled=false to allow connections again.",
87
+ type: "boolean"
88
+ },
89
+ ...waitOption
90
+ }), (args) => update(args)).command("start <id>", "Start a compute", (yargs) => yargs.options(waitOption), (args) => start(args)).command("suspend <id>", "Suspend a compute", (yargs) => yargs.options(waitOption), (args) => suspend(args)).command("restart <id>", "Restart a compute", (yargs) => yargs.options(waitOption), (args) => restart(args)).command("delete <id>", "Delete a compute", (yargs) => yargs.options(waitOption), (args) => deleteCompute(args));
91
+ const builder = builderFor("computes");
92
+ const handler = (args) => {
93
+ return args;
94
+ };
95
+ const sdk = async (props) => {
96
+ const { fromSdkError, getNeonClient } = await import("../neon_client.js");
97
+ return {
98
+ neon: getNeonClient(props),
99
+ fail: (error) => fromSdkError(error, props.apiHost)
100
+ };
101
+ };
102
+ const writeCompute = (props, compute, humanTitle) => {
103
+ writer(props).end(compute, {
104
+ fields: COMPUTE_DETAIL_FIELDS,
105
+ humanTitle
106
+ });
107
+ };
108
+ const list = async (props) => {
109
+ const { neon, fail } = await sdk(props);
110
+ if (props.allBranches || props.branch === void 0) {
111
+ const computes = await neon.postgres.endpoints.list({ projectId: props.projectId }).catch((error) => {
112
+ throw fail(error);
113
+ });
114
+ writer(props).end(computes, {
115
+ fields: COMPUTE_FIELDS,
116
+ humanTitle: `Computes in project ${props.projectId}`,
117
+ emptyMessage: `No computes in project ${props.projectId}.`
118
+ });
119
+ return;
120
+ }
121
+ const { branchId, branch } = await resolveBranchFromProps(props);
122
+ const computes = await neon.postgres.endpoints.listByBranch({
123
+ projectId: props.projectId,
124
+ branchId
125
+ }).catch((error) => {
126
+ throw fail(error);
127
+ });
128
+ const branchLabel = branch?.name ?? branchId;
129
+ writer(props).end(computes, {
130
+ fields: COMPUTE_FIELDS,
131
+ humanTitle: `Computes on ${branchLabel}`,
132
+ emptyMessage: `No computes on ${branchLabel}.`
133
+ });
134
+ };
135
+ const get = async (props) => {
136
+ const { neon, fail } = await sdk(props);
137
+ const compute = await neon.postgres.endpoints.get({
138
+ projectId: props.projectId,
139
+ endpointId: props.id
140
+ }).catch((error) => {
141
+ throw fail(error);
142
+ });
143
+ writeCompute(props, compute);
144
+ };
145
+ const updateRequest = (props) => {
146
+ const endpoint = {
147
+ ...props.cu === void 0 ? {} : getComputeUnits(props.cu),
148
+ ...props.suspendTimeout === void 0 ? {} : { suspend_timeout_seconds: props.suspendTimeout },
149
+ ...props.name === void 0 ? {} : { name: props.name },
150
+ ...props.disabled === void 0 ? {} : { disabled: props.disabled }
151
+ };
152
+ if (Object.keys(endpoint).length === 0) throw new Error("Nothing to update. Pass --cu, --suspend-timeout, --name, or --disabled.");
153
+ return endpoint;
154
+ };
155
+ /**
156
+ * Mutations return the compute as it was when the request was accepted, so after waiting
157
+ * the compute is read again to show the state the change produced.
158
+ */
159
+ const mutate = async (props, action, run) => {
160
+ const { neon, fail } = await sdk(props);
161
+ const params = {
162
+ projectId: props.projectId,
163
+ endpointId: props.id
164
+ };
165
+ try {
166
+ const accepted = await run(neon, params, { waitForReadiness: props.wait });
167
+ if (!props.wait) {
168
+ writeCompute(props, accepted, `Compute ${props.id}: ${action.verb} accepted, not yet applied`);
169
+ return;
170
+ }
171
+ writeCompute(props, await neon.postgres.endpoints.get(params), `Compute ${props.id} ${action.done}`);
172
+ } catch (error) {
173
+ throw fail(error);
174
+ }
175
+ };
176
+ const update = (props) => {
177
+ const endpoint = updateRequest(props);
178
+ return mutate(props, {
179
+ verb: "update",
180
+ done: "updated"
181
+ }, (neon, params, opts) => neon.postgres.endpoints.update({
182
+ ...params,
183
+ ...endpoint
184
+ }, opts));
185
+ };
186
+ const start = (props) => mutate(props, {
187
+ verb: "start",
188
+ done: "started"
189
+ }, (neon, params, opts) => neon.postgres.endpoints.start(params, opts));
190
+ const suspend = (props) => mutate(props, {
191
+ verb: "suspend",
192
+ done: "suspended"
193
+ }, (neon, params, opts) => neon.postgres.endpoints.suspend(params, opts));
194
+ const restart = (props) => mutate(props, {
195
+ verb: "restart",
196
+ done: "restarted"
197
+ }, (neon, params, opts) => neon.postgres.endpoints.restart(params, opts));
198
+ const deleteCompute = async (props) => {
199
+ const { neon, fail } = await sdk(props);
200
+ await neon.postgres.endpoints.delete({
201
+ projectId: props.projectId,
202
+ endpointId: props.id
203
+ }, { waitForReadiness: props.wait }).catch((error) => {
204
+ throw fail(error);
205
+ });
206
+ log.info(props.wait ? `Compute ${props.id} deleted` : `Compute ${props.id}: delete accepted, not yet applied`);
207
+ };
208
+ export { computes_exports as a, get as c, restart as d, start as f, command as i, handler as l, update as m, builder as n, deleteCompute as o, suspend as p, builderFor as r, describe as s, aliases as t, list as u };
@@ -10,6 +10,7 @@ var connection_string_exports = /* @__PURE__ */ __exportAll({
10
10
  SSL_MODES: () => SSL_MODES,
11
11
  aliases: () => aliases,
12
12
  builder: () => builder,
13
+ builderFor: () => builderFor,
13
14
  command: () => command,
14
15
  describe: () => describe,
15
16
  handler: () => handler
@@ -23,8 +24,8 @@ const SSL_MODES = [
23
24
  const command = "connection-string [branch]";
24
25
  const aliases = ["cs"];
25
26
  const describe = "Get connection string";
26
- const builder = (argv) => {
27
- return argv.usage("$0 connection-string [branch] [options]").example("$0 cs main", "Get connection string for the main branch").example("$0 cs main@2024-01-01T00:00:00Z", "Get connection string for the main branch at a specific point in time").example("$0 cs main@0/234235", "Get connection string for the main branch at a specific LSN").positional("branch", {
27
+ const builderFor = (usage) => (argv) => {
28
+ return argv.usage(`$0 ${usage} [branch] [options]`).example("$0 cs main", "Get connection string for the main branch").example("$0 cs main@2024-01-01T00:00:00Z", "Get connection string for the main branch at a specific point in time").example("$0 cs main@0/234235", "Get connection string for the main branch at a specific LSN").positional("branch", {
28
29
  describe: `Branch name or id. Defaults to the default branch if omitted. Can be written in the point-in-time format: "branch@timestamp" or "branch@lsn"`,
29
30
  type: "string"
30
31
  }).options({
@@ -78,6 +79,7 @@ const builder = (argv) => {
78
79
  }
79
80
  }).middleware(fillSingleProject);
80
81
  };
82
+ const builder = builderFor("connection-string");
81
83
  const handler = async (props) => {
82
84
  const projectId = props.projectId;
83
85
  const parsedPIT = props.branch ? parsePITBranch(props.branch) : {
@@ -150,4 +152,4 @@ const handler = async (props) => {
150
152
  ] });
151
153
  else process.stdout.write(connectionString.toString() + "\n");
152
154
  };
153
- export { connection_string_exports as a, command as i, aliases as n, describe as o, builder as r, handler as s, SSL_MODES as t };
155
+ export { command as a, handler as c, builderFor as i, aliases as n, connection_string_exports as o, builder as r, describe as s, SSL_MODES as t };
@@ -8,6 +8,7 @@ var databases_exports = /* @__PURE__ */ __exportAll({
8
8
  DATABASE_FIELDS: () => DATABASE_FIELDS,
9
9
  aliases: () => aliases,
10
10
  builder: () => builder,
11
+ builderFor: () => builderFor,
11
12
  command: () => command,
12
13
  create: () => create,
13
14
  deleteDb: () => deleteDb,
@@ -23,7 +24,7 @@ const DATABASE_FIELDS = [
23
24
  const command = "databases";
24
25
  const describe = "Manage databases";
25
26
  const aliases = ["database", "db"];
26
- const builder = (argv) => argv.usage("$0 databases <sub-command> [options]").options({
27
+ const builderFor = (usage) => (argv) => argv.usage(`$0 ${usage} <sub-command> [options]`).options({
27
28
  "project-id": {
28
29
  describe: "Project ID",
29
30
  type: "string"
@@ -43,6 +44,7 @@ const builder = (argv) => argv.usage("$0 databases <sub-command> [options]").opt
43
44
  type: "string"
44
45
  }
45
46
  }), (args) => create(args)).command("delete <database>", "Delete a database", (yargs) => yargs, (args) => deleteDb(args));
47
+ const builder = builderFor("databases");
46
48
  const handler = (args) => {
47
49
  return args;
48
50
  };
@@ -85,4 +87,4 @@ const deleteDb = async (props) => {
85
87
  }
86
88
  log.info(`Database "${props.database}" not found on branch ${branch?.name ?? branchId}; nothing to delete.`);
87
89
  };
88
- export { create as a, describe as c, command as i, handler as l, aliases as n, databases_exports as o, builder as r, deleteDb as s, DATABASE_FIELDS as t, list as u };
90
+ export { command as a, deleteDb as c, list as d, builderFor as i, describe as l, aliases as n, create as o, builder as r, databases_exports as s, DATABASE_FIELDS as t, handler as u };
@@ -7,6 +7,7 @@ var operations_exports = /* @__PURE__ */ __exportAll({
7
7
  builder: () => builder,
8
8
  command: () => command,
9
9
  describe: () => describe,
10
+ get: () => get,
10
11
  handler: () => handler,
11
12
  list: () => list
12
13
  });
@@ -16,13 +17,26 @@ const OPERATIONS_FIELDS = [
16
17
  "status",
17
18
  "created_at"
18
19
  ];
20
+ const OPERATION_DETAIL_FIELDS = [
21
+ "id",
22
+ "action",
23
+ "status",
24
+ "branch_id",
25
+ "endpoint_id",
26
+ "error",
27
+ "failures_count",
28
+ "retry_at",
29
+ "total_duration_ms",
30
+ "created_at",
31
+ "updated_at"
32
+ ];
19
33
  const command = "operations";
20
34
  const describe = "Manage operations";
21
35
  const aliases = ["operation"];
22
36
  const builder = (argv) => argv.usage("$0 operations <sub-command> [options]").options({ "project-id": {
23
37
  describe: "Project ID",
24
38
  type: "string"
25
- } }).middleware(fillSingleProject).command("list", "List operations", (yargs) => yargs, (args) => list(args));
39
+ } }).middleware(fillSingleProject).command("list", "List operations", (yargs) => yargs, (args) => list(args)).command("get <id>", "Get an operation", (yargs) => yargs, (args) => get(args));
26
40
  const handler = (args) => {
27
41
  return args;
28
42
  };
@@ -33,4 +47,14 @@ const list = async (props) => {
33
47
  });
34
48
  writer(props).end(data.operations, { fields: OPERATIONS_FIELDS });
35
49
  };
36
- export { handler as a, describe as i, builder as n, list as o, command as r, operations_exports as s, aliases as t };
50
+ const get = async (props) => {
51
+ const { fromSdkError, getNeonClient } = await import("../neon_client.js");
52
+ const operation = await getNeonClient(props).operations.get({
53
+ projectId: props.projectId,
54
+ operationId: props.id
55
+ }).catch((error) => {
56
+ throw fromSdkError(error, props.apiHost);
57
+ });
58
+ writer(props).end(operation, { fields: OPERATION_DETAIL_FIELDS });
59
+ };
60
+ export { get as a, operations_exports as c, describe as i, builder as n, handler as o, command as r, list as s, aliases as t };
@@ -0,0 +1,31 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
+ import { a as computes_exports } from "./computes-OKFUNFee.js";
3
+ import { o as connection_string_exports } from "./connection_string-6WhV4WFx.js";
4
+ import { s as databases_exports } from "./databases-B-qY303S.js";
5
+ import { o as psql_exports } from "./psql-BcxiPR4W.js";
6
+ import { u as roles_exports } from "./roles-BXGtPGjv.js";
7
+ // src/commands/postgres.ts
8
+ var postgres_exports = /* @__PURE__ */ __exportAll({
9
+ aliases: () => aliases,
10
+ builder: () => builder,
11
+ command: () => command,
12
+ describe: () => describe,
13
+ handler: () => handler
14
+ });
15
+ const nested = (group) => ({
16
+ command: group.command,
17
+ aliases: group.aliases,
18
+ describe: group.describe,
19
+ builder: group.builderFor(`postgres ${group.command.split(" ")[0]}`),
20
+ handler: async (args) => {
21
+ await group.handler(args);
22
+ }
23
+ });
24
+ const command = "postgres";
25
+ const aliases = ["pg", "lakebase"];
26
+ const describe = "Manage Postgres computes, databases, and roles, and connect with psql or a connection string";
27
+ const builder = (argv) => argv.usage("$0 postgres <sub-command> [options]").command(nested(computes_exports)).command(nested(databases_exports)).command(nested(roles_exports)).command(nested(connection_string_exports)).command(nested(psql_exports));
28
+ const handler = (args) => {
29
+ return args;
30
+ };
31
+ export { handler as a, describe as i, builder as n, postgres_exports as o, command as r, aliases as t };
@@ -1,18 +1,19 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
2
2
  import { EndpointType } from "../utils/api_enums.js";
3
3
  import { fillSingleProject } from "../utils/enrichers.js";
4
- import { s as handler$1, t as SSL_MODES } from "./connection_string-C9e7N4xk.js";
4
+ import { c as handler$1, t as SSL_MODES } from "./connection_string-6WhV4WFx.js";
5
5
  // src/commands/psql.ts
6
6
  var psql_exports = /* @__PURE__ */ __exportAll({
7
7
  builder: () => builder,
8
+ builderFor: () => builderFor,
8
9
  command: () => command,
9
10
  describe: () => describe,
10
11
  handler: () => handler
11
12
  });
12
13
  const command = "psql [branch]";
13
14
  const describe = "Connect to a database via psql";
14
- const builder = (argv) => {
15
- return argv.usage("$0 psql [branch] [options] [-- psql-args]").example("$0 psql", "Connect to the default branch via psql").example("$0 psql main", "Connect to the main branch via psql").example("$0 psql main -- -c \"SELECT 1\"", "Run a single query against the main branch").example("$0 psql main@2024-01-01T00:00:00Z", "Connect to the main branch at a specific point in time").positional("branch", {
15
+ const builderFor = (usage) => (argv) => {
16
+ return argv.usage(`$0 ${usage} [branch] [options] [-- psql-args]`).example("$0 psql", "Connect to the default branch via psql").example("$0 psql main", "Connect to the main branch via psql").example("$0 psql main -- -c \"SELECT 1\"", "Run a single query against the main branch").example("$0 psql main@2024-01-01T00:00:00Z", "Connect to the main branch at a specific point in time").positional("branch", {
16
17
  describe: `Branch name or id. Defaults to the default branch if omitted. Can be written in the point-in-time format: "branch@timestamp" or "branch@lsn"`,
17
18
  type: "string"
18
19
  }).options({
@@ -52,6 +53,7 @@ const builder = (argv) => {
52
53
  }
53
54
  }).middleware(fillSingleProject);
54
55
  };
56
+ const builder = builderFor("psql");
55
57
  const handler = async (props) => {
56
58
  await handler$1({
57
59
  ...props,
@@ -60,4 +62,4 @@ const handler = async (props) => {
60
62
  extended: false
61
63
  });
62
64
  };
63
- export { psql_exports as a, handler as i, command as n, describe as r, builder as t };
65
+ export { handler as a, describe as i, builderFor as n, psql_exports as o, command as r, builder as t };
@@ -7,6 +7,7 @@ import { fillSingleProject, resolveBranchFromProps } from "../utils/enrichers.js
7
7
  var roles_exports = /* @__PURE__ */ __exportAll({
8
8
  aliases: () => aliases,
9
9
  builder: () => builder,
10
+ builderFor: () => builderFor,
10
11
  command: () => command,
11
12
  create: () => create,
12
13
  deleteRole: () => deleteRole,
@@ -28,7 +29,7 @@ const ROLE_ACCESS = [
28
29
  const command = "roles";
29
30
  const describe = "Manage roles";
30
31
  const aliases = ["role"];
31
- const builder = (argv) => argv.usage("$0 roles <sub-command> [options]").options({
32
+ const builderFor = (usage) => (argv) => argv.usage(`$0 ${usage} <sub-command> [options]`).options({
32
33
  "project-id": {
33
34
  describe: "Project ID",
34
35
  type: "string"
@@ -66,6 +67,7 @@ const builder = (argv) => argv.usage("$0 roles <sub-command> [options]").options
66
67
  if (args.access === "admin" && (args.database !== void 0 || args.schema !== void 0)) throw new Error("--database and --schema need --access read_only or --access read_write");
67
68
  return true;
68
69
  }), (args) => create(args)).command("delete <role>", "Delete a role", (yargs) => yargs, (args) => deleteRole(args));
70
+ const builder = builderFor("roles");
69
71
  const handler = (args) => {
70
72
  return args;
71
73
  };
@@ -125,4 +127,4 @@ const deleteRole = async (props) => {
125
127
  }
126
128
  log.info(`Role "${props.role}" not found on branch ${branch?.name ?? branchId}; nothing to delete.`);
127
129
  };
128
- export { deleteRole as a, list as c, create as i, roles_exports as l, builder as n, describe as o, command as r, handler as s, aliases as t };
130
+ export { create as a, handler as c, command as i, list as l, builder as n, deleteRole as o, builderFor as r, describe as s, aliases as t, roles_exports as u };
@@ -1 +1 @@
1
- export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-vAtWRZXa.js";
1
+ export { n as builder, r as command, i as describe, a as handler } from "../_chunks/bootstrap-Dh7-KDmw.js";
@@ -0,0 +1 @@
1
+ export { t as aliases, n as builder, r as builderFor, i as command, o as deleteCompute, s as describe, c as get, l as handler, u as list, d as restart, f as start, p as suspend, m as update } from "../_chunks/computes-OKFUNFee.js";
@@ -1 +1 @@
1
- export { t as SSL_MODES, n as aliases, r as builder, i as command, o as describe, s as handler } from "../_chunks/connection_string-C9e7N4xk.js";
1
+ export { t as SSL_MODES, n as aliases, r as builder, i as builderFor, a as command, s as describe, c as handler } from "../_chunks/connection_string-6WhV4WFx.js";
@@ -1 +1 @@
1
- export { t as DATABASE_FIELDS, n as aliases, r as builder, i as command, a as create, s as deleteDb, c as describe, l as handler, u as list } from "../_chunks/databases-B2Yapqme.js";
1
+ export { t as DATABASE_FIELDS, n as aliases, r as builder, i as builderFor, a as command, o as create, c as deleteDb, l as describe, u as handler, d as list } from "../_chunks/databases-B-qY303S.js";
@@ -9,15 +9,15 @@ import { a as link_exports } from "../_chunks/link-CNO-HxHN.js";
9
9
  import { o as mcp_exports } from "../_chunks/mcp-SvqWzHnT.js";
10
10
  import { c as plugins_exports } from "../_chunks/plugins-7cxVcgay.js";
11
11
  import { l as skills_exports } from "../_chunks/skills-Bv8oKKwE.js";
12
- import { t as bootstrap_exports } from "../_chunks/bootstrap-vAtWRZXa.js";
12
+ import { t as bootstrap_exports } from "../_chunks/bootstrap-Dh7-KDmw.js";
13
13
  import { r as branches_exports } from "../_chunks/branches-Bp-5z1lM.js";
14
14
  import { n as bucket_exports } from "../_chunks/bucket-D06bvDSa.js";
15
15
  import { n as checkout_exports } from "../_chunks/checkout-CNBIS3gA.js";
16
16
  import { o as claim_exports } from "../_chunks/claim-DhV0f_5o.js";
17
- import { a as connection_string_exports } from "../_chunks/connection_string-C9e7N4xk.js";
17
+ import { o as connection_string_exports } from "../_chunks/connection_string-6WhV4WFx.js";
18
18
  import { a as credentials_exports } from "../_chunks/credentials-BMBNmW0t.js";
19
19
  import { r as data_api_exports } from "../_chunks/data_api-CHDwvMTG.js";
20
- import { o as databases_exports } from "../_chunks/databases-B2Yapqme.js";
20
+ import { s as databases_exports } from "../_chunks/databases-B-qY303S.js";
21
21
  import { r as deploy_exports } from "../_chunks/deploy-Bs5gmi4Q.js";
22
22
  import { s as dev_exports } from "../_chunks/dev-DxiIp4c9.js";
23
23
  import { i as diff_exports } from "../_chunks/diff-dnxneH0u.js";
@@ -31,12 +31,13 @@ import { a as ip_allow_exports } from "../_chunks/ip_allow-DBdxNEUa.js";
31
31
  import { l as logs_exports } from "../_chunks/logs-BB4uvblR.js";
32
32
  import { a as neon_auth_exports } from "../_chunks/neon_auth-C1CgNTGP.js";
33
33
  import { a as open_exports } from "../_chunks/open-T2nI89Oh.js";
34
- import { s as operations_exports } from "../_chunks/operations-CzaR_uqx.js";
34
+ import { c as operations_exports } from "../_chunks/operations-D7qGkKo3.js";
35
35
  import { o as orgs_exports } from "../_chunks/orgs-Dpbr-K0A.js";
36
+ import { o as psql_exports } from "../_chunks/psql-BcxiPR4W.js";
37
+ import { u as roles_exports } from "../_chunks/roles-BXGtPGjv.js";
38
+ import { o as postgres_exports } from "../_chunks/postgres-BkJPZRov.js";
36
39
  import { o as profile_exports } from "../_chunks/profile-BAlM625e.js";
37
- import { a as psql_exports } from "../_chunks/psql-Bce4X0NG.js";
38
40
  import { s as realtime_exports } from "../_chunks/realtime-BwtzYf5a.js";
39
- import { l as roles_exports } from "../_chunks/roles-CNoDyRf4.js";
40
41
  import { a as set_context_exports } from "../_chunks/set_context-ompB6d2D.js";
41
42
  import { s as snapshots_exports } from "../_chunks/snapshots-DxNhjcco.js";
42
43
  import { a as status_exports } from "../_chunks/status-BlrzeKyA.js";
@@ -56,6 +57,7 @@ var commands_default = [
56
57
  vpc_endpoints_exports,
57
58
  neon_auth_exports,
58
59
  branches_exports,
60
+ postgres_exports,
59
61
  databases_exports,
60
62
  roles_exports,
61
63
  operations_exports,
@@ -71,6 +71,12 @@ const commandManifest = [
71
71
  describe: "Manage branches",
72
72
  load: () => import("./branches.js")
73
73
  },
74
+ {
75
+ command: "postgres",
76
+ aliases: ["pg", "lakebase"],
77
+ describe: "Manage Postgres computes, databases, and roles, and connect with psql or a connection string",
78
+ load: () => import("./postgres.js")
79
+ },
74
80
  {
75
81
  command: "databases",
76
82
  aliases: ["database", "db"],
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as describe, a as handler, o as list } from "../_chunks/operations-CzaR_uqx.js";
1
+ export { t as aliases, n as builder, r as command, i as describe, a as get, o as handler, s as list } from "../_chunks/operations-D7qGkKo3.js";
@@ -0,0 +1 @@
1
+ export { t as aliases, n as builder, r as command, i as describe, a as handler } from "../_chunks/postgres-BkJPZRov.js";
@@ -1 +1 @@
1
- export { t as builder, n as command, r as describe, i as handler } from "../_chunks/psql-Bce4X0NG.js";
1
+ export { t as builder, n as builderFor, r as command, i as describe, a as handler } from "../_chunks/psql-BcxiPR4W.js";
@@ -1 +1 @@
1
- export { t as aliases, n as builder, r as command, i as create, a as deleteRole, o as describe, s as handler, c as list } from "../_chunks/roles-CNoDyRf4.js";
1
+ export { t as aliases, n as builder, r as builderFor, i as command, a as create, o as deleteRole, s as describe, c as handler, l as list } from "../_chunks/roles-BXGtPGjv.js";
package/dist/init/auth.js CHANGED
@@ -98,4 +98,4 @@ const pullInitEnv = async (props) => {
98
98
  throw authenticationFailed();
99
99
  }
100
100
  };
101
- export { pullInitEnv, resolveInitConfigApi, runAuthenticatedMcp };
101
+ export { authContext, pullInitEnv, resolveInitConfigApi, runAuthenticatedMcp };
@@ -0,0 +1,70 @@
1
+ import { isNeonApiError } from "../api.js";
2
+ import { contextBranch, readContextFile } from "../context.js";
3
+ import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
4
+ import { recoverFrom401 } from "../auth_recovery.js";
5
+ import { loadProjectConfig } from "../project.js";
6
+ import { loadEnvFileIntoProcess } from "../env_file.js";
7
+ import { r as applyCmd } from "../_chunks/config-CgtJH8xE.js";
8
+ import { authContext } from "./auth.js";
9
+ import { existsSync } from "node:fs";
10
+ // src/init/deploy.ts
11
+ /**
12
+ * The function env keys neon.ts reads that neither `envFile` nor the environment sets.
13
+ * `neon deploy --env <envFile>` refuses to run until this is empty.
14
+ */
15
+ const missingDeployEnv = async (options) => {
16
+ const applied = existsSync(options.envFile) ? loadEnvFileIntoProcess(options.envFile) : [];
17
+ try {
18
+ const { omittedFunctionEnv } = await loadProjectConfig({
19
+ cwd: options.cwd,
20
+ contextFile: options.contextFile,
21
+ unsetFunctionEnv: "omit"
22
+ });
23
+ return omittedFunctionEnv;
24
+ } finally {
25
+ for (const key of applied) delete process.env[key];
26
+ }
27
+ };
28
+ /**
29
+ * Runs `neon deploy --env <envFile>` in process against the branch `link` pinned, resolving
30
+ * auth the way the standalone command does.
31
+ */
32
+ const deployInitProject = async (options) => {
33
+ const context = readContextFile(options.contextFile);
34
+ const branch = contextBranch(context);
35
+ const projectId = context.projectId;
36
+ if (!projectId || !branch) throw new Error("Can't deploy: the directory isn't linked to a Neon project. Run `neon link`, then `neon deploy`.");
37
+ const authenticated = authContext(options, ["deploy"]);
38
+ const apply = () => inDirectory(options.cwd, () => applyCmd({
39
+ ...authenticated,
40
+ output: "table",
41
+ projectId,
42
+ branch,
43
+ cwd: options.cwd,
44
+ ...existsSync(options.envFile) ? { env: options.envFile } : {}
45
+ }));
46
+ await ensureAuth(authenticated);
47
+ try {
48
+ await apply();
49
+ return;
50
+ } catch (error) {
51
+ if (!isNeonApiError(error) || error.status !== 401) throw error;
52
+ if (!await recoverFrom401(true)) throw new Error("Authentication failed.");
53
+ }
54
+ await ensureAuth(authenticated);
55
+ await apply();
56
+ };
57
+ /**
58
+ * `config apply` resolves function sources, bundles, and runs hooks relative to
59
+ * `process.cwd()`, so the deploy runs from the project directory.
60
+ */
61
+ const inDirectory = async (dir, run) => {
62
+ const previous = process.cwd();
63
+ process.chdir(dir);
64
+ try {
65
+ return await run();
66
+ } finally {
67
+ process.chdir(previous);
68
+ }
69
+ };
70
+ export { deployInitProject, missingDeployEnv };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "8.19.0",
3
+ "version": "8.21.0",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -73,10 +73,10 @@
73
73
  "yaml": "^2.9.0",
74
74
  "yargs": "17.7.2",
75
75
  "yoctocolors": "^2.1.2",
76
- "@neon/config": "1.10.3",
77
- "@neon/config-runtime": "1.11.3",
78
- "@neon/realtime": "0.1.2",
79
- "@neon/sdk": "7.8.1"
76
+ "@neon/config-runtime": "1.11.4",
77
+ "@neon/realtime": "0.2.0",
78
+ "@neon/sdk": "7.8.1",
79
+ "@neon/config": "1.11.0"
80
80
  },
81
81
  "optionalDependencies": {
82
82
  "@napi-rs/keyring": "1.3.0",
@@ -113,9 +113,9 @@
113
113
  "typescript": "^5.9.0",
114
114
  "vitest": "^3.0.9",
115
115
  "@neon-internals/cli-core": "0.0.0",
116
- "@neon-internals/env-core": "0.0.41",
116
+ "@neon-internals/env-core": "0.0.42",
117
117
  "@neon/e2e-harness": "0.0.0",
118
- "@neon/env": "1.6.11",
118
+ "@neon/env": "1.6.12",
119
119
  "@neon/functions": "0.11.0"
120
120
  },
121
121
  "publishConfig": {