multi-codex 0.7.0__tar.gz → 0.8.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_codex-0.7.0 → multi_codex-0.8.0}/PKG-INFO +52 -16
- multi_codex-0.7.0/src/multi_codex.egg-info/PKG-INFO → multi_codex-0.8.0/README.md +43 -31
- {multi_codex-0.7.0 → multi_codex-0.8.0}/pyproject.toml +8 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/__init__.py +1 -1
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/cli.py +212 -25
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/completion.py +1 -1
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/config.py +2 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/doctor.py +2 -2
- multi_codex-0.8.0/src/multi_codex/shellpath.py +52 -0
- multi_codex-0.7.0/README.md → multi_codex-0.8.0/src/multi_codex.egg-info/PKG-INFO +67 -15
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex.egg-info/SOURCES.txt +2 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_ergonomics.py +1 -1
- multi_codex-0.8.0/tests/test_everyday.py +400 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_insight.py +3 -3
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_onboarding.py +1 -1
- {multi_codex-0.7.0 → multi_codex-0.8.0}/LICENSE +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/setup.cfg +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/__main__.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/accounts.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/actions.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/apps.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/binding.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/fsutil.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/identity.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/launcher.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/lock.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/migrate.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/platform.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/shared.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/switch.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex/usage.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex.egg-info/dependency_links.txt +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex.egg-info/entry_points.txt +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/src/multi_codex.egg-info/top_level.txt +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_accounts.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_apps.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_binding.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_config.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_config_copy.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_fsutil.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_install.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_migrate.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_onboarding_commands.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_platform.py +0 -0
- {multi_codex-0.7.0 → multi_codex-0.8.0}/tests/test_switch.py +0 -0
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multi-codex
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Run several Codex CLI accounts side by side: separate CODEX_HOME directories, launchers and proxies.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/jakoes-wu/multi-codex
|
|
7
|
+
Project-URL: Changelog, https://github.com/jakoes-wu/multi-codex/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Issues, https://github.com/jakoes-wu/multi-codex/issues
|
|
9
|
+
Keywords: codex,codex-cli,openai,multi-account,account-switcher,proxy,cli
|
|
7
10
|
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
8
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
13
|
Classifier: Operating System :: MacOS
|
|
10
14
|
Classifier: Operating System :: POSIX :: Linux
|
|
11
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
12
20
|
Requires-Python: >=3.8
|
|
13
21
|
Description-Content-Type: text/markdown
|
|
14
22
|
License-File: LICENSE
|
|
@@ -18,6 +26,12 @@ Dynamic: license-file
|
|
|
18
26
|
|
|
19
27
|
**English** | [简体中文](README.zh-CN.md)
|
|
20
28
|
|
|
29
|
+
[](https://github.com/jakoes-wu/multi-codex/releases)
|
|
30
|
+
[](https://github.com/jakoes-wu/multi-codex/actions/workflows/ci.yml)
|
|
31
|
+
[](https://pypi.org/project/multi-codex/)
|
|
32
|
+

|
|
33
|
+
[](LICENSE)
|
|
34
|
+
|
|
21
35
|
Use several [Codex CLI](https://github.com/openai/codex) accounts on one machine, at the same time. Each account keeps its own login, settings, history and, if you like, its own proxy. No more logging out and in again.
|
|
22
36
|
|
|
23
37
|
```sh
|
|
@@ -26,6 +40,10 @@ codex-personal # Codex, logged in with your personal account, in another te
|
|
|
26
40
|
multi-codex list # which account is logged in as whom
|
|
27
41
|
```
|
|
28
42
|
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
<sub>The accounts in the demo are examples.</sub>
|
|
46
|
+
|
|
29
47
|
## How it works
|
|
30
48
|
|
|
31
49
|
Codex keeps everything (settings, credentials, sessions) in one directory, `CODEX_HOME`, which is `~/.codex` by default. multi-codex gives every account its own directory and a small launcher command, `codex-<name>`, that starts Codex with that directory:
|
|
@@ -47,10 +65,12 @@ curl -fsSL https://raw.githubusercontent.com/jakoes-wu/multi-codex/main/install.
|
|
|
47
65
|
multi-codex --version
|
|
48
66
|
```
|
|
49
67
|
|
|
50
|
-
|
|
68
|
+
Other ways: `pipx install multi-codex` (from PyPI), or on macOS `brew install jakoes-wu/tap/multi-codex`. Either way, the `codex-<name>` launchers still go to `~/.local/bin`.
|
|
69
|
+
|
|
70
|
+
The `multi-codex` command and the `codex-<name>` launchers go to `~/.local/bin`. If your shell says `command not found`, that directory is not on your `PATH` yet. The installer, `multi-codex add` and `multi-codex doctor` then print the exact command for your shell (zsh, bash or fish), but never edit your shell profile themselves. In zsh, for example, run this once (bash on macOS uses `~/.bash_profile`, bash on Linux `~/.bashrc`) and open a new terminal:
|
|
51
71
|
|
|
52
72
|
```sh
|
|
53
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
73
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
|
|
54
74
|
```
|
|
55
75
|
|
|
56
76
|
In fish, run `fish_add_path ~/.local/bin` once instead.
|
|
@@ -70,7 +90,7 @@ Each command creates a directory (`~/.cx/work`) and a launcher (`codex-work`). A
|
|
|
70
90
|
|
|
71
91
|
After `add`, multi-codex prints the next step: the login command, and a warning if `~/.local/bin` is not on your `PATH` yet. Running `multi-codex` without arguments shows these steps again.
|
|
72
92
|
|
|
73
|
-
If an account should go through a proxy, give it a local port or a URL, for example `multi-codex add work --proxy 7901` (the same as `http://127.0.0.1:7901`). See [Proxy values](#proxy-values).
|
|
93
|
+
If an account should go through a proxy, give it a local port or a URL, for example `multi-codex add work --proxy 7901` (the same as `http://127.0.0.1:7901`). See [Proxy values](#proxy-values). To change an existing account later, use `multi-codex set`, for example `multi-codex set work --proxy 7902`.
|
|
74
94
|
|
|
75
95
|
### 2. Log in once per account
|
|
76
96
|
|
|
@@ -91,7 +111,7 @@ codex-personal resume
|
|
|
91
111
|
### 4. Check that everything is right
|
|
92
112
|
|
|
93
113
|
```sh
|
|
94
|
-
multi-codex list #
|
|
114
|
+
multi-codex list # who is logged in, proxy, sharing, usage and anything that needs fixing
|
|
95
115
|
multi-codex usage # 5-hour and weekly usage; empty until you have used an account (--live asks right away)
|
|
96
116
|
multi-codex doctor # finds problems and prints the command that fixes each one
|
|
97
117
|
```
|
|
@@ -115,8 +135,8 @@ Without a name, the account is named after the e-mail address in `~/.codex/auth.
|
|
|
115
135
|
| Open the desktop app with an account (macOS) | `multi-codex app work` | [VS Code and the desktop app](#vs-code-and-the-desktop-app-experimental) |
|
|
116
136
|
| Change the account that plain `codex` and the Dock apps use | `multi-codex use work` (after `migrate-default`) | [Default account](#default-account) |
|
|
117
137
|
| Always use one account inside a project | In the project directory: `multi-codex bind work`, then `multi-codex run` | [Directory bindings](#directory-bindings) |
|
|
118
|
-
| Set or change an account's proxy | `multi-codex
|
|
119
|
-
| Share `AGENTS.md`, skills and rules between accounts | Put them in `~/.codex-shared`, run `multi-codex
|
|
138
|
+
| Set or change an account's proxy | `multi-codex set work --proxy 7901` | [Proxy values](#proxy-values) |
|
|
139
|
+
| Share `AGENTS.md`, skills and rules between accounts | Put them in `~/.codex-shared`, then run `multi-codex set work --shared` | [Shared resources](#shared-resources) |
|
|
120
140
|
| Start a new account with another account's settings | `multi-codex add new --config-from work` | [Copying settings](#copying-settings-from-another-account) |
|
|
121
141
|
| Give an account extra environment variables | `multi-codex env work KEY=VALUE` | [Environment variables](#per-account-environment-variables) |
|
|
122
142
|
| Set up all accounts on a new machine | `curl -fsSL https://raw.githubusercontent.com/jakoes-wu/multi-codex/main/install.sh \| sh -s -- --config accounts.json` | [Declarative setup](#declarative-setup-with-apply) |
|
|
@@ -139,12 +159,13 @@ More questions are answered in the [FAQ](#faq).
|
|
|
139
159
|
| ---- | ---- |
|
|
140
160
|
| `multi-codex init [--root DIR] [--bin-dir DIR] [--shared-dir DIR] [--shared-items A,B]` | Create or change global settings. |
|
|
141
161
|
| `multi-codex migrate-default [NAME] [--source DIR] [--copy] [--keep-backup] [--proxy P] [--skip-process-check] [--accept-relogin]` | Turn the default directory into an account. Without NAME, the e-mail address in its `auth.json` is used. |
|
|
142
|
-
| `multi-codex add NAME [--proxy P] [--shared \| --no-shared] [--adopt] [--config-from OTHER]` | Add an account, adopt an existing directory, or change its options. `--config-from` copies `config.toml` from another account once. |
|
|
162
|
+
| `multi-codex add NAME [--proxy P] [--shared [DIR] \| --no-shared] [--adopt] [--config-from OTHER]` | Add an account, adopt an existing directory, or change its options. `--config-from` copies `config.toml` from another account once. |
|
|
163
|
+
| `multi-codex set NAME [--proxy P] [--shared [DIR] \| --no-shared] [--adopt] [--config-from OTHER]` | Change an existing account; same options as `add`, but never creates one. |
|
|
143
164
|
| `multi-codex login NAME [-- ARGS]` | Run `codex login` with an account's environment; arguments after `--` go to `codex login`. Does not need `~/.local/bin` on `PATH`. |
|
|
144
165
|
| `multi-codex proxy NAME PORT\|URL\|off\|inherit` | Set an account's proxy. |
|
|
145
166
|
| `multi-codex remove NAME` | Unregister an account and delete its launcher. **The account directory is kept.** |
|
|
146
167
|
| `multi-codex apply [-f FILE]` | Converge everything to the configuration (or to `FILE`). |
|
|
147
|
-
| `multi-codex list [--json]` | Show accounts
|
|
168
|
+
| `multi-codex list [-v] [--json]` | Show accounts: who is logged in, proxy, sharing, usage and status. `-v` shows the full table. |
|
|
148
169
|
| `multi-codex usage [NAME ...] [--live] [--timeout SEC] [--json]` | Show rate-limit usage. |
|
|
149
170
|
| `multi-codex doctor [--json]` | Check the installation, configuration and accounts. Read-only. |
|
|
150
171
|
| `multi-codex run [NAME] [-- COMMAND ...]` | Run a command (default: `codex`) with an account's environment. Without NAME, the account bound to the current directory is used. |
|
|
@@ -157,11 +178,23 @@ More questions are answered in the [FAQ](#faq).
|
|
|
157
178
|
| `multi-codex restore NAME [--skip-process-check] [--accept-relogin]` | Undo `migrate-default`: move the account back to `~/.codex`. |
|
|
158
179
|
| `multi-codex completion bash\|zsh\|fish` | Print a shell completion script. |
|
|
159
180
|
|
|
160
|
-
Every write command accepts `--dry-run`. `init`, `add`, `proxy`, `remove`, `apply`, `bind`, `unbind` and `env` print only the items they change (or `already up to date`); `-v` / `--verbose` also prints unchanged items. `list`, `usage` and `doctor` never change anything; with `--json` they print a single JSON object on stdout (with a `"version": 1` field) and keep warnings on stderr. Use `--json` in scripts: the table layout is not guaranteed to stay the same.
|
|
181
|
+
Every write command accepts `--dry-run`. `init`, `add`, `set`, `proxy`, `remove`, `apply`, `bind`, `unbind` and `env` print only the items they change (or `already up to date`); `-v` / `--verbose` also prints unchanged items. For `list`, `-v` means the full table instead. `list`, `usage` and `doctor` never change anything; with `--json` they print a single JSON object on stdout (with a `"version": 1` field) and keep warnings on stderr. Use `--json` in scripts: the table layout is not guaranteed to stay the same.
|
|
161
182
|
|
|
162
183
|
### Login and usage
|
|
163
184
|
|
|
164
|
-
`list`
|
|
185
|
+
`list` shows one line per account:
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
default: work
|
|
189
|
+
NAME LOGIN PROXY SHARED USAGE STATUS
|
|
190
|
+
work w@example.com http://127.0.0.1:7901 yes 5h 23%, 7d 41% ok
|
|
191
|
+
home - inherit no - not logged in
|
|
192
|
+
run `multi-codex doctor` for details
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
LOGIN is read from each account's local `auth.json`: the e-mail address, `api-key`, `-` (not logged in), `keyring` (credentials are in the system keyring and cannot be read from files) or `unreadable`. No token is ever printed, and nothing is sent anywhere. USAGE is the last usage snapshot in the account's local session logs, the same data as `multi-codex usage` (`reset` means the window has reset since; `*` means `sessions` is shared with other accounts, so the numbers may belong to another one). STATUS lists what needs fixing (`missing-dir`, `launcher missing`/`stale`/`conflict`, `not logged in`); `doctor` explains each problem. If two accounts are logged in as the same ChatGPT user and workspace, `list` warns you: they share one quota.
|
|
196
|
+
|
|
197
|
+
`list -v` prints the full table of earlier versions: the root, launcher and shared directories, and the DIR, LAUNCHER and PLAN columns. PLAN is the plan recorded when the current token was issued; it is updated the next time Codex refreshes the token.
|
|
165
198
|
|
|
166
199
|
`multi-codex usage` reads the most recent rate-limit snapshot from each account's session logs (`sessions/` and `archived_sessions/`). It is offline but can be out of date; a window that has reset since the snapshot is shown as `reset since snapshot`.
|
|
167
200
|
|
|
@@ -317,13 +350,16 @@ If a migration stops with an error and you want to abandon it: the error message
|
|
|
317
350
|
## Shared resources
|
|
318
351
|
|
|
319
352
|
```sh
|
|
320
|
-
multi-codex
|
|
321
|
-
multi-codex add work --shared
|
|
353
|
+
multi-codex set work --shared
|
|
322
354
|
```
|
|
323
355
|
|
|
324
|
-
Put the items you want to share
|
|
356
|
+
Without a directory, `--shared` uses the shared directory already configured, or `~/.codex-shared` if none is set yet. Put the items you want to share there first: items missing from it are skipped (`skip`), and nothing is linked for them; if none of them is there, multi-codex says so. To choose which items are shared, use `multi-codex init --shared-items AGENTS.md,skills,rules,agents`.
|
|
357
|
+
|
|
358
|
+
`--shared DIR` (for example `multi-codex set work --shared ~/my-shared`) changes the shared directory for **every** shared account, not only this one: their links move to the new directory, and links to items missing there are removed. Write the account name before `--shared`; `add --shared work` would take `work` as the directory.
|
|
359
|
+
|
|
360
|
+
multi-codex creates the missing links and remembers which links it created. Turning sharing off removes only those links; links you made yourself are left alone. A real file or directory at a link location is a conflict and is never overwritten.
|
|
325
361
|
|
|
326
|
-
If you already linked an account to the shared directory by hand, `multi-codex
|
|
362
|
+
If you already linked an account to the shared directory by hand, `multi-codex set NAME --shared --adopt` takes those links over without recreating them: from then on, turning sharing off removes them as well. Only links that already point to the matching shared item are adopted.
|
|
327
363
|
|
|
328
364
|
### What can be shared
|
|
329
365
|
|
|
@@ -424,7 +460,7 @@ cd multi-codex
|
|
|
424
460
|
./install.sh
|
|
425
461
|
```
|
|
426
462
|
|
|
427
|
-
With pipx: `pipx install git+https://github.com/jakoes-wu/multi-codex
|
|
463
|
+
With pipx: `pipx install multi-codex` (the latest release from PyPI), or `pipx install git+https://github.com/jakoes-wu/multi-codex` for the current `main` branch.
|
|
428
464
|
|
|
429
465
|
The tool goes to `~/.local/share/multi-codex` and the `multi-codex` command to `~/.local/bin`. Use `--prefix DIR` to install somewhere else. Run `./install.sh --help` for all options.
|
|
430
466
|
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: multi-codex
|
|
3
|
-
Version: 0.7.0
|
|
4
|
-
Summary: Run several Codex CLI accounts side by side: separate CODEX_HOME directories, launchers and proxies.
|
|
5
|
-
License: MIT
|
|
6
|
-
Project-URL: Homepage, https://github.com/jakoes-wu/multi-codex
|
|
7
|
-
Classifier: Environment :: Console
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: MacOS
|
|
10
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Dynamic: license-file
|
|
16
|
-
|
|
17
1
|
# multi-codex
|
|
18
2
|
|
|
19
3
|
**English** | [简体中文](README.zh-CN.md)
|
|
20
4
|
|
|
5
|
+
[](https://github.com/jakoes-wu/multi-codex/releases)
|
|
6
|
+
[](https://github.com/jakoes-wu/multi-codex/actions/workflows/ci.yml)
|
|
7
|
+
[](https://pypi.org/project/multi-codex/)
|
|
8
|
+

|
|
9
|
+
[](LICENSE)
|
|
10
|
+
|
|
21
11
|
Use several [Codex CLI](https://github.com/openai/codex) accounts on one machine, at the same time. Each account keeps its own login, settings, history and, if you like, its own proxy. No more logging out and in again.
|
|
22
12
|
|
|
23
13
|
```sh
|
|
@@ -26,6 +16,10 @@ codex-personal # Codex, logged in with your personal account, in another te
|
|
|
26
16
|
multi-codex list # which account is logged in as whom
|
|
27
17
|
```
|
|
28
18
|
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
<sub>The accounts in the demo are examples.</sub>
|
|
22
|
+
|
|
29
23
|
## How it works
|
|
30
24
|
|
|
31
25
|
Codex keeps everything (settings, credentials, sessions) in one directory, `CODEX_HOME`, which is `~/.codex` by default. multi-codex gives every account its own directory and a small launcher command, `codex-<name>`, that starts Codex with that directory:
|
|
@@ -47,10 +41,12 @@ curl -fsSL https://raw.githubusercontent.com/jakoes-wu/multi-codex/main/install.
|
|
|
47
41
|
multi-codex --version
|
|
48
42
|
```
|
|
49
43
|
|
|
50
|
-
|
|
44
|
+
Other ways: `pipx install multi-codex` (from PyPI), or on macOS `brew install jakoes-wu/tap/multi-codex`. Either way, the `codex-<name>` launchers still go to `~/.local/bin`.
|
|
45
|
+
|
|
46
|
+
The `multi-codex` command and the `codex-<name>` launchers go to `~/.local/bin`. If your shell says `command not found`, that directory is not on your `PATH` yet. The installer, `multi-codex add` and `multi-codex doctor` then print the exact command for your shell (zsh, bash or fish), but never edit your shell profile themselves. In zsh, for example, run this once (bash on macOS uses `~/.bash_profile`, bash on Linux `~/.bashrc`) and open a new terminal:
|
|
51
47
|
|
|
52
48
|
```sh
|
|
53
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
49
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
|
|
54
50
|
```
|
|
55
51
|
|
|
56
52
|
In fish, run `fish_add_path ~/.local/bin` once instead.
|
|
@@ -70,7 +66,7 @@ Each command creates a directory (`~/.cx/work`) and a launcher (`codex-work`). A
|
|
|
70
66
|
|
|
71
67
|
After `add`, multi-codex prints the next step: the login command, and a warning if `~/.local/bin` is not on your `PATH` yet. Running `multi-codex` without arguments shows these steps again.
|
|
72
68
|
|
|
73
|
-
If an account should go through a proxy, give it a local port or a URL, for example `multi-codex add work --proxy 7901` (the same as `http://127.0.0.1:7901`). See [Proxy values](#proxy-values).
|
|
69
|
+
If an account should go through a proxy, give it a local port or a URL, for example `multi-codex add work --proxy 7901` (the same as `http://127.0.0.1:7901`). See [Proxy values](#proxy-values). To change an existing account later, use `multi-codex set`, for example `multi-codex set work --proxy 7902`.
|
|
74
70
|
|
|
75
71
|
### 2. Log in once per account
|
|
76
72
|
|
|
@@ -91,7 +87,7 @@ codex-personal resume
|
|
|
91
87
|
### 4. Check that everything is right
|
|
92
88
|
|
|
93
89
|
```sh
|
|
94
|
-
multi-codex list #
|
|
90
|
+
multi-codex list # who is logged in, proxy, sharing, usage and anything that needs fixing
|
|
95
91
|
multi-codex usage # 5-hour and weekly usage; empty until you have used an account (--live asks right away)
|
|
96
92
|
multi-codex doctor # finds problems and prints the command that fixes each one
|
|
97
93
|
```
|
|
@@ -115,8 +111,8 @@ Without a name, the account is named after the e-mail address in `~/.codex/auth.
|
|
|
115
111
|
| Open the desktop app with an account (macOS) | `multi-codex app work` | [VS Code and the desktop app](#vs-code-and-the-desktop-app-experimental) |
|
|
116
112
|
| Change the account that plain `codex` and the Dock apps use | `multi-codex use work` (after `migrate-default`) | [Default account](#default-account) |
|
|
117
113
|
| Always use one account inside a project | In the project directory: `multi-codex bind work`, then `multi-codex run` | [Directory bindings](#directory-bindings) |
|
|
118
|
-
| Set or change an account's proxy | `multi-codex
|
|
119
|
-
| Share `AGENTS.md`, skills and rules between accounts | Put them in `~/.codex-shared`, run `multi-codex
|
|
114
|
+
| Set or change an account's proxy | `multi-codex set work --proxy 7901` | [Proxy values](#proxy-values) |
|
|
115
|
+
| Share `AGENTS.md`, skills and rules between accounts | Put them in `~/.codex-shared`, then run `multi-codex set work --shared` | [Shared resources](#shared-resources) |
|
|
120
116
|
| Start a new account with another account's settings | `multi-codex add new --config-from work` | [Copying settings](#copying-settings-from-another-account) |
|
|
121
117
|
| Give an account extra environment variables | `multi-codex env work KEY=VALUE` | [Environment variables](#per-account-environment-variables) |
|
|
122
118
|
| Set up all accounts on a new machine | `curl -fsSL https://raw.githubusercontent.com/jakoes-wu/multi-codex/main/install.sh \| sh -s -- --config accounts.json` | [Declarative setup](#declarative-setup-with-apply) |
|
|
@@ -139,12 +135,13 @@ More questions are answered in the [FAQ](#faq).
|
|
|
139
135
|
| ---- | ---- |
|
|
140
136
|
| `multi-codex init [--root DIR] [--bin-dir DIR] [--shared-dir DIR] [--shared-items A,B]` | Create or change global settings. |
|
|
141
137
|
| `multi-codex migrate-default [NAME] [--source DIR] [--copy] [--keep-backup] [--proxy P] [--skip-process-check] [--accept-relogin]` | Turn the default directory into an account. Without NAME, the e-mail address in its `auth.json` is used. |
|
|
142
|
-
| `multi-codex add NAME [--proxy P] [--shared \| --no-shared] [--adopt] [--config-from OTHER]` | Add an account, adopt an existing directory, or change its options. `--config-from` copies `config.toml` from another account once. |
|
|
138
|
+
| `multi-codex add NAME [--proxy P] [--shared [DIR] \| --no-shared] [--adopt] [--config-from OTHER]` | Add an account, adopt an existing directory, or change its options. `--config-from` copies `config.toml` from another account once. |
|
|
139
|
+
| `multi-codex set NAME [--proxy P] [--shared [DIR] \| --no-shared] [--adopt] [--config-from OTHER]` | Change an existing account; same options as `add`, but never creates one. |
|
|
143
140
|
| `multi-codex login NAME [-- ARGS]` | Run `codex login` with an account's environment; arguments after `--` go to `codex login`. Does not need `~/.local/bin` on `PATH`. |
|
|
144
141
|
| `multi-codex proxy NAME PORT\|URL\|off\|inherit` | Set an account's proxy. |
|
|
145
142
|
| `multi-codex remove NAME` | Unregister an account and delete its launcher. **The account directory is kept.** |
|
|
146
143
|
| `multi-codex apply [-f FILE]` | Converge everything to the configuration (or to `FILE`). |
|
|
147
|
-
| `multi-codex list [--json]` | Show accounts
|
|
144
|
+
| `multi-codex list [-v] [--json]` | Show accounts: who is logged in, proxy, sharing, usage and status. `-v` shows the full table. |
|
|
148
145
|
| `multi-codex usage [NAME ...] [--live] [--timeout SEC] [--json]` | Show rate-limit usage. |
|
|
149
146
|
| `multi-codex doctor [--json]` | Check the installation, configuration and accounts. Read-only. |
|
|
150
147
|
| `multi-codex run [NAME] [-- COMMAND ...]` | Run a command (default: `codex`) with an account's environment. Without NAME, the account bound to the current directory is used. |
|
|
@@ -157,11 +154,23 @@ More questions are answered in the [FAQ](#faq).
|
|
|
157
154
|
| `multi-codex restore NAME [--skip-process-check] [--accept-relogin]` | Undo `migrate-default`: move the account back to `~/.codex`. |
|
|
158
155
|
| `multi-codex completion bash\|zsh\|fish` | Print a shell completion script. |
|
|
159
156
|
|
|
160
|
-
Every write command accepts `--dry-run`. `init`, `add`, `proxy`, `remove`, `apply`, `bind`, `unbind` and `env` print only the items they change (or `already up to date`); `-v` / `--verbose` also prints unchanged items. `list`, `usage` and `doctor` never change anything; with `--json` they print a single JSON object on stdout (with a `"version": 1` field) and keep warnings on stderr. Use `--json` in scripts: the table layout is not guaranteed to stay the same.
|
|
157
|
+
Every write command accepts `--dry-run`. `init`, `add`, `set`, `proxy`, `remove`, `apply`, `bind`, `unbind` and `env` print only the items they change (or `already up to date`); `-v` / `--verbose` also prints unchanged items. For `list`, `-v` means the full table instead. `list`, `usage` and `doctor` never change anything; with `--json` they print a single JSON object on stdout (with a `"version": 1` field) and keep warnings on stderr. Use `--json` in scripts: the table layout is not guaranteed to stay the same.
|
|
161
158
|
|
|
162
159
|
### Login and usage
|
|
163
160
|
|
|
164
|
-
`list`
|
|
161
|
+
`list` shows one line per account:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
default: work
|
|
165
|
+
NAME LOGIN PROXY SHARED USAGE STATUS
|
|
166
|
+
work w@example.com http://127.0.0.1:7901 yes 5h 23%, 7d 41% ok
|
|
167
|
+
home - inherit no - not logged in
|
|
168
|
+
run `multi-codex doctor` for details
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
LOGIN is read from each account's local `auth.json`: the e-mail address, `api-key`, `-` (not logged in), `keyring` (credentials are in the system keyring and cannot be read from files) or `unreadable`. No token is ever printed, and nothing is sent anywhere. USAGE is the last usage snapshot in the account's local session logs, the same data as `multi-codex usage` (`reset` means the window has reset since; `*` means `sessions` is shared with other accounts, so the numbers may belong to another one). STATUS lists what needs fixing (`missing-dir`, `launcher missing`/`stale`/`conflict`, `not logged in`); `doctor` explains each problem. If two accounts are logged in as the same ChatGPT user and workspace, `list` warns you: they share one quota.
|
|
172
|
+
|
|
173
|
+
`list -v` prints the full table of earlier versions: the root, launcher and shared directories, and the DIR, LAUNCHER and PLAN columns. PLAN is the plan recorded when the current token was issued; it is updated the next time Codex refreshes the token.
|
|
165
174
|
|
|
166
175
|
`multi-codex usage` reads the most recent rate-limit snapshot from each account's session logs (`sessions/` and `archived_sessions/`). It is offline but can be out of date; a window that has reset since the snapshot is shown as `reset since snapshot`.
|
|
167
176
|
|
|
@@ -317,13 +326,16 @@ If a migration stops with an error and you want to abandon it: the error message
|
|
|
317
326
|
## Shared resources
|
|
318
327
|
|
|
319
328
|
```sh
|
|
320
|
-
multi-codex
|
|
321
|
-
multi-codex add work --shared
|
|
329
|
+
multi-codex set work --shared
|
|
322
330
|
```
|
|
323
331
|
|
|
324
|
-
Put the items you want to share
|
|
332
|
+
Without a directory, `--shared` uses the shared directory already configured, or `~/.codex-shared` if none is set yet. Put the items you want to share there first: items missing from it are skipped (`skip`), and nothing is linked for them; if none of them is there, multi-codex says so. To choose which items are shared, use `multi-codex init --shared-items AGENTS.md,skills,rules,agents`.
|
|
333
|
+
|
|
334
|
+
`--shared DIR` (for example `multi-codex set work --shared ~/my-shared`) changes the shared directory for **every** shared account, not only this one: their links move to the new directory, and links to items missing there are removed. Write the account name before `--shared`; `add --shared work` would take `work` as the directory.
|
|
335
|
+
|
|
336
|
+
multi-codex creates the missing links and remembers which links it created. Turning sharing off removes only those links; links you made yourself are left alone. A real file or directory at a link location is a conflict and is never overwritten.
|
|
325
337
|
|
|
326
|
-
If you already linked an account to the shared directory by hand, `multi-codex
|
|
338
|
+
If you already linked an account to the shared directory by hand, `multi-codex set NAME --shared --adopt` takes those links over without recreating them: from then on, turning sharing off removes them as well. Only links that already point to the matching shared item are adopted.
|
|
327
339
|
|
|
328
340
|
### What can be shared
|
|
329
341
|
|
|
@@ -424,7 +436,7 @@ cd multi-codex
|
|
|
424
436
|
./install.sh
|
|
425
437
|
```
|
|
426
438
|
|
|
427
|
-
With pipx: `pipx install git+https://github.com/jakoes-wu/multi-codex
|
|
439
|
+
With pipx: `pipx install multi-codex` (the latest release from PyPI), or `pipx install git+https://github.com/jakoes-wu/multi-codex` for the current `main` branch.
|
|
428
440
|
|
|
429
441
|
The tool goes to `~/.local/share/multi-codex` and the `multi-codex` command to `~/.local/bin`. Use `--prefix DIR` to install somewhere else. Run `./install.sh --help` for all options.
|
|
430
442
|
|
|
@@ -9,12 +9,18 @@ description = "Run several Codex CLI accounts side by side: separate CODEX_HOME
|
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
11
11
|
requires-python = ">=3.8"
|
|
12
|
+
keywords = ["codex", "codex-cli", "openai", "multi-account", "account-switcher", "proxy", "cli"]
|
|
12
13
|
classifiers = [
|
|
13
14
|
"Environment :: Console",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
14
16
|
"License :: OSI Approved :: MIT License",
|
|
15
17
|
"Operating System :: MacOS",
|
|
16
18
|
"Operating System :: POSIX :: Linux",
|
|
17
19
|
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.8",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Topic :: Utilities",
|
|
18
24
|
]
|
|
19
25
|
|
|
20
26
|
[project.scripts]
|
|
@@ -22,6 +28,8 @@ multi-codex = "multi_codex.cli:main"
|
|
|
22
28
|
|
|
23
29
|
[project.urls]
|
|
24
30
|
Homepage = "https://github.com/jakoes-wu/multi-codex"
|
|
31
|
+
Changelog = "https://github.com/jakoes-wu/multi-codex/blob/main/CHANGELOG.md"
|
|
32
|
+
Issues = "https://github.com/jakoes-wu/multi-codex/issues"
|
|
25
33
|
|
|
26
34
|
[tool.setuptools.dynamic]
|
|
27
35
|
version = {attr = "multi_codex.__version__"}
|