@every-env/spiral-cli 1.0.0 → 1.0.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.
package/bin/spiral.mjs ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from "node:child_process";
4
+ import { fileURLToPath } from "node:url";
5
+ import { dirname, join } from "node:path";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const cli = join(__dirname, "..", "src", "cli.ts");
9
+
10
+ // Try bun first (handles .ts natively), fall back to error message
11
+ try {
12
+ execFileSync("bun", ["run", cli, ...process.argv.slice(2)], {
13
+ stdio: "inherit",
14
+ env: process.env,
15
+ });
16
+ } catch (err) {
17
+ if (err.status !== undefined) {
18
+ // Command ran but exited non-zero — propagate exit code
19
+ process.exit(err.status);
20
+ }
21
+ // bun not found
22
+ console.error(
23
+ "Spiral CLI requires Bun to run. Install it with: curl -fsSL https://bun.sh/install | bash",
24
+ );
25
+ process.exit(1);
26
+ }
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@every-env/spiral-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CLI for Spiral API - create content from your terminal",
5
5
  "author": "Kieran Klaassen",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "bin": {
9
- "spiral": "./src/cli.ts"
9
+ "spiral": "./bin/spiral.mjs"
10
10
  },
11
11
  "files": [
12
+ "bin",
12
13
  "src",
13
14
  "README.md"
14
15
  ],
package/src/cli.ts CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  type GenerateResponse,
16
16
  } from "./types.js";
17
17
 
18
- const VERSION = "1.0.0";
18
+ const VERSION = "1.0.1";
19
19
 
20
20
  const HELP = `
21
21
  ${theme.heading("spiral")} — write with Spiral from your terminal