@loongphy/codex-auth 0.2.2 → 0.2.3-alpha.2

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 CHANGED
@@ -23,7 +23,7 @@ For the best experience, install the Codex CLI even if you mainly use the VS Cod
23
23
  npm install -g @openai/codex
24
24
  ```
25
25
 
26
- After that, you can use `codex login` or `codex-auth login` to sign in and add accounts more easily.
26
+ 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.
27
27
 
28
28
  ## Install
29
29
 
@@ -39,7 +39,7 @@ npm install -g @loongphy/codex-auth
39
39
  npx @loongphy/codex-auth list
40
40
  ```
41
41
 
42
- npm packages currently support Linux x64, macOS x64, macOS arm64, and Windows x64.
42
+ npm packages currently support Linux x64, macOS x64, macOS arm64, Windows x64, and Windows arm64.
43
43
 
44
44
  > [!NOTE]
45
45
  > If you only installed `@loongphy/codex-auth` with npm, you do not need any legacy cleanup steps.
@@ -93,7 +93,7 @@ Remove-Item "$env:LOCALAPPDATA\codex-auth\bin\codex-auth-auto.exe" -Force -Error
93
93
  | Command | Description |
94
94
  |---------|-------------|
95
95
  | `codex-auth list` | List all accounts |
96
- | `codex-auth login` | Run `codex login`, then add the current account |
96
+ | `codex-auth login [--device-auth]` | Run `codex login` (optionally with `--device-auth`), then add the current account |
97
97
  | `codex-auth switch [<email>]` | Switch active account interactively or by partial match |
98
98
  | `codex-auth remove` | Remove accounts with interactive multi-select |
99
99
  | `codex-auth status` | Show auto-switch, service, and usage status |
@@ -158,6 +158,7 @@ Add the currently logged-in Codex account:
158
158
 
159
159
  ```shell
160
160
  codex-auth login
161
+ codex-auth login --device-auth
161
162
  ```
162
163
 
163
164
  ### Import
@@ -290,38 +291,6 @@ Upgrade notes:
290
291
  - If you are upgrading from `v0.1.x` to the latest `v0.2.x`, API usage refresh is enabled by default.
291
292
  - If you previously used an early `v0.2` prerelease/test build and `status` still shows `usage: local`, run `codex-auth config api enable` once to switch back to API mode.
292
293
 
293
- ### How to import tokens from cli-proxy-api?
294
-
295
- 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.
296
-
297
- The CLI can also import the flat cli-proxy-api / CPA JSON files directly:
298
-
299
- ```shell
300
- codex-auth import --cpa # default source: ~/.cli-proxy-api
301
- codex-auth import --cpa /path/to/cpa-dir # scans direct child .json files
302
- ```
303
-
304
- 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`.
305
-
306
- The script is not bundled in the published npm package, so run it from a clone of this repository:
307
-
308
- ```shell
309
- # Convert: ~/.cli-proxy-api → /tmp/tokens
310
- python3 scripts/convert_tokens.sh
311
-
312
- # Or specify custom directories
313
- python3 scripts/convert_tokens.sh <source_dir> <output_dir>
314
- ```
315
-
316
- Then import and switch:
317
-
318
- ```shell
319
- codex-auth import /tmp/tokens/
320
- # or import the CPA files directly without a conversion step
321
- codex-auth import --cpa
322
- codex-auth switch
323
- ```
324
-
325
294
  Verify with:
326
295
 
327
296
  ```shell
package/bin/codex-auth.js CHANGED
@@ -9,7 +9,8 @@ const packageMap = {
9
9
  "linux:x64": "@loongphy/codex-auth-linux-x64",
10
10
  "darwin:x64": "@loongphy/codex-auth-darwin-x64",
11
11
  "darwin:arm64": "@loongphy/codex-auth-darwin-arm64",
12
- "win32:x64": "@loongphy/codex-auth-win32-x64"
12
+ "win32:x64": "@loongphy/codex-auth-win32-x64",
13
+ "win32:arm64": "@loongphy/codex-auth-win32-arm64"
13
14
  };
14
15
 
15
16
  function readRootPackage() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loongphy/codex-auth",
3
- "version": "0.2.2",
3
+ "version": "0.2.3-alpha.2",
4
4
  "description": "CLI for switching Codex accounts",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,10 +20,11 @@
20
20
  "README.md"
21
21
  ],
22
22
  "optionalDependencies": {
23
- "@loongphy/codex-auth-linux-x64": "0.2.2",
24
- "@loongphy/codex-auth-darwin-x64": "0.2.2",
25
- "@loongphy/codex-auth-darwin-arm64": "0.2.2",
26
- "@loongphy/codex-auth-win32-x64": "0.2.2"
23
+ "@loongphy/codex-auth-linux-x64": "0.2.3-alpha.2",
24
+ "@loongphy/codex-auth-darwin-x64": "0.2.3-alpha.2",
25
+ "@loongphy/codex-auth-darwin-arm64": "0.2.3-alpha.2",
26
+ "@loongphy/codex-auth-win32-x64": "0.2.3-alpha.2",
27
+ "@loongphy/codex-auth-win32-arm64": "0.2.3-alpha.2"
27
28
  },
28
29
  "scripts": {
29
30
  "check:versions": "node scripts/npm/check-versions.mjs",