@firedmosquito831/my-claude-code 6.52.0 → 6.55.0

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
@@ -4,9 +4,28 @@ Route Claude Code and other coding agents to any model provider through one
4
4
  local proxy, with a dashboard for routing, fallback chains, reasoning controls,
5
5
  credential rotation and request analytics.
6
6
 
7
- The server is a Python package. Install it globally for the short `mcc` command: `npm install -g @firedmosquito831/my-claude-code`. This npm package is a small launcher: it
8
- installs the server with the official, digest-verified install script when it
9
- is missing, then runs it.
7
+ The server is a Python package. This npm package is a thin wrapper over the
8
+ project's own digest-verified install script it does not reimplement it and
9
+ it does not vendor a second copy of the server.
10
+
11
+ ## Install everything (server, every command, desktop app)
12
+
13
+ ```sh
14
+ npm install -g @firedmosquito831/my-claude-code
15
+ ```
16
+
17
+ A global install runs the official installer with the desktop flag
18
+ (`install.ps1 -Desktop` on Windows, `install.sh --desktop` elsewhere). When it
19
+ finishes you have exactly what the one-line installer gives you: the server,
20
+ every `mcc-*` command on your PATH, and the desktop app — plus `my-claude-code`
21
+ and `mcc` as extra aliases from this package. If the installer fails, `npm
22
+ install -g` fails with it; nothing is left half-installed.
23
+
24
+ Skip that and take the launcher only with `MCC_NPM_SKIP_INSTALL=1 npm install -g
25
+ @firedmosquito831/my-claude-code`. A local install, an `npx` run, `CI` being set,
26
+ and `--ignore-scripts` all skip it too, each printing one line saying so.
27
+
28
+ ## Run without installing globally
10
29
 
11
30
  ```sh
12
31
  npx @firedmosquito831/my-claude-code # install if needed, then start the server
@@ -16,9 +35,21 @@ npx @firedmosquito831/my-claude-code claude # launch Claude Code through the
16
35
  npx @firedmosquito831/my-claude-code help # list every mcc-* command
17
36
  ```
18
37
 
38
+ `npx … --version` installs nothing: the launcher installs the server only when
39
+ you ask it to run something that needs one.
40
+
41
+ ## Uninstall
42
+
43
+ ```sh
44
+ mcc uninstall # removes the server, its commands and the config home
45
+ npm uninstall -g @firedmosquito831/my-claude-code # removes only this launcher
46
+ ```
47
+
48
+ Run `mcc uninstall` **first**: npm removes the launcher it installed and nothing
49
+ else, so uninstalling the package on its own leaves the Python server in place.
50
+
19
51
  Requirements: Node 18+, and on Windows PowerShell 5.1+ (the installer brings
20
- `uv` and Python itself). After the first install every `mcc-*` command is on
21
- your PATH directly; the launcher is only a convenience.
52
+ `uv` and Python itself).
22
53
 
23
54
  Docs, releases and the desktop installers for Windows, Linux and macOS:
