@mushi-mushi/cli 0.27.0 → 0.27.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/README.md CHANGED
@@ -440,4 +440,4 @@ The CLI is also importable for tooling (used by `create-mushi-mushi`):
440
440
  MIT
441
441
 
442
442
  <!-- mushi-readme-stats-footer -->
443
- <sub>Monorepo scale (July 2026): 55 edge functions · 328 SQL migrations · 13 outbound plugins · 11 inbound adapters · 19 pipeline agents. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
443
+ <sub>Monorepo scale (July 2026): 55 edge functions · 331 SQL migrations · 13 outbound plugins · 11 inbound adapters · 19 pipeline agents. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/version.ts
4
+ var MUSHI_CLI_VERSION = true ? "0.27.1" : "0.0.0-dev";
5
+ var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.1";
6
+
7
+ export {
8
+ MUSHI_CLI_VERSION,
9
+ MUSHI_MCP_PIN_SPEC
10
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MUSHI_CLI_VERSION
3
- } from "./chunk-LFZ5ZIBI.js";
3
+ } from "./chunk-XLGHUOKY.js";
4
4
  import {
5
5
  __require
6
6
  } from "./chunk-3RG5ZIWI.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MUSHI_CLI_VERSION,
4
4
  MUSHI_MCP_PIN_SPEC
5
- } from "./chunk-MXD5UNMP.js";
5
+ } from "./chunk-DBAEB56N.js";
6
6
  import {
7
7
  CLOUD_API_ENDPOINT,
8
8
  assertEndpoint,
@@ -0,0 +1,8 @@
1
+ // src/version.ts
2
+ var MUSHI_CLI_VERSION = true ? "0.27.1" : "0.0.0-dev";
3
+ var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.1";
4
+
5
+ export {
6
+ MUSHI_CLI_VERSION,
7
+ MUSHI_MCP_PIN_SPEC
8
+ };
@@ -4,10 +4,10 @@ import {
4
4
  requireUuid,
5
5
  saveConfig,
6
6
  waitForIngestReady
7
- } from "./chunk-TZL3F3GT.js";
7
+ } from "./chunk-M7CDSRZM.js";
8
8
  import {
9
9
  MUSHI_MCP_PIN_SPEC
10
- } from "./chunk-LFZ5ZIBI.js";
10
+ } from "./chunk-XLGHUOKY.js";
11
11
  import {
12
12
  detectFramework,
13
13
  envVarsToWrite,
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runConnect
4
- } from "./chunk-7JZUKNN5.js";
5
- import "./chunk-MXD5UNMP.js";
4
+ } from "./chunk-NNB2NONG.js";
5
+ import "./chunk-DBAEB56N.js";
6
6
  import "./chunk-LDPFTQLE.js";
7
7
  import "./chunk-PDX44BCA.js";
