@closedrouter/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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,wBAAsB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,wBAAsB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8ElF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAsDnD"}
|
package/dist/index.js
CHANGED
|
@@ -7968,6 +7968,7 @@ ${import_picocolors6.default.yellow("Save this key securely. It has been set as
|
|
|
7968
7968
|
} catch (err) {
|
|
7969
7969
|
s2.stop(import_picocolors6.default.red("Failed to create key"));
|
|
7970
7970
|
Me(err instanceof Error ? err.message : String(err), "Error");
|
|
7971
|
+
process.exitCode = 1;
|
|
7971
7972
|
}
|
|
7972
7973
|
Se("Done.");
|
|
7973
7974
|
return;
|
|
@@ -7984,9 +7985,11 @@ Create one via:
|
|
|
7984
7985
|
} else {
|
|
7985
7986
|
const rows = keys.map((k3, i) => {
|
|
7986
7987
|
const active = k3.is_active ? import_picocolors6.default.green("● active") : import_picocolors6.default.red("○ revoked");
|
|
7987
|
-
const
|
|
7988
|
+
const budgetLimit = k3.budget_limit_tokens ?? k3.budget_tokens;
|
|
7989
|
+
const budget = budgetLimit == null ? "unlimited" : `${Number(budgetLimit).toLocaleString()} tokens`;
|
|
7990
|
+
const used = `${Number(k3.used_tokens ?? 0).toLocaleString()} tokens`;
|
|
7988
7991
|
return ` ${import_picocolors6.default.dim((i + 1).toString().padStart(2, " "))}. ${import_picocolors6.default.bold(k3.name || "Unnamed Key")} [${k3.key_prefix || "cr-sk-..."}] ${active}
|
|
7989
|
-
${import_picocolors6.default.dim("Created:")} ${new Date(k3.created_at).toLocaleDateString()} | ${import_picocolors6.default.dim("Budget:")} ${budget}`;
|
|
7992
|
+
${import_picocolors6.default.dim("Created:")} ${new Date(k3.created_at).toLocaleDateString()} | ${import_picocolors6.default.dim("Budget:")} ${budget} | ${import_picocolors6.default.dim("Used:")} ${used}`;
|
|
7990
7993
|
});
|
|
7991
7994
|
console.log(rows.join(`
|
|
7992
7995
|
|
|
@@ -7996,6 +7999,7 @@ Create one via:
|
|
|
7996
7999
|
} catch (err) {
|
|
7997
8000
|
s.stop(import_picocolors6.default.red("Failed to list keys"));
|
|
7998
8001
|
Me(err instanceof Error ? err.message : String(err), "Error");
|
|
8002
|
+
process.exitCode = 1;
|
|
7999
8003
|
}
|
|
8000
8004
|
Se("Done.");
|
|
8001
8005
|
}
|
|
@@ -8470,6 +8474,7 @@ to scan and import local subscriptions!`, "Pool Empty");
|
|
|
8470
8474
|
} catch (err) {
|
|
8471
8475
|
s.stop(import_picocolors11.default.red("Could not fetch account status"));
|
|
8472
8476
|
Me(err instanceof Error ? err.message : String(err), "Error");
|
|
8477
|
+
process.exitCode = 1;
|
|
8473
8478
|
}
|
|
8474
8479
|
Se(import_picocolors11.default.cyan(`Dashboard available at: ${config.serverUrl.replace(/:\d+$/, ":5173")}`));
|
|
8475
8480
|
}
|
|
@@ -8757,7 +8762,7 @@ process.on("warning", (warning) => {
|
|
|
8757
8762
|
console.warn(warning.name, warning.message);
|
|
8758
8763
|
});
|
|
8759
8764
|
var program2 = new Command;
|
|
8760
|
-
program2.name("closedrouter").description("ClosedRouter CLI: Import local AI subscriptions & API keys into your shared token pool").version("1.0.
|
|
8765
|
+
program2.name("closedrouter").description("ClosedRouter CLI: Import local AI subscriptions & API keys into your shared token pool").version("1.0.1").option("-s, --server <url>", "ClosedRouter server base URL (default: http://localhost:8000)").action(async (options) => {
|
|
8761
8766
|
await onboardCommand({ server: options.server });
|
|
8762
8767
|
});
|
|
8763
8768
|
program2.command("onboard").description("Run the full interactive onboarding wizard").option("-s, --server <url>", "ClosedRouter server base URL").option("-a, --all", "Automatically import all discovered accounts").option("--shared", "Contribute accounts to the shared team pool").action(async (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@closedrouter/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "ClosedRouter CLI: Onboard and import local AI subscriptions and API keys into your shared token pool",
|
|
5
5
|
"author": "ClosedRouter Contributors",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"bin": {
|
|
19
|
-
"closedrouter": "
|
|
20
|
-
"cr": "
|
|
19
|
+
"closedrouter": "bin/closedrouter.js",
|
|
20
|
+
"cr": "bin/closedrouter.js"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|