Skip to content

Commit 8336f16

Browse files
authored
Merge pull request #93 from ndycode/feat/device-code-auth
add ChatGPT device-code login flow
2 parents 1052abd + 23cf326 commit 8336f16

11 files changed

Lines changed: 1488 additions & 803 deletions

docs/getting-started.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ The browser-based OAuth flow uses the same local callback port as Codex CLI: `ht
7676
If you are on SSH, WSL, or another environment where the browser callback flow is inconvenient:
7777

7878
1. rerun `opencode auth login`
79-
2. choose `ChatGPT Plus/Pro (Manual URL Paste)`
80-
3. paste the full redirect URL after login completes in the browser
79+
2. choose `ChatGPT Plus/Pro MULTI (Device Code)`
80+
3. open the verification link, enter the one-time code, and wait for login to finish
81+
4. if device code is unavailable on your auth server, fall back to `ChatGPT Plus/Pro MULTI (Manual URL Paste)`
8182

8283
## Add the Plugin to OpenCode
8384

docs/troubleshooting.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ Failed to access Codex API
182182

183183
1. **Manual URL paste:**
184184
- Re-run `opencode auth login`
185-
- Select **"ChatGPT Plus/Pro (Manual URL Paste)"**
186-
- Paste the full redirect URL after login
185+
- Select **"ChatGPT Plus/Pro MULTI (Device Code)"** first if you are on SSH, WSL, or a headless machine
186+
- If device code is unavailable, fall back to **"ChatGPT Plus/Pro MULTI (Manual URL Paste)"**
187+
- Paste the full redirect URL after login when using the manual flow
187188

188189
2. **Check port 1455 availability:**
189190
```bash
@@ -207,7 +208,7 @@ Failed to access Codex API
207208
**Solutions:**
208209
- Re-run `opencode auth login` to generate a fresh URL
209210
- Open the URL directly in browser (don't use a stale link)
210-
- For SSH/WSL/remote, use **"Manual URL Paste"** option
211+
- For SSH/WSL/remote, use **"Device Code"** first, then **"Manual URL Paste"** if needed
211212

212213
</details>
213214

@@ -617,7 +618,7 @@ ssh -L 1455:localhost:1455 user@remote
617618

618619
**Docker / Containers:**
619620
- OAuth with localhost redirect doesn't work in containers
620-
- Use SSH port forwarding or manual URL flow
621+
- Use Device Code first, then SSH port forwarding or manual URL flow if needed
621622

622623
</details>
623624

0 commit comments

Comments
 (0)