multi-claude-cli 0.15.0__tar.gz → 0.16.0__tar.gz
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.
- {multi_claude_cli-0.15.0/src/multi_claude_cli.egg-info → multi_claude_cli-0.16.0}/PKG-INFO +20 -7
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/README.md +19 -6
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/__init__.py +1 -1
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/cli.py +7 -3
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/doctor.py +7 -1
- multi_claude_cli-0.16.0/src/multi_claude/netcheck.py +642 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/plan.py +2 -1
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0/src/multi_claude_cli.egg-info}/PKG-INFO +20 -7
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude_cli.egg-info/SOURCES.txt +2 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_help_examples.py +4 -1
- multi_claude_cli-0.16.0/tests/test_netcheck.py +486 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/LICENSE +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/pyproject.toml +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/setup.cfg +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/__main__.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/_entry.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/accounts.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/actions.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/artifacts.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/bundle.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/completion.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/config.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/env.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/fsutil.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/history.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/hook.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/identity.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/launcher.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/lock.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/migrate.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/platform.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/refresh.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/restore.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/routes.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/sessions.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/shared.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/shellpath.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/statusline.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude/usage.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude_cli.egg-info/dependency_links.txt +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude_cli.egg-info/entry_points.txt +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/src/multi_claude_cli.egg-info/top_level.txt +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_accounts.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_artifacts.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_bundle.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_completion.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_config.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_doctor.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_everyday.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_fsutil.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_handoff.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_help.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_history.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_identity.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_install.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_mcp.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_migrate.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_onboarding.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_packaging.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_plan.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_platform.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_refresh.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_rename.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_renewal.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_routes.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_sessions.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_set.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_shared_exclude.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_statusline.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_usability.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_usage.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_vscode.py +0 -0
- {multi_claude_cli-0.15.0 → multi_claude_cli-0.16.0}/tests/test_windows.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multi-claude-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Run several Claude Code accounts side by side: separate CLAUDE_CONFIG_DIR directories, launchers, proxies, environment variables and arguments.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/jakoes-wu/multi-claude
|
|
@@ -39,7 +39,7 @@ Dynamic: license-file
|
|
|
39
39
|
|
|
40
40
|
Use several [Claude Code](https://code.claude.com/docs) accounts on one machine, at the same time. Each account keeps its own login, settings and history and, if you like, its own proxy. No more logging out and in again.
|
|
41
41
|
|
|
42
|
-
It never copies or exports your login and never edits your shell startup files. Only `list` reads an account's access token and goes online, to ask Anthropic for the current plan (renewing the token first if it has expired); `list --offline` skips all of that.
|
|
42
|
+
It never copies or exports your login and never edits your shell startup files. Only `list` reads an account's access token and goes online, to ask Anthropic for the current plan (renewing the token first if it has expired); `list --offline` skips all of that. `doctor --network` also goes online, but only when you ask for it and without any login.
|
|
43
43
|
|
|
44
44
|
```sh
|
|
45
45
|
claude-work # Claude Code with your work account
|
|
@@ -67,7 +67,7 @@ The launchers are plain shell scripts. They keep working even if you uninstall m
|
|
|
67
67
|
## Features
|
|
68
68
|
|
|
69
69
|
- **Your login stays yours** — logins are never copied or exported. One command touches them: `list` takes each account's access token (from the keychain, or `.credentials.json` on Linux) to ask Anthropic which plan the account is on, and when that token has expired it renews it the way Claude Code does and saves the new one in the same place. Tokens stay in memory and go only to Anthropic (`api.anthropic.com`, and `platform.claude.com` for a renewal), through that account's proxy. `list --no-refresh` never writes, `list --offline` reads nothing. Every other command only checks whether a login exists. `migrate-default` and `restore` move whole account directories, and on Linux the credentials file moves with its directory without being opened.
|
|
70
|
-
- **Only `list`
|
|
70
|
+
- **Only `list` and `doctor --network` go online** — the plan lookup of `list` (one request per account, plus one to renew an expired token) and the connection check of `doctor --network` (one `HEAD /` without credentials to `api.anthropic.com` and `platform.claude.com` per proxy, repeated once if it fails) are the only connections multi-claude makes: no telemetry, no usage reporting, no update checks. `list --offline` makes none. Only the installer, pipx or Homebrew download the package.
|
|
71
71
|
- **Leaves your shell alone** — when `PATH` needs a change, it prints the line to add instead of editing `~/.zshrc` or `~/.bashrc`.
|
|
72
72
|
- **Changes only what you ask** — it writes its own configuration and state, the launchers, account directories (including the VS Code data that `code` keeps in `<root>/.apps`) and shared links. A Claude Code settings file is changed only by `statusline install` (the file you name, with a backup) and `add --config-from` (the new account's `settings.json`).
|
|
73
73
|
- **Migrate the default account** — move your existing `~/.claude` into the account root without logging out. `claude` keeps working exactly as before.
|
|
@@ -80,7 +80,7 @@ The launchers are plain shell scripts. They keep working even if you uninstall m
|
|
|
80
80
|
|
|
81
81
|
## Prerequisites
|
|
82
82
|
|
|
83
|
-
**Servers.** None. multi-claude runs only on your own computer; its only network requests are the plan lookups and token renewals of `list`, sent to Anthropic.
|
|
83
|
+
**Servers.** None. multi-claude runs only on your own computer; its only network requests are the plan lookups and token renewals of `list` and the connection check of `doctor --network`, all sent to Anthropic.
|
|
84
84
|
|
|
85
85
|
**Your computer.**
|
|
86
86
|
|
|
@@ -143,8 +143,19 @@ Run `./install.sh --help` for all options.
|
|
|
143
143
|
|
|
144
144
|
### Windows
|
|
145
145
|
|
|
146
|
-
Windows support is new. Install with
|
|
147
|
-
|
|
146
|
+
Windows support is new. Install it with pipx; the installer script is for macOS and Linux only. If `pipx` is not
|
|
147
|
+
installed yet, run these in cmd or PowerShell (with Python 3.8 or later; use `python` instead of `py` if you do not
|
|
148
|
+
have the Python launcher):
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
py -m pip install --user pipx
|
|
152
|
+
py -m pipx ensurepath
|
|
153
|
+
py -m pipx install multi-claude-cli
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Then open a new terminal so the `PATH` change takes effect, and check with `multi-claude --version`. With pipx
|
|
157
|
+
already on `PATH`, `pipx install multi-claude-cli` is enough. Everything above works the same way, with these
|
|
158
|
+
differences:
|
|
148
159
|
|
|
149
160
|
- Launchers are `claude-<name>.cmd` and `claude-auto.cmd` in `%USERPROFILE%\.local\bin` (the directory
|
|
150
161
|
`pipx ensurepath` adds to `PATH`), so they run from PowerShell and cmd alike. They read the proxy, variables
|
|
@@ -495,6 +506,8 @@ Notes:
|
|
|
495
506
|
|
|
496
507
|
`multi-claude doctor` checks, without changing anything: the configuration and any unfinished migration, whether `claude` and the launcher directory are on `PATH`, whether each launcher is up to date and not hidden by another file of the same name, whether each account directory exists and is private (`0700`), the default account's link, broken shared links, whether a login exists, and variables such as `ANTHROPIC_API_KEY` that override the accounts' logins. Every problem comes with the command that fixes it. It exits with 1 when there is an error; `--json` prints the results for scripts.
|
|
497
508
|
|
|
509
|
+
`multi-claude doctor --network` also checks that each account can reach `api.anthropic.com` and `platform.claude.com` through the proxy it starts with (including the `env` of its `settings.json`). It connects step by step and says where it stopped: the proxy is not running, the proxy cannot get through, a name does not resolve, the secure connection was cut, the certificate could not be verified, a timeout, or `NO_PROXY` sends the account around its proxy. SOCKS and malformed proxy URLs, which Claude Code cannot use, are reported without connecting; https proxies are not checked. It sends one `HEAD /` per address and proxy (a second one if the first fails), with no login or token; addresses covered by `NO_PROXY` are checked directly.
|
|
510
|
+
|
|
498
511
|
```sh
|
|
499
512
|
multi-claude completion bash > ~/.local/share/bash-completion/completions/multi-claude
|
|
500
513
|
multi-claude completion zsh > "${fpath[1]}/_multi-claude" # or any directory on your fpath
|
|
@@ -598,7 +611,7 @@ Every command's `--help` ends with examples you can copy, covering its options,
|
|
|
598
611
|
| `multi-claude list [--verbose \| --json \| --names] [--no-refresh] [--offline]` | Show accounts, launchers, login state and the plan and billing channel looked up from Anthropic. `--json` adds usage and is meant for scripts; `--names` prints only the names; `--no-refresh` does not renew expired access tokens (never writes to a login); `--offline` skips the plan lookup (no token read, no network). A `RENEWS` column (and a `renews` key in `--json`) shows the renewal dates you recorded. |
|
|
599
612
|
| `multi-claude usage [NAME] [--json]` | Show the last known 5-hour and 7-day usage of each account. |
|
|
600
613
|
| `multi-claude usage --history [NAME] [--days N] [--by day\|model] [--json]` | Token usage per day or model, counted from the session files on this machine (default: 7 days). |
|
|
601
|
-
| `multi-claude doctor [--json] [--verbose]` | Check the configuration, launchers, account directories, shared links, logins and environment. |
|
|
614
|
+
| `multi-claude doctor [--json] [--verbose] [--network]` | Check the configuration, launchers, account directories, shared links, logins and environment; `--network` also checks each account's connection to Anthropic. |
|
|
602
615
|
| `multi-claude route DIR NAME`, `route DIR --remove`, `route --default NAME`, `route --no-default` | Choose an account by directory for `claude-auto`. |
|
|
603
616
|
| `multi-claude which [DIR]` | Show which account `claude-auto` would use in `DIR` (default: the current directory). |
|
|
604
617
|
| `multi-claude rename OLD NEW` | Rename an account and its launcher. The directory and the login stay. |
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
Use several [Claude Code](https://code.claude.com/docs) accounts on one machine, at the same time. Each account keeps its own login, settings and history and, if you like, its own proxy. No more logging out and in again.
|
|
13
13
|
|
|
14
|
-
It never copies or exports your login and never edits your shell startup files. Only `list` reads an account's access token and goes online, to ask Anthropic for the current plan (renewing the token first if it has expired); `list --offline` skips all of that.
|
|
14
|
+
It never copies or exports your login and never edits your shell startup files. Only `list` reads an account's access token and goes online, to ask Anthropic for the current plan (renewing the token first if it has expired); `list --offline` skips all of that. `doctor --network` also goes online, but only when you ask for it and without any login.
|
|
15
15
|
|
|
16
16
|
```sh
|
|
17
17
|
claude-work # Claude Code with your work account
|
|
@@ -39,7 +39,7 @@ The launchers are plain shell scripts. They keep working even if you uninstall m
|
|
|
39
39
|
## Features
|
|
40
40
|
|
|
41
41
|
- **Your login stays yours** — logins are never copied or exported. One command touches them: `list` takes each account's access token (from the keychain, or `.credentials.json` on Linux) to ask Anthropic which plan the account is on, and when that token has expired it renews it the way Claude Code does and saves the new one in the same place. Tokens stay in memory and go only to Anthropic (`api.anthropic.com`, and `platform.claude.com` for a renewal), through that account's proxy. `list --no-refresh` never writes, `list --offline` reads nothing. Every other command only checks whether a login exists. `migrate-default` and `restore` move whole account directories, and on Linux the credentials file moves with its directory without being opened.
|
|
42
|
-
- **Only `list`
|
|
42
|
+
- **Only `list` and `doctor --network` go online** — the plan lookup of `list` (one request per account, plus one to renew an expired token) and the connection check of `doctor --network` (one `HEAD /` without credentials to `api.anthropic.com` and `platform.claude.com` per proxy, repeated once if it fails) are the only connections multi-claude makes: no telemetry, no usage reporting, no update checks. `list --offline` makes none. Only the installer, pipx or Homebrew download the package.
|
|
43
43
|
- **Leaves your shell alone** — when `PATH` needs a change, it prints the line to add instead of editing `~/.zshrc` or `~/.bashrc`.
|
|
44
44
|
- **Changes only what you ask** — it writes its own configuration and state, the launchers, account directories (including the VS Code data that `code` keeps in `<root>/.apps`) and shared links. A Claude Code settings file is changed only by `statusline install` (the file you name, with a backup) and `add --config-from` (the new account's `settings.json`).
|
|
45
45
|
- **Migrate the default account** — move your existing `~/.claude` into the account root without logging out. `claude` keeps working exactly as before.
|
|
@@ -52,7 +52,7 @@ The launchers are plain shell scripts. They keep working even if you uninstall m
|
|
|
52
52
|
|
|
53
53
|
## Prerequisites
|
|
54
54
|
|
|
55
|
-
**Servers.** None. multi-claude runs only on your own computer; its only network requests are the plan lookups and token renewals of `list`, sent to Anthropic.
|
|
55
|
+
**Servers.** None. multi-claude runs only on your own computer; its only network requests are the plan lookups and token renewals of `list` and the connection check of `doctor --network`, all sent to Anthropic.
|
|
56
56
|
|
|
57
57
|
**Your computer.**
|
|
58
58
|
|
|
@@ -115,8 +115,19 @@ Run `./install.sh --help` for all options.
|
|
|
115
115
|
|
|
116
116
|
### Windows
|
|
117
117
|
|
|
118
|
-
Windows support is new. Install with
|
|
119
|
-
|
|
118
|
+
Windows support is new. Install it with pipx; the installer script is for macOS and Linux only. If `pipx` is not
|
|
119
|
+
installed yet, run these in cmd or PowerShell (with Python 3.8 or later; use `python` instead of `py` if you do not
|
|
120
|
+
have the Python launcher):
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
py -m pip install --user pipx
|
|
124
|
+
py -m pipx ensurepath
|
|
125
|
+
py -m pipx install multi-claude-cli
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Then open a new terminal so the `PATH` change takes effect, and check with `multi-claude --version`. With pipx
|
|
129
|
+
already on `PATH`, `pipx install multi-claude-cli` is enough. Everything above works the same way, with these
|
|
130
|
+
differences:
|
|
120
131
|
|
|
121
132
|
- Launchers are `claude-<name>.cmd` and `claude-auto.cmd` in `%USERPROFILE%\.local\bin` (the directory
|
|
122
133
|
`pipx ensurepath` adds to `PATH`), so they run from PowerShell and cmd alike. They read the proxy, variables
|
|
@@ -467,6 +478,8 @@ Notes:
|
|
|
467
478
|
|
|
468
479
|
`multi-claude doctor` checks, without changing anything: the configuration and any unfinished migration, whether `claude` and the launcher directory are on `PATH`, whether each launcher is up to date and not hidden by another file of the same name, whether each account directory exists and is private (`0700`), the default account's link, broken shared links, whether a login exists, and variables such as `ANTHROPIC_API_KEY` that override the accounts' logins. Every problem comes with the command that fixes it. It exits with 1 when there is an error; `--json` prints the results for scripts.
|
|
469
480
|
|
|
481
|
+
`multi-claude doctor --network` also checks that each account can reach `api.anthropic.com` and `platform.claude.com` through the proxy it starts with (including the `env` of its `settings.json`). It connects step by step and says where it stopped: the proxy is not running, the proxy cannot get through, a name does not resolve, the secure connection was cut, the certificate could not be verified, a timeout, or `NO_PROXY` sends the account around its proxy. SOCKS and malformed proxy URLs, which Claude Code cannot use, are reported without connecting; https proxies are not checked. It sends one `HEAD /` per address and proxy (a second one if the first fails), with no login or token; addresses covered by `NO_PROXY` are checked directly.
|
|
482
|
+
|
|
470
483
|
```sh
|
|
471
484
|
multi-claude completion bash > ~/.local/share/bash-completion/completions/multi-claude
|
|
472
485
|
multi-claude completion zsh > "${fpath[1]}/_multi-claude" # or any directory on your fpath
|
|
@@ -570,7 +583,7 @@ Every command's `--help` ends with examples you can copy, covering its options,
|
|
|
570
583
|
| `multi-claude list [--verbose \| --json \| --names] [--no-refresh] [--offline]` | Show accounts, launchers, login state and the plan and billing channel looked up from Anthropic. `--json` adds usage and is meant for scripts; `--names` prints only the names; `--no-refresh` does not renew expired access tokens (never writes to a login); `--offline` skips the plan lookup (no token read, no network). A `RENEWS` column (and a `renews` key in `--json`) shows the renewal dates you recorded. |
|
|
571
584
|
| `multi-claude usage [NAME] [--json]` | Show the last known 5-hour and 7-day usage of each account. |
|
|
572
585
|
| `multi-claude usage --history [NAME] [--days N] [--by day\|model] [--json]` | Token usage per day or model, counted from the session files on this machine (default: 7 days). |
|
|
573
|
-
| `multi-claude doctor [--json] [--verbose]` | Check the configuration, launchers, account directories, shared links, logins and environment. |
|
|
586
|
+
| `multi-claude doctor [--json] [--verbose] [--network]` | Check the configuration, launchers, account directories, shared links, logins and environment; `--network` also checks each account's connection to Anthropic. |
|
|
574
587
|
| `multi-claude route DIR NAME`, `route DIR --remove`, `route --default NAME`, `route --no-default` | Choose an account by directory for `claude-auto`. |
|
|
575
588
|
| `multi-claude which [DIR]` | Show which account `claude-auto` would use in `DIR` (default: the current directory). |
|
|
576
589
|
| `multi-claude rename OLD NEW` | Rename an account and its launcher. The directory and the login stay. |
|
|
@@ -217,6 +217,7 @@ _SUBCOMMAND_EXAMPLES = {
|
|
|
217
217
|
("multi-claude doctor", "check the setup and suggest fixes"),
|
|
218
218
|
("multi-claude doctor --verbose", "also list the checks that passed"),
|
|
219
219
|
("multi-claude doctor --json", "for scripts"),
|
|
220
|
+
("multi-claude doctor --network", "also check that each account can reach Anthropic (uses the network)"),
|
|
220
221
|
],
|
|
221
222
|
"route": [
|
|
222
223
|
("multi-claude route ~/work work", "claude-auto uses work under ~/work"),
|
|
@@ -397,6 +398,9 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
397
398
|
p_doctor = sub.add_parser("doctor", description="check the accounts, launchers and environment (read-only)")
|
|
398
399
|
p_doctor.add_argument("--json", action="store_true", help="print machine-readable JSON")
|
|
399
400
|
p_doctor.add_argument("--verbose", action="store_true", help="also list the checks that passed")
|
|
401
|
+
p_doctor.add_argument("--network", action="store_true",
|
|
402
|
+
help="also connect to api.anthropic.com and platform.claude.com through each account's "
|
|
403
|
+
"proxy (sends no credentials)")
|
|
400
404
|
|
|
401
405
|
p_route = sub.add_parser("route", description="choose an account by directory for claude-auto: route DIR NAME, "
|
|
402
406
|
"route DIR --remove, route --default NAME, route --no-default")
|
|
@@ -655,7 +659,7 @@ def main(argv: Optional[List[str]] = None) -> int:
|
|
|
655
659
|
print(completion.render(args.shell, build_parser()), end="")
|
|
656
660
|
return accounts.EXIT_OK
|
|
657
661
|
if args.command == "doctor":
|
|
658
|
-
return cmd_doctor(args.json, args.verbose)
|
|
662
|
+
return cmd_doctor(args.json, args.verbose, args.network)
|
|
659
663
|
|
|
660
664
|
try:
|
|
661
665
|
notice = migrate.pending_journal_notice()
|
|
@@ -2508,9 +2512,9 @@ def cmd_statusline(action: str, path: str, dry_run: bool) -> int:
|
|
|
2508
2512
|
return accounts.EXIT_OK
|
|
2509
2513
|
|
|
2510
2514
|
|
|
2511
|
-
def cmd_doctor(as_json: bool, verbose: bool) -> int:
|
|
2515
|
+
def cmd_doctor(as_json: bool, verbose: bool, network: bool = False) -> int:
|
|
2512
2516
|
try:
|
|
2513
|
-
checks = doctor.run_checks()
|
|
2517
|
+
checks = doctor.run_checks(network)
|
|
2514
2518
|
except OSError as exc:
|
|
2515
2519
|
# 意外的读写错误也记成一条检查结果,保证 --json 在任何情况下都输出合法 JSON。
|
|
2516
2520
|
checks = [doctor.Check("doctor", doctor.LEVEL_ERROR, "-", "{}: {}".format(type(exc).__name__, exc))]
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
所有检查都不修改任何东西、不读凭据:登录检查沿用 identity.probe 的存在性探测。
|
|
4
4
|
每条非 ok 结果的 message 里给出修复命令,由用户自己执行。
|
|
5
|
+
加 `--network` 时另由 netcheck.py 联网检查每个账号能否连上 api.anthropic.com 与 platform.claude.com
|
|
6
|
+
(每个地址一次不带凭据的 HEAD /,不读凭据);不加时不联网。
|
|
5
7
|
配置文件或迁移记录损坏时不抛异常,而是记成对应检查项的 error,其余不依赖配置的检查照常执行,
|
|
6
8
|
这样 `doctor --json` 在任何状态下都输出合法 JSON。
|
|
7
9
|
"""
|
|
@@ -29,7 +31,7 @@ class Check(NamedTuple):
|
|
|
29
31
|
message: str
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
def run_checks() -> List[Check]:
|
|
34
|
+
def run_checks(network: bool = False) -> List[Check]:
|
|
33
35
|
checks: List[Check] = []
|
|
34
36
|
checks.append(_check_journal())
|
|
35
37
|
config, config_check = _load()
|
|
@@ -42,6 +44,10 @@ def run_checks() -> List[Check]:
|
|
|
42
44
|
for account in config.accounts.values():
|
|
43
45
|
checks.extend(_check_account(config, account))
|
|
44
46
|
checks.extend(_check_routes(config))
|
|
47
|
+
if network:
|
|
48
|
+
# 只在 --network 时 import:netcheck 反向 import 本模块的 Check,放在顶部会循环导入。
|
|
49
|
+
from . import netcheck
|
|
50
|
+
checks.extend(netcheck.run(config))
|
|
45
51
|
return checks
|
|
46
52
|
|
|
47
53
|
|