Package Exports
- @guanghechen/kit-copilot
- @guanghechen/kit-copilot/cli
Readme
@guanghechen/kit-copilot
GitHub Copilot proxy server for Claude, Codex, and Gemini compatible endpoints.
Environment Model
kit-copilot follows a strict environment flow:
- CLI entry passes
process.envto@guanghechen/commander/node. - Commander merges user envs with preset envs into
ctx.envs. - Runtime logic consumes
ctx.envsonly.
There is no runtime fallback from business logic to global process.env for critical keys such as:
GH_PRIMARY_TOKENCOPILOT_MODEL_REFRESH_SEC
Preset Root And .env.local
Preset root:
$XDG_CONFIG_HOME/kit/copilotwhenXDG_CONFIG_HOMEis set~/.config/kit/copilototherwise
Default preset env file:
<preset-root>/.env.local
The file is loaded by commander preset logic and merged into ctx.envs.
Token Persistence
kit-copilot auth persists GH_PRIMARY_TOKEN to preset env storage.
- Persist target:
<preset-root>/.env.local GH_COPILOT_TOKENis not persisted
Examples
kit-copilot auth
kit-copilot start --port=4141With preset env file:
GH_PRIMARY_TOKEN=ghu_xxx
COPILOT_MODEL_REFRESH_SEC=300