@loongphy/codex-auth 0.2.1 → 0.2.2-alpha.1
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 +20 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ codex-auth list # list all accounts
|
|
|
67
67
|
codex-auth login # run `codex login`, then add the current account
|
|
68
68
|
codex-auth switch [<email>] # switch active account (interactive or partial/fragment match)
|
|
69
69
|
codex-auth import <path> [--alias <alias>] # smart import: file -> single import, folder -> batch import
|
|
70
|
+
codex-auth import --cpa [<path>] # import CPA flat token JSON from one file or directory
|
|
70
71
|
codex-auth import --purge [<path>] # rebuild registry.json from auth files for the current version
|
|
71
72
|
codex-auth remove # remove accounts (interactive multi-select)
|
|
72
73
|
codex-auth status # show auto-switch/service/api usage status
|
|
@@ -103,6 +104,14 @@ Batch import from a folder:
|
|
|
103
104
|
codex-auth import /path/to/auth-exports
|
|
104
105
|
```
|
|
105
106
|
|
|
107
|
+
Import CPA exports directly:
|
|
108
|
+
|
|
109
|
+
```shell
|
|
110
|
+
codex-auth import --cpa # scan ~/.cli-proxy-api/*.json
|
|
111
|
+
codex-auth import --cpa /path/to/cpa-dir
|
|
112
|
+
codex-auth import --cpa /path/to/cpa.json --alias personal
|
|
113
|
+
```
|
|
114
|
+
|
|
106
115
|
Typical batch import output:
|
|
107
116
|
|
|
108
117
|
```text
|
|
@@ -220,6 +229,15 @@ Upgrade notes:
|
|
|
220
229
|
|
|
221
230
|
If you have token files from `~/.cli-proxy-api/token*.json`, this repository includes a helper script that can convert them into a format codex-auth can read.
|
|
222
231
|
|
|
232
|
+
The CLI can also import the flat cli-proxy-api / CPA JSON files directly:
|
|
233
|
+
|
|
234
|
+
```shell
|
|
235
|
+
codex-auth import --cpa # default source: ~/.cli-proxy-api
|
|
236
|
+
codex-auth import --cpa /path/to/cpa-dir # scans direct child .json files
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Each CPA file is converted in memory to the standard auth snapshot shape before it is written into `~/.codex/accounts/`. Missing or empty `refresh_token` values are skipped as `MissingRefreshToken`.
|
|
240
|
+
|
|
223
241
|
The script is not bundled in the published npm package, so run it from a clone of this repository:
|
|
224
242
|
|
|
225
243
|
```shell
|
|
@@ -234,6 +252,8 @@ Then import and switch:
|
|
|
234
252
|
|
|
235
253
|
```shell
|
|
236
254
|
codex-auth import /tmp/tokens/
|
|
255
|
+
# or import the CPA files directly without a conversion step
|
|
256
|
+
codex-auth import --cpa
|
|
237
257
|
codex-auth switch
|
|
238
258
|
```
|
|
239
259
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loongphy/codex-auth",
|
|
3
|
-
"version": "0.2.1",
|
|
3
|
+
"version": "0.2.2-alpha.1",
|
|
4
4
|
"description": "CLI for switching Codex accounts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@loongphy/codex-auth-linux-x64": "0.2.1",
|
|
24
|
-
"@loongphy/codex-auth-darwin-x64": "0.2.1",
|
|
25
|
-
"@loongphy/codex-auth-darwin-arm64": "0.2.1",
|
|
26
|
-
"@loongphy/codex-auth-win32-x64": "0.2.1"
|
|
23
|
+
"@loongphy/codex-auth-linux-x64": "0.2.2-alpha.1",
|
|
24
|
+
"@loongphy/codex-auth-darwin-x64": "0.2.2-alpha.1",
|
|
25
|
+
"@loongphy/codex-auth-darwin-arm64": "0.2.2-alpha.1",
|
|
26
|
+
"@loongphy/codex-auth-win32-x64": "0.2.2-alpha.1"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"check:versions": "node scripts/npm/check-versions.mjs",
|