8
8
  export {
package/dist/index.js CHANGED
@@ -45,11 +45,11 @@ import {
45
45
  setGlobalOutputFormat,
46
46
  trySaveKeyToKeychain,
47
47
  writeMcpServerEntry
48
- } from "./chunk-7JZUKNN5.js";
48
+ } from "./chunk-NNB2NONG.js";
49
49
  import {
50
50
  MUSHI_CLI_VERSION,
51
51
  MUSHI_MCP_PIN_SPEC
52
- } from "./chunk-MXD5UNMP.js";
52
+ } from "./chunk-DBAEB56N.js";
53
53
  import {
54
54
  TEST_REPORT_FETCH_TIMEOUT_MS,
55
55
  assertEndpoint,
@@ -1203,7 +1203,7 @@ async function checkOnboardingStatus(config, _consoleBase, cwd, doFetch = global
1203
1203
  }
1204
1204
  async function checkVersionDrift(cwd, doFetch) {
1205
1205
  const checks = [];
1206
- const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-F3ZOPM5F.js");
1206
+ const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-AYMUW3UQ.js");
1207
1207
  if (MUSHI_CLI_VERSION2 === "0.0.0-dev") return checks;
1208
1208
  const parse2 = (v) => {
1209
1209
  const m = v.replace(/^[~^]/, "").match(/^(\d+)\.(\d+)\.(\d+)/);
@@ -1969,7 +1969,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
1969
1969
  if (p.isCancel(answer) || !answer) return;
1970
1970
  const endpoint = resolveCloudEndpoint(options.endpoint);
1971
1971
  try {
1972
- const { runConnect: runConnect2 } = await import("./connect-QHVFH77E.js");
1972
+ const { runConnect: runConnect2 } = await import("./connect-TWO2ZNFB.js");
1973
1973
  await runConnect2({
1974
1974
  apiKey: credentials.apiKey,
1975
1975
  projectId: credentials.projectId,
@@ -4844,10 +4844,7 @@ function registerKeysCommands(program2) {
4844
4844
  console.error("Run `mushi login` first");
4845
4845
  process.exit(1);
4846
4846
  }
4847
- const res = await apiCall(
4848
- `/v1/admin/byok/keys?project_id=${encodeURIComponent(config.projectId)}`,
4849
- config
4850
- );
4847
+ const res = await apiCall(`/v1/admin/byok/keys?project_id=${encodeURIComponent(config.projectId)}`, config);
4851
4848
  if (!res.ok) {
4852
4849
  console.error(`Error: ${res.error.message}`);
4853
4850
  process.exit(1);
@@ -4855,13 +4852,31 @@ function registerKeysCommands(program2) {
4855
4852
  printResult(res.data, {
4856
4853
  json: opts.json,
4857
4854
  render(d) {
4858
- if (d.keys.length === 0) {
4855
+ const legacyKeys = d.legacyKeys ?? [];
4856
+ if (d.keys.length === 0 && legacyKeys.length === 0) {
4859
4857
  console.log("No keys configured.");
4860
4858
  return;
4861
4859
  }
4862
4860
  for (const k of d.keys) {
4863
4861
  const cooldown = k.cooldown_until && new Date(k.cooldown_until) > /* @__PURE__ */ new Date() ? ` [cooldown until ${new Date(k.cooldown_until).toLocaleTimeString()}]` : "";
4864
- console.log(`${k.provider_slug.padEnd(14)} [${k.status}] p=${k.priority} ${k.label ?? "(no label)"}${cooldown} \u2014 ${k.id}`);
4862
+ const validation = k.test_status ? ` test=${k.test_status}` : " test=required";
4863
+ const lastTested = k.last_tested_at ? ` tested=${new Date(k.last_tested_at).toISOString()}` : "";
4864
+ const lastUsed = k.last_used_at ? ` used=${new Date(k.last_used_at).toISOString()}` : "";
4865
+ const baseUrl = k.base_url ? ` base=${k.base_url}` : "";
4866
+ const hint = k.key_hint ? ` hint=${k.key_hint}` : "";
4867
+ console.log(
4868
+ `${k.provider_slug.padEnd(14)} [${k.status}]${validation} p=${k.priority} ${k.label ?? "(no label)"}${hint}${baseUrl}${cooldown}${lastTested}${lastUsed} created=${new Date(k.created_at).toISOString()} \u2014 ${k.id}`
4869
+ );
4870
+ }
4871
+ for (const k of legacyKeys) {
4872
+ const validation = k.test_status ? ` test=${k.test_status}` : " test=required";
4873
+ const lastTested = k.last_tested_at ? ` tested=${new Date(k.last_tested_at).toISOString()}` : "";
4874
+ const lastUsed = k.last_used_at ? ` used=${new Date(k.last_used_at).toISOString()}` : "";
4875
+ const created = k.created_at ? ` created=${new Date(k.created_at).toISOString()}` : "";
4876
+ const hint = k.key_hint ? ` hint=${k.key_hint}` : "";
4877
+ console.log(
4878
+ `${k.provider_slug.padEnd(14)} [${k.status}]${validation} legacy${hint}${lastTested}${lastUsed}${created} \u2014 manage in the console`
4879
+ );
4865
4880
  }
4866
4881
  }
4867
4882
  });
@@ -4912,41 +4927,108 @@ function registerKeysCommands(program2) {
4912
4927
  ).catch(() => null);
4913
4928
  serverRevoked = revokeResult?.revoked === 1;
4914
4929
  }
4915
- printResult({ newPrefix: newKey.slice(0, 12), oldPrefix, serverRevoked }, {
4916
- json: opts.json,
4917
- render(d) {
4918
- console.log(`\u2713 Key rotated.`);
4919
- console.log(` Old prefix: ${d.oldPrefix}\u2026 \u2192 New prefix: ${d.newPrefix}\u2026`);
4920
- console.log(` New key saved to local config.`);
4921
- if (d.serverRevoked) {
4922
- console.log(` \u2713 Old key revoked on the server.`);
4923
- } else {
4924
- console.log(` \u2139 Old key may still be active \u2014 revoke it at: ${config.consoleUrl ?? "your Mushi console"} \u2192 Settings \u2192 API Keys`);
4930
+ printResult(
4931
+ { newPrefix: newKey.slice(0, 12), oldPrefix, serverRevoked },
4932
+ {
4933
+ json: opts.json,
4934
+ render(d) {
4935
+ console.log(`\u2713 Key rotated.`);
4936
+ console.log(` Old prefix: ${d.oldPrefix}\u2026 \u2192 New prefix: ${d.newPrefix}\u2026`);
4937
+ console.log(` New key saved to local config.`);
4938
+ if (d.serverRevoked) {
4939
+ console.log(` \u2713 Old key revoked on the server.`);
4940
+ } else {
4941
+ console.log(
4942
+ ` \u2139 Old key may still be active \u2014 revoke it at: ${config.consoleUrl ?? "your Mushi console"} \u2192 Settings \u2192 API Keys`
4943
+ );
4944
+ }
4925
4945
  }
4926
4946
  }
4927
- });
4947
+ );
4928
4948
  });
4929
- keys.command("add").description("Add a new API key to the pool").requiredOption("--provider <p>", "Provider: anthropic, openai, firecrawl, browserbase, cursor").option("--key <k>", "The API key value (prefer the MUSHI_BYOK_KEY env var to keep it out of shell history)").option("--label <l>", "Human-readable label").option("--priority <n>", "Priority (lower = higher priority)", "100").action(async (opts) => {
4949
+ keys.command("add").description("Add a new API key to the pool").requiredOption("--provider <p>", "Provider: anthropic, openai, firecrawl, browserbase, cursor").option(
4950
+ "--key <k>",
4951
+ "The API key value (prefer the MUSHI_BYOK_KEY env var to keep it out of shell history)"
4952
+ ).option("--label <l>", "Human-readable label").option("--priority <n>", "Priority (lower = higher priority)", "100").option("--base-url <url>", "Allow-listed OpenAI-compatible HTTPS base URL").action(
4953
+ async (opts) => {
4954
+ const config = loadConfig();
4955
+ if (!config.apiKey || !config.projectId) {
4956
+ console.error("Run `mushi login` first");
4957
+ process.exit(1);
4958
+ }
4959
+ const key = process.env.MUSHI_BYOK_KEY ?? opts.key;
4960
+ if (!key) {
4961
+ console.error(
4962
+ "Provide the key via the MUSHI_BYOK_KEY env var (recommended) or --key <value>."
4963
+ );
4964
+ process.exit(1);
4965
+ }
4966
+ const priority = Number(opts.priority);
4967
+ if (!Number.isInteger(priority) || priority < 0 || priority > 1e4) {
4968
+ console.error("Priority must be an integer between 0 and 10000.");
4969
+ process.exit(1);
4970
+ }
4971
+ const res = await apiCall("/v1/admin/byok/keys", config, {
4972
+ method: "POST",
4973
+ body: JSON.stringify({
4974
+ project_id: config.projectId,
4975
+ provider_slug: opts.provider,
4976
+ key,
4977
+ label: opts.label,
4978
+ priority,
4979
+ base_url: opts.baseUrl
4980
+ })
4981
+ });
4982
+ if (!res.ok) {
4983
+ console.error(`Error: ${res.error.message}`);
4984
+ process.exit(1);
4985
+ }
4986
+ if (res.data.validation.status === "ok") {
4987
+ console.log(`\u2713 Key validated and active \u2014 id: ${res.data.id}`);
4988
+ return;
4989
+ }
4990
+ console.log(
4991
+ `! Key saved but quarantined (${res.data.validation.status}) \u2014 id: ${res.data.id}`
4992
+ );
4993
+ console.log(` ${res.data.validation.detail}`);
4994
+ }
4995
+ );
4996
+ keys.command("test <key-id>").description("Re-test one pooled key and activate it only if validation passes").action(async (keyId) => {
4930
4997
  const config = loadConfig();
4931
4998
  if (!config.apiKey || !config.projectId) {
4932
4999
  console.error("Run `mushi login` first");
4933
5000
  process.exit(1);
4934
5001
  }
4935
- const key = process.env.MUSHI_BYOK_KEY ?? opts.key;
4936
- if (!key) {
4937
- console.error("Provide the key via the MUSHI_BYOK_KEY env var (recommended) or --key <value>.");
5002
+ const res = await apiCall(`/v1/admin/byok/keys/${encodeURIComponent(keyId)}/test`, config, { method: "POST" });
5003
+ if (!res.ok) {
5004
+ console.error(`Error: ${res.error.message}`);
5005
+ process.exit(1);
5006
+ }
5007
+ if (res.data.validation.status === "ok") {
5008
+ console.log(`\u2713 Key validated and active \u2014 id: ${res.data.key.id}`);
5009
+ return;
5010
+ }
5011
+ console.log(
5012
+ `! Key remains quarantined (${res.data.validation.status}) \u2014 id: ${res.data.key.id}`
5013
+ );
5014
+ console.log(` ${res.data.validation.detail}`);
5015
+ });
5016
+ keys.command("remove <key-id>").description("Permanently remove one pooled key and its Vault secret").action(async (keyId) => {
5017
+ const config = loadConfig();
5018
+ if (!config.apiKey || !config.projectId) {
5019
+ console.error("Run `mushi login` first");
4938
5020
  process.exit(1);
4939
5021
  }
4940
5022
  const res = await apiCall(
4941
- "/v1/admin/byok/keys",
5023
+ `/v1/admin/byok/keys/${encodeURIComponent(keyId)}`,
4942
5024
  config,
4943
- { method: "POST", body: JSON.stringify({ project_id: config.projectId, provider_slug: opts.provider, key, label: opts.label, priority: parseInt(opts.priority, 10) }) }
5025
+ { method: "DELETE" }
4944
5026
  );
4945
5027
  if (!res.ok) {
4946
5028
  console.error(`Error: ${res.error.message}`);
4947
5029
  process.exit(1);
4948
5030
  }
4949
- console.log(`\u2713 Key added \u2014 id: ${res.data.id}`);
5031
+ console.log(`\u2713 Key removed \u2014 id: ${res.data.keyId}`);
4950
5032
  });
4951
5033
  }
4952
5034
 
package/dist/init.js CHANGED
@@ -19,10 +19,10 @@ import {
19
19
  sanitizeCliCredentials,
20
20
  sanitizeEndpoint,
21
21
  saveConfig
22
- } from "./chunk-TZL3F3GT.js";
22
+ } from "./chunk-M7CDSRZM.js";
23
23
  import {
24
24
  MUSHI_CLI_VERSION
25
- } from "./chunk-LFZ5ZIBI.js";
25
+ } from "./chunk-XLGHUOKY.js";
26
26
  import {
27
27
  FRAMEWORKS,
28
28
  detectFramework,
@@ -1803,7 +1803,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
1803
1803
  if (p.isCancel(answer) || !answer) return;
1804
1804
  const endpoint = resolveCloudEndpoint(options.endpoint);
1805
1805
  try {
1806
- const { runConnect } = await import("./connect-FAXWVFG2.js");
1806
+ const { runConnect } = await import("./connect-5EQA7G3U.js");
1807
1807
  await runConnect({
1808
1808
  apiKey: credentials.apiKey,
1809
1809
  projectId: credentials.projectId,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MUSHI_CLI_VERSION,
4
4
  MUSHI_MCP_PIN_SPEC
5
- } from "./chunk-MXD5UNMP.js";
5
+ } from "./chunk-DBAEB56N.js";
6
6
  import "./chunk-PDX44BCA.js";
7
7
  export {
8
8
  MUSHI_CLI_VERSION,
package/dist/version.d.ts CHANGED
@@ -14,6 +14,6 @@ declare const MUSHI_CLI_VERSION: string;
14
14
  * setup refreshes the pin. Synced to packages/mcp/package.json by
15
15
  * `scripts/sync-mcp-pin.mjs` — never hand-edit the version.
16
16
  */
17
- declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.0";
17
+ declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.1";
18
18
 
19
19
  export { MUSHI_CLI_VERSION, MUSHI_MCP_PIN_SPEC };
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MUSHI_CLI_VERSION,
3
3
  MUSHI_MCP_PIN_SPEC
4
- } from "./chunk-LFZ5ZIBI.js";
4
+ } from "./chunk-XLGHUOKY.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
  export {
7
7
  MUSHI_CLI_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/cli",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "license": "MIT",
5
5
  "description": "CLI for Mushi Mushi — `mushi init` wizard installs the right SDK for your framework, plus report triage and pipeline health commands",
6
6
  "bin": {
@@ -1,8 +0,0 @@
1
- // src/version.ts
2
- var MUSHI_CLI_VERSION = true ? "0.27.0" : "0.0.0-dev";
3
- var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.0";
4
-
5
- export {
6
- MUSHI_CLI_VERSION,
7
- MUSHI_MCP_PIN_SPEC
8
- };
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/version.ts
4
- var MUSHI_CLI_VERSION = true ? "0.27.0" : "0.0.0-dev";
5
- var MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.20.0";
6
-
7
- export {
8
- MUSHI_CLI_VERSION,
9
- MUSHI_MCP_PIN_SPEC
10
- };