claude-multiacc 1.0.8 → 1.0.10
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 +9 -6
- package/install.sh +4 -5
- package/package.json +1 -1
- package/tests/run-tests.sh +19 -12
package/README.md
CHANGED
|
@@ -217,8 +217,9 @@ claude-multiacc list | status | add <email> | ... # passthrough to claude-acco
|
|
|
217
217
|
|
|
218
218
|
**Automatic updates:** a globally-installed package re-runs `install.sh` from its own
|
|
219
219
|
postinstall, so `npm i -g claude-multiacc@latest` fully updates the shim, CLI, and jobs.
|
|
220
|
-
A
|
|
221
|
-
the latest
|
|
220
|
+
A daily job (launchd on macOS, cron on Linux, 04:07) runs `claude-accounts self-update`
|
|
221
|
+
to pull the latest release on its own — `npm i -g @latest` for npm installs, `git pull +
|
|
222
|
+
reinstall` for git checkouts; set `CLAUDE_MULTIACC_AUTOUPDATE=0` before install to
|
|
222
223
|
opt out. `update-notifier` also prints a one-line nudge when a newer version is on npm.
|
|
223
224
|
(Note: newer npm versions gate install scripts; if postinstall is blocked, just run
|
|
224
225
|
`claude-multiacc install` once.)
|
|
@@ -243,12 +244,14 @@ What install does (all reversible, nothing else):
|
|
|
243
244
|
|
|
244
245
|
- **macOS:** marked PATH block at the END of `~/.zshenv`, `~/.zprofile`, `~/.zshrc`
|
|
245
246
|
(+ bash rc files if present) — end-of-file placement matters because those files
|
|
246
|
-
re-prepend `~/.local/bin`; launchd agents `com.claude-multiacc.limits`
|
|
247
|
-
`.
|
|
247
|
+
re-prepend `~/.local/bin`; launchd agents `com.claude-multiacc.limits` +
|
|
248
|
+
`.codex-limits` (60s), `.health` + `.codex-health` (weekly Mon morning), and
|
|
249
|
+
`.update` (daily 04:07). Warns if this Mac stores credentials in the Keychain
|
|
248
250
|
(file-based credentials are required for per-dir logins).
|
|
249
251
|
- **Linux (root):** PATH block in `~/.bashrc` + `/etc/profile.d/claude-multiacc.sh`,
|
|
250
|
-
shim
|
|
251
|
-
default PATH too; the original
|
|
252
|
+
shim symlinks at `/usr/local/bin/claude` and `/usr/local/bin/codex` (shadow via
|
|
253
|
+
PATH order — on the systemd default PATH too; the original binaries are untouched),
|
|
254
|
+
cron entries for limits/health (both providers) + the daily auto-update.
|
|
252
255
|
- Both: `~/.claude-accounts/` skeleton + `accounts.json` manifest.
|
|
253
256
|
|
|
254
257
|
## Accounts
|
package/install.sh
CHANGED
|
@@ -108,7 +108,7 @@ EOF
|
|
|
108
108
|
<key>StandardErrorPath</key><string>/dev/null</string>
|
|
109
109
|
</dict></plist>
|
|
110
110
|
EOF
|
|
111
|
-
#
|
|
111
|
+
# Daily auto-update (04:07). No-op unless this is an npm or git install.
|
|
112
112
|
cat > "$PLIST_UPDATE" <<EOF
|
|
113
113
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
114
114
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
@@ -120,7 +120,6 @@ EOF
|
|
|
120
120
|
<string>--quiet</string>
|
|
121
121
|
</array>
|
|
122
122
|
<key>StartCalendarInterval</key><dict>
|
|
123
|
-
<key>Weekday</key><integer>0</integer>
|
|
124
123
|
<key>Hour</key><integer>4</integer>
|
|
125
124
|
<key>Minute</key><integer>7</integer>
|
|
126
125
|
</dict>
|
|
@@ -174,7 +173,7 @@ EOF
|
|
|
174
173
|
launchctl load -w "$PLIST_CODEX_LIMITS" 2>/dev/null || true
|
|
175
174
|
launchctl load -w "$PLIST_CODEX_HEALTH" 2>/dev/null || true
|
|
176
175
|
[ "${CLAUDE_MULTIACC_AUTOUPDATE:-1}" = "1" ] && launchctl load -w "$PLIST_UPDATE" 2>/dev/null || true
|
|
177
|
-
echo " launchd: limits refresh every 60s (claude + codex) + weekly health checks +
|
|
176
|
+
echo " launchd: limits refresh every 60s (claude + codex) + weekly health checks + daily auto-update"
|
|
178
177
|
}
|
|
179
178
|
|
|
180
179
|
mac_schedule_remove() {
|
|
@@ -196,11 +195,11 @@ linux_schedule_install() {
|
|
|
196
195
|
echo "17 9 * * 1 $REPO_DIR/bin/claude-accounts health >/dev/null 2>&1 $CRON_TAG"
|
|
197
196
|
echo "37 9 * * 1 $REPO_DIR/bin/codex-accounts health >/dev/null 2>&1 $CRON_TAG"
|
|
198
197
|
[ "${CLAUDE_MULTIACC_AUTOUPDATE:-1}" = "1" ] && \
|
|
199
|
-
echo "7 4 * *
|
|
198
|
+
echo "7 4 * * * $REPO_DIR/bin/claude-accounts self-update --quiet >/dev/null 2>&1 $CRON_TAG"
|
|
200
199
|
} >> "$tmp"
|
|
201
200
|
crontab "$tmp"
|
|
202
201
|
rm -f "$tmp"
|
|
203
|
-
echo " cron: limits refresh every 60s (claude + codex) + weekly health checks +
|
|
202
|
+
echo " cron: limits refresh every 60s (claude + codex) + weekly health checks + daily auto-update"
|
|
204
203
|
}
|
|
205
204
|
|
|
206
205
|
linux_schedule_remove() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-multiacc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Multi-account addon for Claude Code and OpenAI Codex CLI: every claude / claude -p and every codex / codex exec runs under a randomly-picked subscription account with the most usage headroom. Mirrors to a deploy server. No API keys.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/tests/run-tests.sh
CHANGED
|
@@ -1888,18 +1888,25 @@ rm -f "$CX"/acct-*/limits.json
|
|
|
1888
1888
|
|
|
1889
1889
|
# refresh is not attempted at all when the rotated credential could not be persisted
|
|
1890
1890
|
# (the grant rotates the refresh token — consuming it and then failing to write
|
|
1891
|
-
# auth.json would strand the account; codex-review finding)
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1891
|
+
# auth.json would strand the account; codex-review finding).
|
|
1892
|
+
# Root ignores directory permission bits, so the unwritable-dir setup only works
|
|
1893
|
+
# as a non-root user (the server suite runs as root — skip there).
|
|
1894
|
+
if [ "$(id -u)" = "0" ]; then
|
|
1895
|
+
t_ok "codex: refresh persistence preflight test skipped (root ignores directory permissions)"
|
|
1896
|
+
t_ok "codex: refresh persistence preflight test skipped (root ignores directory permissions) [2]"
|
|
1897
|
+
else
|
|
1898
|
+
mk_cx_auth "$CX/acct-01/auth.json" a@cx 1000
|
|
1899
|
+
rm -f "$CX/acct-01/limits.json" "$CX/acct-01/.oauth-refresh.json"
|
|
1900
|
+
chmod 500 "$CX/acct-01"
|
|
1901
|
+
out="$(CODEX_MULTIACC_TOKEN_URL="file://$WORK/cx-token-ok.json" CODEX_MULTIACC_USAGE_URL="file://$WORK/cx-usage-low.json" codex-accounts limits --force 2>&1)"
|
|
1902
|
+
chmod 700 "$CX/acct-01"
|
|
1903
|
+
check "codex: unpersistable credential skips the refresh grant" "refresh not attempted" "$out"
|
|
1904
|
+
grep -q "rt-rotated-new" "$CX/acct-01/auth.json" \
|
|
1905
|
+
&& t_fail "codex refresh preflight" "the grant was consumed despite an unwritable dir" \
|
|
1906
|
+
|| t_ok "codex: refresh grant not consumed when persistence would fail"
|
|
1907
|
+
mk_cx_auth "$CX/acct-01/auth.json" a@cx "$FUTURE_EXP"
|
|
1908
|
+
rm -f "$CX/acct-01/.oauth-refresh.json"
|
|
1909
|
+
fi
|
|
1903
1910
|
|
|
1904
1911
|
# two parallel imports get distinct ids and both land in the manifest (lock coverage;
|
|
1905
1912
|
# codex-review finding)
|