@mangomagic/cli 0.1.0 → 0.1.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
@@ -14,7 +14,7 @@ at `~/.mangomagic/credentials.json` (mode 0600) so the next runs skip auth.
14
14
 
15
15
  | Command | What it does |
16
16
  | --- | --- |
17
- | `mangomagic login` | Browser-based device-code sign-in + splash. |
17
+ | `mangomagic login` | Browser-based device-code sign-in + splash. Add `--no-open` to print the URL without opening a browser. |
18
18
  | `mangomagic logout` | Forget the cached token. |
19
19
  | `mangomagic whoami` | Show the cached identity. |
20
20
  | `mangomagic splash` | Replay the splash animation. `--static`, `--loop` supported. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mangomagic/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MangoMagic CLI — sign in, manage episodes, and expose MangoMagic to MCP clients (Claude Desktop, Cursor).",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.mjs CHANGED
@@ -11,7 +11,7 @@ function help() {
11
11
  process.stdout.write(`
12
12
  ${BOLD}mangomagic${RESET} ${DIM}— sign into MangoMagic and bring your account into your terminal.${RESET}
13
13
 
14
- ${GOLD}mangomagic login${RESET} Authorize this terminal (opens your browser).
14
+ ${GOLD}mangomagic login${RESET} Authorize this terminal (opens your browser; add --no-open to print only).
15
15
  ${GOLD}mangomagic logout${RESET} Forget the token cached on this machine.
16
16
  ${GOLD}mangomagic whoami${RESET} Show the cached identity.
17
17
  ${GOLD}mangomagic splash${RESET} Play the MangoMagic splash animation.
@@ -23,7 +23,7 @@ Token cache: ${credentialsPath()}
23
23
  `);
24
24
  }
25
25
 
26
- async function login() {
26
+ async function login({ openInBrowser = true } = {}) {
27
27
  if (loadToken()) {
28
28
  process.stdout.write(`${DIM}You're already signed in. Run \`mangomagic logout\` first to switch accounts.${RESET}\n`);
29
29
  await playSplash({ greetingLine: "Welcome back to MangoMagic." });
@@ -31,6 +31,7 @@ async function login() {
31
31
  }
32
32
 
33
33
  await deviceLogin({
34
+ openInBrowser,
34
35
  onCode: (start) => {
35
36
  process.stdout.write(`
36
37
  ${BOLD}Sign in to MangoMagic${RESET}
@@ -81,7 +82,7 @@ function mcpConfig() {
81
82
  export async function run(argv) {
82
83
  const cmd = argv[0] ?? (loadToken() ? "splash" : "login");
83
84
  switch (cmd) {
84
- case "login": return login();
85
+ case "login": return login({ openInBrowser: !argv.includes("--no-open") && process.env.MANGOMAGIC_CLI_NO_OPEN !== "1" });
85
86
  case "logout": return logout();
86
87
  case "whoami": return whoami();
87
88
  case "splash": return playSplash({ mode: argv.includes("--loop") ? "loop" : argv.includes("--static") ? "static" : "anim" });