@modelstatus/cli 0.1.66 → 0.1.68

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelstatus/cli",
3
- "version": "0.1.66",
3
+ "version": "0.1.68",
4
4
  "description": "Track which AI models you use, where, and never get surprised by a retirement. Free offline model-health for any repo (mm status), browser sign-in for cloud inventory + alerts.",
5
5
  "keywords": [
6
6
  "llm",
package/src/index.js CHANGED
@@ -754,7 +754,7 @@ async function cmdStatus(positional, flags) {
754
754
  const HELP = `LLM Status CLI
755
755
 
756
756
  Usage:
757
- mm Launch the TUI (signs you in via in-TUI device flow if needed)
757
+ mm [dir] Launch the TUI on a folder (defaults to the current one) runs locally
758
758
  mm status [dir] Offline model-health check for a dir — no account needed
759
759
  mm login [api_key] Browser sign-in with polling (or paste a key)
760
760
  mm signup Create an account in the browser, then poll
@@ -883,6 +883,11 @@ async function main() {
883
883
  else if (cmd === "play") await cmdPlay(positional, flags);
884
884
  else if (cmd === "upgrade") await cmdUpgrade(positional, flags);
885
885
  else if (cmd === "tui" || !cmd) await launchTui(positional[1], flags);
886
+ else if (fs.existsSync(cmd) && fs.statSync(cmd).isDirectory()) {
887
+ // `mm ~/my/project` — what every new user tries first. Scope the TUI to it.
888
+ flags.dir = cmd;
889
+ await launchTui(positional[1], flags);
890
+ }
886
891
  else if (cmd === "help" || flags.help) console.log(HELP);
887
892
  else console.log(HELP);
888
893
  } catch (e) {
package/src/tui/signin.js CHANGED
@@ -19,6 +19,7 @@ export function SignIn({ apiBase, onSuccess, onSkip }) {
19
19
  const [url, setUrl] = React.useState(null);
20
20
  const [error, setError] = React.useState(null);
21
21
  const [tick, setTick] = React.useState(0);
22
+ const [attempt, setAttempt] = React.useState(0); // g from the error state bumps this → re-runs the flow
22
23
 
23
24
  // Spinner animation (80ms tick).
24
25
  React.useEffect(() => {
@@ -47,7 +48,7 @@ export function SignIn({ apiBase, onSuccess, onSkip }) {
47
48
  const poll = async () => {
48
49
  if (cancelled) return;
49
50
  if (Date.now() > deadline) {
50
- setError("The login request expired. Press q and run mm login again.");
51
+ setError("The login request expired.");
51
52
  setPhase("error");
52
53
  return;
53
54
  }
@@ -67,7 +68,7 @@ export function SignIn({ apiBase, onSuccess, onSkip }) {
67
68
  return;
68
69
  }
69
70
  if (res?.status === "denied") {
70
- setError("Authorization was denied. Press q to quit.");
71
+ setError("Authorization was denied.");
71
72
  setPhase("error");
72
73
  return;
73
74
  }
@@ -90,12 +91,13 @@ export function SignIn({ apiBase, onSuccess, onSkip }) {
90
91
  cancelled = true;
91
92
  if (pollTimer) clearTimeout(pollTimer);
92
93
  };
93
- }, [apiBase, onSuccess]);
94
+ }, [apiBase, onSuccess, attempt]);
94
95
 
95
96
  useInput((input, key) => {
96
97
  if (key.ctrl && input === "c") return exit();
97
98
  if (input === "q") return exit();
98
99
  if (input === "s" && onSkip) return onSkip();
100
+ if (input === "g" && phase === "error") { setError(null); setPhase("starting"); setAttempt((a) => a + 1); return; }
99
101
  if (input === "o" && url) openUrl(url); // re-open the browser if it didn't fire
100
102
  });
101
103
 
@@ -113,7 +115,7 @@ export function SignIn({ apiBase, onSuccess, onSkip }) {
113
115
  h(Text, { color: "red", bold: true }, " ✕ Sign-in failed"),
114
116
  h(Text, { color: "gray" }, ` ${error}`),
115
117
  h(Text, { color: "gray", dimColor: true }, ""),
116
- h(Text, { color: "gray", dimColor: true }, " press q to quit"),
118
+ h(Text, { color: "gray", dimColor: true }, " g retries · tabs 1-2 work with no account (press 1) · q quits"),
117
119
  );
118
120
  }
119
121
  // polling
@@ -379,7 +379,7 @@ export function LocalView({ client, me, dir, ui, width = 78, height = 14, active
379
379
  { color: C.FG_DIM },
380
380
  search.query
381
381
  ? ` No matches for "${search.query}" — try a broader term, or esc to clear.`
382
- : " No AI model calls here yet — this folder looks clean.",
382
+ : " No AI model calls in this folder. Run mm inside a repo that calls AI models, or press 5 to track one by name.",
383
383
  )
384
384
  : null,
385
385
  ...rowNodes,