⚠️ WARNING: This library may violate GitHub Copilot's Terms of Service. Using this library to access GitHub Copilot without proper authorization may result in account suspension or termination. This project is for educational and research purposes only. Use at your own risk and ensure you have appropriate authorization before using this library.
Multi-language OAuth2 Device Flow implementation for GitHub Copilot and Hyper services.
- 📖 Usage Guide - Comprehensive examples and tutorials for all languages
- 🏗️ Design Document - Architecture and implementation details
- 🌐 中文设计文档 - Chinese design documentation
| Language | Directory | Documentation |
|---|---|---|
| Go | go/ | English / 中文 |
| Python | python/ | English / 中文 |
| TypeScript | ts/ | English / 中文 |
- OAuth2 Device Authorization Flow (RFC 8628)
- Token caching from official Copilot client
- Custom HTTP client with X-Initiator header injection
- Token refresh support
- Device authorization flow
- Token exchange
- Token introspection (RFC 7662)
- Configurable base URL via environment variable
- Unified token structure across all implementations
- Automatic expiration calculation
- 10% buffer for token refresh
- JSON serialization support
All implementations include:
- 30-second HTTP request timeouts
- 1MB response size limits
- Token refresh before expiration
cd go
go build ./...See Go Documentation for detailed usage.
cd python
pip install -e .See Python Documentation for detailed usage.
cd ts
npm install
npm run buildSee TypeScript Documentation for detailed usage.
- Name: Shibo Li
- Email: shadow.li981@gmail.com
This project is inspired by and references:
MIT License