neonctl 2.25.1 → 2.26.1

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.
Files changed (2) hide show
  1. package/commands/init.js +29 -35
  2. package/package.json +5 -5
package/commands/init.js CHANGED
@@ -1,27 +1,6 @@
1
- import { init } from 'neon-init';
1
+ import { interactiveInit, orchestrate } from 'neon-init';
2
2
  import { sendError } from '../analytics.js';
3
3
  import { log } from '../log.js';
4
- const AGENT_FLAG_VALUES = ['cursor', 'copilot', 'claude'];
5
- function parseAgentToEditor(value) {
6
- const normalized = value.trim().toLowerCase();
7
- switch (normalized) {
8
- case 'cursor':
9
- return 'Cursor';
10
- case 'github-copilot':
11
- case 'copilot':
12
- case 'vs code':
13
- case 'vscode':
14
- case 'vs-code':
15
- return 'VS Code';
16
- case 'claude-code':
17
- case 'claude cli':
18
- case 'claude-cli':
19
- case 'claude':
20
- return 'Claude CLI';
21
- default:
22
- return null;
23
- }
24
- }
25
4
  export const command = 'init';
26
5
  export const describe = 'Initialize a project with Neon using your AI coding assistant';
27
6
  export const builder = (yargs) => yargs
@@ -31,23 +10,38 @@ export const builder = (yargs) => yargs
31
10
  .option('agent', {
32
11
  alias: 'a',
33
12
  type: 'string',
34
- describe: 'Agent to configure (cursor, copilot, code).',
13
+ describe: 'Agent to configure (cursor, copilot, claude, etc.).',
14
+ })
15
+ .option('skip-neon-auth', {
16
+ type: 'boolean',
17
+ default: false,
18
+ describe: 'Skip the Neon Auth setup phase.',
19
+ })
20
+ .option('skip-migrations', {
21
+ type: 'boolean',
22
+ default: false,
23
+ describe: 'Skip the migrations phase.',
24
+ })
25
+ .option('preview', {
26
+ type: 'boolean',
27
+ default: false,
28
+ describe: 'Enable preview features (e.g. project bootstrapping from templates).',
35
29
  })
36
30
  .strict(false);
37
31
  export const handler = async (argv) => {
38
- let options;
39
- const agentArg = argv.agent;
40
- if (agentArg !== undefined) {
41
- const editor = parseAgentToEditor(agentArg);
42
- if (editor === null) {
43
- log.error(`Invalid --agent value: "${agentArg}". Supported: ${AGENT_FLAG_VALUES.join(', ')}`);
44
- process.exit(1);
45
- return;
46
- }
47
- options = { agent: editor };
48
- }
49
32
  try {
50
- await init(options);
33
+ if (argv.agent !== undefined) {
34
+ const result = await orchestrate({
35
+ agent: argv.agent || undefined,
36
+ skipNeonAuth: argv.skipNeonAuth,
37
+ skipMigrations: argv.skipMigrations,
38
+ preview: argv.preview,
39
+ });
40
+ log.info(JSON.stringify(result, null, 2));
41
+ }
42
+ else {
43
+ await interactiveInit({ preview: argv.preview });
44
+ }
51
45
  }
52
46
  catch {
53
47
  const exitError = new Error(`failed to run neon-init`);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+ssh://git@github.com/neondatabase/neonctl.git"
6
6
  },
7
7
  "type": "module",
8
- "version": "2.25.1",
8
+ "version": "2.26.1",
9
9
  "description": "CLI tool for NeonDB Cloud management",
10
10
  "main": "index.js",
11
11
  "author": "NeonDB",
@@ -59,9 +59,9 @@
59
59
  "dependencies": {
60
60
  "@hono/node-server": "2.0.4",
61
61
  "@neondatabase/api-client": "2.7.1",
62
- "@neondatabase/config": "0.7.0",
63
- "@neondatabase/config-runtime": "0.7.0",
64
- "@neondatabase/env": "0.5.0",
62
+ "@neondatabase/config": "0.7.1",
63
+ "@neondatabase/config-runtime": "0.7.1",
64
+ "@neondatabase/env": "0.5.1",
65
65
  "@segment/analytics-node": "1.3.0",
66
66
  "axios": "1.7.2",
67
67
  "axios-debug-log": "1.0.0",
@@ -71,7 +71,7 @@
71
71
  "cliui": "8.0.1",
72
72
  "diff": "5.2.0",
73
73
  "fflate": "^0.8.3",
74
- "neon-init": "0.15.0",
74
+ "neon-init": "0.16.1",
75
75
  "open": "10.1.0",
76
76
  "openid-client": "6.8.1",
77
77
  "pg-protocol": "^1.14.0",