codemax-pro 1.2.0 → 1.3.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.
Files changed (4) hide show
  1. package/README.md +70 -40
  2. package/index.js +277 -481
  3. package/lib.js +447 -0
  4. package/package.json +3 -2
package/README.md CHANGED
@@ -1,43 +1,79 @@
1
1
  # ⚡ codemax-pro
2
2
 
3
- The official one-command setup tool for **CodeMax** (`api.codemax.pro`).
4
-
5
- Configures **Claude Code CLI**, the **VS Code extension**, and the **Claude Desktop app** in a few seconds.
6
-
7
- ## 🚀 Quick start
3
+ Setup for **CodeMax** (`api.codemax.pro`) — configures **Claude Code CLI**, the **VS Code
4
+ extension**, and the **Claude Desktop app**.
8
5
 
9
6
  ```bash
10
7
  npx codemax-pro
11
8
  ```
12
9
 
13
- Or pass your API key directly:
10
+ Or pass the key directly:
14
11
 
15
12
  ```bash
16
13
  npx codemax-pro sk-cp-your-key-here
17
14
  ```
18
15
 
19
- Re-run it any time to update your key.
16
+ ---
17
+
18
+ ## Commands
19
+
20
+ | | |
21
+ | --- | --- |
22
+ | `codemax-pro [key]` | Configure everything |
23
+ | `codemax-pro doctor` | Report what is actually configured, and what is fighting it |
24
+ | `codemax-pro reset` | Remove what this tool set, and nothing else |
25
+
26
+ | Flag | |
27
+ | --- | --- |
28
+ | `--yes` | Never prompt |
29
+ | `--only cli` / `--only desktop` | Configure one surface only |
30
+
31
+ The key can also come from `CODEMAX_API_KEY`.
20
32
 
21
33
  ---
22
34
 
23
- ## 🛠️ What it configures
35
+ ## `doctor`
24
36
 
25
- 1. **Validates your API key** against `api.codemax.pro` before changing anything
26
- 2. **Claude Code CLI + VS Code extension** — `~/.claude/settings.json`
27
- 3. **Claude Desktop** — third-party inference, provider `gateway`
28
- 4. **Installs Claude Code CLI** if it is missing (`@anthropic-ai/claude-code`)
29
- 5. Clears stale settings left by older versions
37
+ Run this first when something isn't working. It only reads — it changes nothing.
38
+
39
+ ```
40
+ Claude Code CLI
41
+ ✓ endpoint https://api.codemax.pro
42
+ ✓ key sk-cp-a1b2…9f3c
43
+ ✓ default model settings present
44
+ ✓ claude CLI installed 2.1.81
45
+
46
+ Claude Desktop
47
+ ✓ policy gateway → https://api.codemax.pro
48
+ ✓ auth x-api-key
49
+ ✓ models 4 configured
50
+ ✓ fetch egress ["*"], preflight off
51
+
52
+ Conflicts
53
+ ✓ no environment variables competing with the settings file
54
+
55
+ Connection
56
+ ✓ endpoint reachable, key accepted 412ms
57
+ ```
58
+
59
+ It exists because the failures here are quiet ones. Each of these looks identical to "the setup
60
+ didn't work", and none of them produces an error:
61
+
62
+ - an environment variable that outranks the settings file
63
+ - a machine-wide policy that outranks the per-user one
64
+ - an app still running with the configuration it read at launch
65
+ - a key that was rotated
30
66
 
31
67
  ---
32
68
 
33
- ## 🖥️ About the Claude Desktop app
69
+ ## Claude Desktop
34
70
 
35
- The desktop app is not the CLI. It does not read `~/.claude/settings.json`, and setting
36
- `ANTHROPIC_BASE_URL` as an environment variable has no effect on it — it is its own application and
37
- talks to whichever inference endpoint it is configured with.
71
+ The desktop app is not the CLI. It doesn't read `~/.claude/settings.json`, and setting
72
+ `ANTHROPIC_BASE_URL` in the environment does nothing to it — it's a separate application that talks
73
+ to whichever inference endpoint it's configured with.
38
74
 
