- Introduced environment variable CLAUDE_CODE_USE_GITHUB to enable GitHub Models. - Added checks for GITHUB_TOKEN or GH_TOKEN for authentication. - Updated base URL handling to include GitHub Models default. - Enhanced provider detection and error handling for GitHub Models. - Updated relevant functions and components to accommodate the new provider.
1.4 KiB
1.4 KiB
GitHub Models + onboard — PR draft (paste into GitHub)
Title: feat: GitHub Models provider + interactive onboard (keychain-backed)
Body:
Summary
- Adds GitHub Models (
models.github.ai) as an OpenAI-compatible backend viaCLAUDE_CODE_USE_GITHUB(see existing shim changes). - Adds
/onboard-github: interactive Ink flow for GitHub Device Login or PAT, stores token in OS-backed secure storage (macOS Keychain when available, else~/.claude/.credentials.json), and writes user settingsenvso noexport GITHUB_TOKENis required. - Applies user settings before provider env validation and hydrates
GITHUB_TOKENfrom secure storage when the GitHub provider flag is on.
How to test
- Run
openclaudeand execute/onboard-github(or launch via command registration). - Complete device flow or paste a PAT with Models access.
- Restart CLI; confirm
CLAUDE_CODE_USE_GITHUB=1in~/.claude/settings.json(or merged file) and that inference works without exportingGITHUB_TOKEN. bun test(new suites) +bun run build.
Notes / follow-ups
- Device flow OAuth app client ID is configurable via
GITHUB_DEVICE_FLOW_CLIENT_ID; verify scope list against current GitHub Models documentation. /logoutcurrently deletes all secure storage; GitHub token is cleared too — document or narrow in a follow-up.- Linux: secure storage is plaintext with chmod 600 today; libsecret is still TODO in
secureStorage.