@blinkdotnew/cli 0.4.1 → 0.4.2

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/cli.js CHANGED
@@ -2089,8 +2089,22 @@ For CI/GitHub Actions: set BLINK_API_KEY as a secret, skip login entirely.
2089
2089
  console.log(chalk10.green("\u2713") + " Already authenticated via BLINK_API_KEY env var.");
2090
2090
  return;
2091
2091
  }
2092
+ const url = "https://blink.new/settings?tab=api-keys";
2093
+ if (!opts.interactive) {
2094
+ console.log(chalk10.bold("\n Open this page to get your API key:\n"));
2095
+ console.log(` ${chalk10.cyan(url)}
2096
+ `);
2097
+ const open = await import("open").then((m) => m.default).catch(() => null);
2098
+ if (open) {
2099
+ await open(url).catch(() => {
2100
+ });
2101
+ console.log(chalk10.dim(" (opened in browser)"));
2102
+ }
2103
+ console.log(chalk10.dim(" Then run: blink login --interactive\n"));
2104
+ return;
2105
+ }
2092
2106
  const { password } = await import("@clack/prompts");
2093
- const apiKey = await password({ message: "Enter your Blink API key (blnk_ak_...):" });
2107
+ const apiKey = await password({ message: "Paste your API key (blnk_ak_...):" });
2094
2108
  if (!apiKey?.startsWith("blnk_ak_")) {
2095
2109
  console.error("Error: API key must start with blnk_ak_");
2096
2110
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkdotnew/cli",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Blink CLI — full-stack cloud infrastructure from your terminal. Deploy, database, auth, storage, backend, domains, and more.",
5
5
  "bin": {
6
6
  "blink": "dist/cli.js"
@@ -39,16 +39,17 @@
39
39
  "compile": "bun build src/cli.ts --compile --target bun --outfile dist/blink-bin"
40
40
  },
41
41
  "dependencies": {
42
+ "@clack/prompts": "^0.10.0",
42
43
  "chalk": "^5.3.0",
43
- "ora": "^8.1.1",
44
+ "cli-table3": "^0.6.5",
44
45
  "commander": "^12.1.0",
45
- "@clack/prompts": "^0.10.0",
46
- "cli-table3": "^0.6.5"
46
+ "open": "^11.0.0",
47
+ "ora": "^8.1.1"
47
48
  },
48
49
  "devDependencies": {
50
+ "@types/node": "^22.0.0",
49
51
  "tsup": "^8.3.0",
50
- "typescript": "^5.6.0",
51
- "@types/node": "^22.0.0"
52
+ "typescript": "^5.6.0"
52
53
  },
53
54
  "engines": {
54
55
  "node": ">=22"
@@ -24,8 +24,22 @@ For CI/GitHub Actions: set BLINK_API_KEY as a secret, skip login entirely.
24
24
  console.log(chalk.green('✓') + ' Already authenticated via BLINK_API_KEY env var.')
25
25
  return
26
26
  }
27
+
28
+ const url = 'https://blink.new/settings?tab=api-keys'
29
+ if (!opts.interactive) {
30
+ console.log(chalk.bold('\n Open this page to get your API key:\n'))
31
+ console.log(` ${chalk.cyan(url)}\n`)
32
+ const open = await import('open').then(m => m.default).catch(() => null)
33
+ if (open) {
34
+ await open(url).catch(() => {})
35
+ console.log(chalk.dim(' (opened in browser)'))
36
+ }
37
+ console.log(chalk.dim(' Then run: blink login --interactive\n'))
38
+ return
39
+ }
40
+
27
41
  const { password } = await import('@clack/prompts')
28
- const apiKey = await password({ message: 'Enter your Blink API key (blnk_ak_...):' }) as string
42
+ const apiKey = await password({ message: 'Paste your API key (blnk_ak_...):' }) as string
29
43
  if (!apiKey?.startsWith('blnk_ak_')) {
30
44
  console.error('Error: API key must start with blnk_ak_')
31
45
  process.exit(1)