@methatech-cli/cli 0.1.1 → 0.1.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/README.md +1 -1
- package/dist/commands.js +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,4 +68,4 @@ always listed first at $0.00 — they run on your free credits.
|
|
|
68
68
|
|
|
69
69
|
- Agent coding mode (file tools, run commands, confirm before dangerous ones)
|
|
70
70
|
- Full browser login + polling (needs a panel device-code endpoint)
|
|
71
|
-
- npm publish (`@methatech-cli/cli`) —
|
|
71
|
+
- npm publish (`@methatech-cli/cli`) — PUBLISHED live 2026-11-08 as v0.1.1, `npm install -g @methatech-cli/cli`
|
package/dist/commands.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
2
3
|
import { render } from "ink";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { Command } from "commander";
|
|
@@ -189,12 +190,21 @@ function cmdLogout() {
|
|
|
189
190
|
else
|
|
190
191
|
console.log("Tidak ada key tersimpan.");
|
|
191
192
|
}
|
|
193
|
+
function getVersion() {
|
|
194
|
+
try {
|
|
195
|
+
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
196
|
+
return pkg.version ?? "0.0.0";
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return "0.0.0";
|
|
200
|
+
}
|
|
201
|
+
}
|
|
192
202
|
export function main() {
|
|
193
203
|
const program = new Command();
|
|
194
204
|
program
|
|
195
205
|
.name("metatech")
|
|
196
206
|
.description("MethaTech CLI — chat with MethaTech models from your terminal")
|
|
197
|
-
.version(
|
|
207
|
+
.version(getVersion());
|
|
198
208
|
program
|
|
199
209
|
.command("login")
|
|
200
210
|
.description("Login lewat browser, lalu tempel API key dari panel")
|