@hasna/terminal 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/dist/cli.js +10 -2
- package/package.json +1 -1
- package/src/cli.tsx +7 -2
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import { render } from "ink";
|
|
|
4
4
|
const args = process.argv.slice(2);
|
|
5
5
|
// ── Help / Version ───────────────────────────────────────────────────────────
|
|
6
6
|
if (args[0] === "--help" || args[0] === "-h" || args[0] === "help") {
|
|
7
|
-
console.log(`open-terminal
|
|
7
|
+
console.log(`open-terminal v1.0.0 — Smart terminal for AI agents and humans
|
|
8
8
|
|
|
9
9
|
USAGE:
|
|
10
10
|
terminal Launch interactive NL terminal (TUI)
|
|
@@ -48,7 +48,15 @@ ENVIRONMENT:
|
|
|
48
48
|
process.exit(0);
|
|
49
49
|
}
|
|
50
50
|
if (args[0] === "--version" || args[0] === "-v") {
|
|
51
|
-
|
|
51
|
+
const { readFileSync } = await import("fs");
|
|
52
|
+
const { join, dirname } = await import("path");
|
|
53
|
+
try {
|
|
54
|
+
const pkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf8"));
|
|
55
|
+
console.log(pkg.version);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
console.log("1.0.0");
|
|
59
|
+
}
|
|
52
60
|
process.exit(0);
|
|
53
61
|
}
|
|
54
62
|
// ── Exec command — smart execution for agents ────────────────────────────────
|
package/package.json
CHANGED
package/src/cli.tsx
CHANGED
|
@@ -7,7 +7,7 @@ const args = process.argv.slice(2);
|
|
|
7
7
|
// ── Help / Version ───────────────────────────────────────────────────────────
|
|
8
8
|
|
|
9
9
|
if (args[0] === "--help" || args[0] === "-h" || args[0] === "help") {
|
|
10
|
-
console.log(`open-terminal
|
|
10
|
+
console.log(`open-terminal v1.0.0 — Smart terminal for AI agents and humans
|
|
11
11
|
|
|
12
12
|
USAGE:
|
|
13
13
|
terminal Launch interactive NL terminal (TUI)
|
|
@@ -52,7 +52,12 @@ ENVIRONMENT:
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (args[0] === "--version" || args[0] === "-v") {
|
|
55
|
-
|
|
55
|
+
const { readFileSync } = await import("fs");
|
|
56
|
+
const { join, dirname } = await import("path");
|
|
57
|
+
try {
|
|
58
|
+
const pkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf8"));
|
|
59
|
+
console.log(pkg.version);
|
|
60
|
+
} catch { console.log("1.0.0"); }
|
|
56
61
|
process.exit(0);
|
|
57
62
|
}
|
|
58
63
|
|