24
55
  https://github.com/FiredMosquito831/my-claude-code
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // `npm install -g @firedmosquito831/my-claude-code` must leave the machine in
5
+ // the same state the one-line installer does -- the server, every `mcc-*`
6
+ // command, and the desktop app -- and not merely drop a launcher that installs
7
+ // on first use. That is what this hook is for, and it is deliberately the only
8
+ // place in this package that installs anything.
9
+ //
10
+ // It does NOT reimplement the installer. It runs the official, digest-verified
11
+ // script from the repository with the desktop flag the installer already has
12
+ // (`install.ps1 -Desktop`, `install.sh --desktop`), streams its output, and
13
+ // exits with its status. A failed install therefore fails `npm install -g`,
14
+ // which is the honest outcome: npm should not report success for a package
15
+ // whose whole job is to put a server on your PATH.
16
+ //
17
+ // Four situations must NOT install:
18
+ //
19
+ // * a local `npm install` or an `npx` run (`npm_config_global` is not
20
+ // "true"). `npx @firedmosquito831/my-claude-code --version` has to stay
21
+ // cheap and must never touch the machine; the launcher installs on demand;
22
+ // * `CI` is set -- a CI job that happens to depend on this package is not
23
+ // asking for a machine-wide Python install;
24
+ // * `MCC_NPM_SKIP_INSTALL=1`, the explicit opt-out for package managers,
25
+ // Docker builds and anyone who wants the launcher only;
26
+ // * `npm_config_ignore_scripts` -- npm normally suppresses the hook itself,
27
+ // but a wrapper that sets the config without honouring it exists.
28
+ //
29
+ // Every one of them prints a single line saying what happened and why, then
30
+ // exits 0. Silence here is indistinguishable from a broken hook.
31
+
32
+ const { spawnSync } = require("node:child_process");
33
+
34
+ const REPO_RAW =
35
+ "https://raw.githubusercontent.com/FiredMosquito831/my-claude-code/main/scripts";
36
+ const IS_WINDOWS = process.platform === "win32";
37
+
38
+ function note(message) {
39
+ console.log(`my-claude-code: ${message}`);
40
+ }
41
+
42
+ /** Why this run must not install, or null when it should. */
43
+ function skipReason(env) {
44
+ if (env.MCC_NPM_SKIP_INSTALL === "1") {
45
+ return "MCC_NPM_SKIP_INSTALL=1 is set, so the server was not installed. Run `mcc install` when you want it.";
46
+ }
47
+ if (env.npm_config_ignore_scripts === "true") {
48
+ return "install scripts are disabled (--ignore-scripts), so the server was not installed. Run `mcc install` when you want it.";
49
+ }
50
+ if (env.CI) {
51
+ return "CI is set, so the server was not installed. Run `mcc install` (or unset CI) if a CI job really needs it.";
52
+ }
53
+ if (env.npm_config_global !== "true") {
54
+ return "this is not a global install, so nothing was installed. `npx my-claude-code` installs the server on first use; `npm install -g @firedmosquito831/my-claude-code` installs it now.";
55
+ }
56
+ return null;
57
+ }
58
+
59
+ /** The installer command for this platform, with the desktop flag on. */
60
+ function installerCommand() {
61
+ if (IS_WINDOWS) {
62
+ // The scriptblock form, not `-File`: there is no file to point at when the
63
+ // script is fetched over the network. `& ([scriptblock]::Create(...))
64
+ // -Desktop` binds `-Desktop` to the script's own `param()` block, which a
65
+ // plain `irm ... | iex` cannot do.
66
+ return {
67
+ command: "powershell",
68
+ args: [
69
+ "-NoProfile",
70
+ "-ExecutionPolicy",
71
+ "Bypass",
72
+ "-Command",
73
+ `& ([scriptblock]::Create((irm "${REPO_RAW}/install.ps1"))) -Desktop`,
74
+ ],
75
+ };
76
+ }
77
+ return {
78
+ command: "sh",
79
+ args: ["-c", `curl -fsSL "${REPO_RAW}/install.sh" | sh -s -- --desktop`],
80
+ };
81
+ }
82
+
83
+ function main() {
84
+ const reason = skipReason(process.env);
85
+ if (reason !== null) {
86
+ note(reason);
87
+ return 0;
88
+ }
89
+
90
+ note(
91
+ "global install -- running the official installer with the desktop app (`" +
92
+ (IS_WINDOWS ? "install.ps1 -Desktop" : "install.sh --desktop") +
93
+ "`). Set MCC_NPM_SKIP_INSTALL=1 to skip this."
94
+ );
95
+
96
+ const { command, args } = installerCommand();
97
+ const result = spawnSync(command, args, { stdio: "inherit" });
98
+ if (result.error) {
99
+ console.error(
100
+ `my-claude-code: could not start the installer: ${result.error.message}`
101
+ );
102
+ return 1;
103
+ }
104
+ const status = result.status ?? 1;
105
+ if (status === 0) {
106
+ note(
107
+ "the server, every mcc-* command and the desktop app are installed. Open a new terminal so PATH picks them up."
108
+ );
109
+ } else {
110
+ console.error(
111
+ `my-claude-code: the installer exited ${status}. Nothing was left half-installed by this hook; rerun \`mcc install\` or install manually from https://github.com/FiredMosquito831/my-claude-code`
112
+ );
113
+ }
114
+ return status;
115
+ }
116
+
117
+ process.exit(main());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firedmosquito831/my-claude-code",
3
- "version": "6.52.0",
3
+ "version": "6.55.0",
4
4
  "description": "My Claude Code (MCC): route Claude Code and other coding agents to any model provider through one local proxy with a dashboard. This npm package installs and launches the Python server.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "author": "FiredMosquito831",
@@ -24,6 +24,9 @@
24
24
  "coding-agent",
25
25
  "mcc"
26
26
  ],
27
+ "scripts": {
28
+ "postinstall": "node bin/postinstall.js"
29
+ },
27
30
  "bin": {
28
31
  "my-claude-code": "bin/my-claude-code.js",
29
32
  "mcc": "bin/my-claude-code.js"