@wen2go/codex-auth-ext-darwin-x64 0.3.0-alpha.7
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/LICENSE +21 -0
- package/README.md +150 -0
- package/bin/codex-auth +0 -0
- package/package.json +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-PRESENT Loongphy<https://github.com/loongphy>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Codex Auth Ext
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
`codex-auth` is a command-line tool for switching Codex accounts.
|
|
6
|
+
|
|
7
|
+
## Fork Notice
|
|
8
|
+
|
|
9
|
+
This repository is a second-development fork of [Loongphy/codex-auth](https://github.com/Loongphy/codex-auth).
|
|
10
|
+
|
|
11
|
+
This fork adds:
|
|
12
|
+
|
|
13
|
+
- Alias-first account labels in `codex-auth list`, so accounts with an alias render as `alias(email)`.
|
|
14
|
+
- `codex-auth login --alias <alias>` for assigning an alias while adding a new account.
|
|
15
|
+
- `codex-auth set-alias <selector> <alias>` as a shortcut for updating an existing account alias.
|
|
16
|
+
- A local npm packaging helper, `npm run pack:local`, for building an installable package from the current platform binary.
|
|
17
|
+
|
|
18
|
+
> [!IMPORTANT]
|
|
19
|
+
> For **Codex CLI** and **Codex App** users, switch accounts, then restart the client for the new account to take effect.
|
|
20
|
+
>
|
|
21
|
+
> If you use the CLI and want seamless automatic account switching without restarting, use the forked [`codext`](https://github.com/Loongphy/codext), an enhanced Codex CLI. Install it with `npm i -g @loongphy/codext` and run `codext`.
|
|
22
|
+
|
|
23
|
+
## Supported Platforms
|
|
24
|
+
|
|
25
|
+
`codex-auth` works with these Codex clients:
|
|
26
|
+
|
|
27
|
+
- Codex CLI
|
|
28
|
+
- VS Code extension
|
|
29
|
+
- Codex App
|
|
30
|
+
|
|
31
|
+
For the best experience, install the Codex CLI even if you mainly use the VS Code extension or the App, because it makes adding accounts easier:
|
|
32
|
+
|
|
33
|
+
```shell
|
|
34
|
+
npm install -g @openai/codex
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
After that, you can use `codex login`, `codex login --device-auth`, `codex-auth login`, or `codex-auth login --device-auth` to sign in and add accounts more easily.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
Install with npm:
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
npm install -g @wen2go/codex-auth-ext
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can also run it without a global install:
|
|
48
|
+
|
|
49
|
+
```shell
|
|
50
|
+
npx @wen2go/codex-auth-ext list
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
npm packages currently support Linux x64, Linux arm64, macOS x64, macOS arm64, Windows x64, and Windows arm64.
|
|
54
|
+
|
|
55
|
+
### Uninstall
|
|
56
|
+
|
|
57
|
+
#### npm
|
|
58
|
+
|
|
59
|
+
Remove the npm package:
|
|
60
|
+
|
|
61
|
+
```shell
|
|
62
|
+
npm uninstall -g @wen2go/codex-auth-ext
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Commands
|
|
66
|
+
|
|
67
|
+
Detailed command documentation lives in [docs/commands/README.md](./docs/commands/README.md).
|
|
68
|
+
|
|
69
|
+
### Account Management
|
|
70
|
+
|
|
71
|
+
| Command | Description |
|
|
72
|
+
|---------|-------------|
|
|
73
|
+
| [`codex-auth list [--live] [--active] [--api\|--skip-api]`](./docs/commands/list.md) | List stored accounts and usage state |
|
|
74
|
+
| [`codex-auth login [--device-auth] [--alias <alias>]`](./docs/commands/login.md) | Run `codex login`, then add the current account |
|
|
75
|
+
| [`codex-auth switch [--live] [--api\|--skip-api]`](./docs/commands/switch.md) | Switch the active account interactively |
|
|
76
|
+
| [`codex-auth switch <query>`](./docs/commands/switch.md) | Switch directly by row number or account selector |
|
|
77
|
+
| [`codex-auth remove [--live] [--api\|--skip-api]`](./docs/commands/remove.md) | Remove accounts interactively |
|
|
78
|
+
| [`codex-auth remove <query> [<query>...]`](./docs/commands/remove.md) | Remove accounts by selector |
|
|
79
|
+
| [`codex-auth remove --all`](./docs/commands/remove.md) | Remove all stored accounts |
|
|
80
|
+
| [`codex-auth set-alias <query> <alias>`](./docs/commands/alias.md) | Set or update an account alias |
|
|
81
|
+
|
|
82
|
+
### Import and Maintenance
|
|
83
|
+
|
|
84
|
+
| Command | Description |
|
|
85
|
+
|---------|-------------|
|
|
86
|
+
| [`codex-auth import <path> [--alias <alias>]`](./docs/commands/import.md) | Import a single auth file or batch import a folder |
|
|
87
|
+
| [`codex-auth import --cpa [<path>]`](./docs/commands/import.md) | Import CLIProxyAPI token JSON |
|
|
88
|
+
| [`codex-auth import --purge [<path>]`](./docs/commands/import.md) | Rebuild `registry.json` from auth files |
|
|
89
|
+
| [`codex-auth export [<dir>]`](./docs/commands/export.md) | Export stored account auth files |
|
|
90
|
+
| [`codex-auth export --cpa [<dir>]`](./docs/commands/export.md) | Export CLIProxyAPI token JSON |
|
|
91
|
+
| [`codex-auth clean`](./docs/commands/clean.md) | Delete managed backup and stale account files |
|
|
92
|
+
|
|
93
|
+
### Configuration
|
|
94
|
+
|
|
95
|
+
| Command | Description |
|
|
96
|
+
|---------|-------------|
|
|
97
|
+
| [`codex-auth config live --interval <seconds>`](./docs/commands/config.md) | Configure live TUI refresh interval |
|
|
98
|
+
|
|
99
|
+
## Quick Examples
|
|
100
|
+
|
|
101
|
+
```shell
|
|
102
|
+
codex-auth list
|
|
103
|
+
codex-auth list --active
|
|
104
|
+
codex-auth switch
|
|
105
|
+
codex-auth switch 02
|
|
106
|
+
codex-auth remove work
|
|
107
|
+
codex-auth login --alias personal
|
|
108
|
+
codex-auth set-alias 02 work
|
|
109
|
+
codex-auth import /path/to/auth.json --alias personal
|
|
110
|
+
codex-auth list --skip-api
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Q&A
|
|
114
|
+
|
|
115
|
+
### Why is my usage limit not refreshing?
|
|
116
|
+
|
|
117
|
+
API-backed refresh is the default. When you pass `--skip-api`, `codex-auth` reads the newest `~/.codex/sessions/**/rollout-*.jsonl` file instead. Recent Codex builds often write `token_count` events with `rate_limits: null`. The local files may still contain older usable usage limit data, but in practice they can lag by several hours, so local-only refresh may show a usage limit snapshot from hours ago instead of your latest state.
|
|
118
|
+
|
|
119
|
+
- Upstream Codex issue: [openai/codex#14880](https://github.com/openai/codex/issues/14880)
|
|
120
|
+
|
|
121
|
+
Run the API-backed default with:
|
|
122
|
+
|
|
123
|
+
```shell
|
|
124
|
+
codex-auth list
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Run one local-only command with:
|
|
128
|
+
|
|
129
|
+
```shell
|
|
130
|
+
codex-auth list --skip-api
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Verify with:
|
|
134
|
+
|
|
135
|
+
```shell
|
|
136
|
+
codex exec "say hello"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Disclaimer
|
|
140
|
+
|
|
141
|
+
This project is provided as-is and use is at your own risk.
|
|
142
|
+
|
|
143
|
+
**Usage Data Refresh Source:**
|
|
144
|
+
`codex-auth` supports two sources for refreshing account usage/usage limit information:
|
|
145
|
+
|
|
146
|
+
1. **API (default):** The tool makes direct HTTPS requests to OpenAI's endpoints using your account's access token. This enables both usage refresh and team name refresh. npm installs already satisfy the runtime requirement.
|
|
147
|
+
2. **Local-only:** With per-command `--skip-api`, the tool scans local `~/.codex/sessions/*/rollout-*.jsonl` files for usage data and skips team name refresh API calls. This mode is safer, but it can be less accurate because recent Codex rollout files often contain `rate_limits: null`, so the latest local usage limit data may lag by several hours.
|
|
148
|
+
|
|
149
|
+
**API Call Declaration:**
|
|
150
|
+
By using the default API-backed refresh, this tool will send your ChatGPT access token to OpenAI's servers, including `https://chatgpt.com/backend-api/wham/usage` for usage limit and `https://chatgpt.com/backend-api/accounts/check/v4-2023-04-27` for team name. This behavior may be detected by OpenAI and could violate their terms of service, potentially leading to account suspension or other risks. The decision to use this feature and any resulting consequences are entirely yours.
|
package/bin/codex-auth
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wen2go/codex-auth-ext-darwin-x64",
|
|
3
|
+
"version": "0.3.0-alpha.7",
|
|
4
|
+
"description": "@wen2go/codex-auth-ext binary for darwin x64",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/wen2go/codex-auth-ext.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/wen2go/codex-auth-ext",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/wen2go/codex-auth-ext/issues"
|
|
13
|
+
},
|
|
14
|
+
"os": [
|
|
15
|
+
"darwin"
|
|
16
|
+
],
|
|
17
|
+
"cpu": [
|
|
18
|
+
"x64"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
"bin/",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
}
|
|
28
|
+
}
|