39
- So this tool uses Anthropic's supported **third-party inference** mode, with the provider set to
40
- `gateway` and pointed at `api.codemax.pro`. It writes to both places the app looks:
75
+ So this uses Anthropic's supported **third-party inference** mode, with the provider set to
76
+ `gateway`. It writes to both places the app looks:
41
77
 
42
78
  | Platform | Written to |
43
79
  | --- | --- |
@@ -45,19 +81,20 @@ So this tool uses Anthropic's supported **third-party inference** mode, with the
45
81
  | macOS | `~/Library/Application Support/Claude-3p/configLibrary/` |
46
82
  | Linux | `~/.config/Claude-3p/configLibrary/` |
47
83
 
48
- Alongside the endpoint and key it sets the model list, the credential header, the sandbox egress
49
- allowlist (so tools that fetch from the network keep working), and turns off the WebFetch domain
50
- preflight — without that last one the app checks every fetched domain against a host this setup
51
- never otherwise contacts, which fails on a restricted network.
84
+ Along with the endpoint and key it sets the model list, the credential header, the sandbox egress
85
+ allowlist, and turns off the fetch-domain preflight.
52
86
 
53
87
  > ### ⚠️ Quit the desktop app fully, then reopen it
54
- > Its configuration is read **once, at launch**. Closing the window leaves the process running, so
55
- > a reopened window keeps the old settings and it looks like setup did not work. Quit from the
56
- > system tray (Windows) or the menu bar (macOS) first.
88
+ > It reads its configuration **once, at launch**. Closing the window leaves the process running, so
89
+ > a reopened window keeps the old settings — and it looks exactly like setup failed. Quit from the
90
+ > system tray (Windows) or menu bar (macOS).
91
+
92
+ **Web search** needs no setup — it is handled at the endpoint. **Web fetch** works on any host by
93
+ default; an organisation that wants the sandbox restricted should set its own allowlist through MDM.
57
94
 
58
95
  ---
59
96
 
60
- ## 🌐 Models
97
+ ## Models
61
98
 
62
99
  | Model | Best for |
63
100
  | --- | --- |
@@ -66,23 +103,16 @@ never otherwise contacts, which fails on a restricted network.
66
103
  | `claude-sonnet-5` | Fast, capable general-purpose work |
67
104
  | `claude-haiku-4-5` | Quick turnarounds and background tasks |
68
105
 
69
- Legacy model names (`claude-opus-4-8`, `claude-sonnet-4-6`, `claude-3-5-sonnet` and friends) are
70
- accepted too and map onto the current lineup.
106
+ Legacy names (`claude-opus-4-8`, `claude-sonnet-4-6`, `claude-3-5-sonnet` and others) are accepted
107
+ and map onto the current lineup.
71
108
 
72
109
  ---
73
110
 
74
- ## 🩹 Troubleshooting
75
-
76
- **The desktop model picker is empty.** The app was not restarted, or a machine-wide policy is
77
- overriding your user settings — on Windows, a policy under `HKLM\SOFTWARE\Policies\Claude` makes the
78
- app ignore the per-user one entirely. The setup tool warns when it finds one.
79
-
80
- **Requests fail with 401 in the desktop app.** Re-run `npx codemax-pro` with your key; the stored
81
- credential may be from a rotated key.
111
+ ## Safety
82
112
 
83
- **The CLI works but the desktop app does not.** They read completely different configuration. Check
84
- the desktop app under **Help → Troubleshooting → Copy Managed Configuration Report**, which lists
85
- which keys were detected and where they were read from, with secrets redacted.
113
+ - Existing settings are backed up beside the original as `*.codemax-backup` before being changed.
114
+ - Files are written atomically — an interrupted run cannot leave a half-written settings file.
115
+ - `reset` removes only the keys this tool set; anything else in those files is left alone.
86
116
 
87
117
  ---
88
118