JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 112
  • Score
    100M100P100Q77129F
  • License MIT

AI API proxy server routing through GitHub Copilot

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:

  1. CLI entry passes process.env to @guanghechen/commander/node.
  2. Commander merges user envs with preset envs into ctx.envs.
  3. Runtime logic consumes ctx.envs only.

There is no runtime fallback from business logic to global process.env for critical keys such as:

  • GH_PRIMARY_TOKEN
  • COPILOT_MODEL_REFRESH_SEC

Preset Root And .env.local

Preset root:

  • $XDG_CONFIG_HOME/kit/copilot when XDG_CONFIG_HOME is set
  • ~/.config/kit/copilot otherwise

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_TOKEN is not persisted

Examples

kit-copilot auth
kit-copilot start --port=4141

With preset env file:

GH_PRIMARY_TOKEN=ghu_xxx
COPILOT_MODEL_REFRESH_SEC=300