{"id":44512261,"url":"https://github.com/animeshkundu/github-router","last_synced_at":"2026-06-13T06:01:55.752Z","repository":{"id":337524696,"uuid":"1154015381","full_name":"animeshkundu/github-router","owner":"animeshkundu","description":"Power Claude Code, Codex CLI, and more with your Copilot subscription.","archived":false,"fork":false,"pushed_at":"2026-06-08T06:47:56.000Z","size":4787,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-08T08:24:35.757Z","etag":null,"topics":["anthropic","claude-cli","claude-code","codex","codex-cli","github-copilot","openai","proxy"],"latest_commit_sha":null,"homepage":"https://animesh.kundus.in/github-router/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/animeshkundu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-09T23:26:12.000Z","updated_at":"2026-06-08T06:43:13.000Z","dependencies_parsed_at":"2026-04-30T07:03:53.449Z","dependency_job_id":null,"html_url":"https://github.com/animeshkundu/github-router","commit_stats":null,"previous_names":["animeshkundu/github-router"],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/animeshkundu/github-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeshkundu%2Fgithub-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeshkundu%2Fgithub-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeshkundu%2Fgithub-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeshkundu%2Fgithub-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/animeshkundu","download_url":"https://codeload.github.com/animeshkundu/github-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animeshkundu%2Fgithub-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34273788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic","claude-cli","claude-code","codex","codex-cli","github-copilot","openai","proxy"],"created_at":"2026-02-13T15:25:20.206Z","updated_at":"2026-06-13T06:01:55.705Z","avatar_url":"https://github.com/animeshkundu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-router\n\n[![CI](https://github.com/animeshkundu/github-router/actions/workflows/ci.yml/badge.svg)](https://github.com/animeshkundu/github-router/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/github-router)](https://www.npmjs.com/package/github-router)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nUse your GitHub Copilot subscription to power **Claude Code**, **Codex CLI**, or any OpenAI/Anthropic-compatible tool.\n\ngithub-router is a local reverse proxy that translates standard API formats to GitHub Copilot's backend. One command to start, copy-paste configs for your tools.\n\n\u003e [!WARNING]\n\u003e Unofficial. Not supported by GitHub. May break. Use responsibly.\n\u003e Review the [GitHub Copilot Terms](https://docs.github.com/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot) and [Acceptable Use Policies](https://docs.github.com/site-policy/acceptable-use-policies/github-acceptable-use-policies#4-spam-and-inauthentic-activity-on-github).\n\n## Quick Start\n\n```sh\n# 1. Authenticate (one-time)\nnpx github-router@latest auth\n\n# 2. Start the proxy\nnpx github-router@latest start\n```\n\nThe server runs at `http://localhost:8787`. Now pick your tool below.\n\n---\n\n## Use with Claude Code\n\n**Option A: One-shot subcommand (recommended)**\n\n```sh\nnpx github-router@latest claude\n```\n\nBoots the proxy on a random port and spawns Claude Code wired to it. Sets `ANTHROPIC_MODEL=claude-opus-4-8` (Anthropic's dashed slug — Claude Code's `/model` UI displays this as menu entry \"Opus 4.8 (1M context)\"). The proxy translates to Copilot's `claude-opus-4.8` at request time (single base slug; the catalog entry's `max_context_window_tokens` already advertises 1M context — no `-1m` sibling needed for 4.8). Major.minor fallback chain: `claude-opus-4-7` → `claude-opus-4-6` → `claude-opus-4-5`. Override with `-m`:\n\n```sh\nnpx github-router@latest claude -m claude-opus-4-8\n```\n\nThe launcher sanitizes parent-env auth keys and sets `CLAUDE_CONFIG_DIR=$HOME/.claude` so the spawned `claude` ignores any persisted Console OAuth credential without requiring `claude /logout`. Settings, MCP servers, hooks, and CLAUDE.md auto-discovery still load from `~/.claude` as normal.\n\n**Option B: Interactive launch-command generator**\n\n```sh\nnpx github-router@latest start --claude-code\n```\n\nSelect your models, a launch command gets copied to your clipboard. Paste it in a new terminal.\n\n**Option C: Copy-paste config**\n\nCreate `.claude/settings.json` in your project:\n\n```json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"http://localhost:8787\",\n    \"ANTHROPIC_API_KEY\": \"dummy\",\n    \"ANTHROPIC_AUTH_TOKEN\": \"dummy\",\n    \"ANTHROPIC_MODEL\": \"gpt-4.1\",\n    \"ANTHROPIC_DEFAULT_SONNET_MODEL\": \"gpt-4.1\",\n    \"ANTHROPIC_SMALL_FAST_MODEL\": \"gpt-4.1-mini\",\n    \"ANTHROPIC_DEFAULT_HAIKU_MODEL\": \"gpt-4.1-mini\",\n    \"DISABLE_NON_ESSENTIAL_MODEL_CALLS\": \"1\",\n    \"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC\": \"1\"\n  },\n  \"permissions\": {\n    \"deny\": [\"WebSearch\"]\n  }\n}\n```\n\nThen run `claude` as normal.\n\n### Peer-MCP review subagents\n\n`github-router claude` auto-wires four peer-model adversarial reviewers plus a coordinator into the spawned Claude Code session. No setup, no prior MCP config, no `.claude/agents/` files needed — they appear as Task `subagent_type` options the session can delegate to. Opt out with `--no-codex-mcp`.\n\nEach persona is exposed both as a Claude Code subagent (callable via the `Task` tool) AND as an MCP tool at `mcp__peers__\u003cname\u003e`. Personas are stateless: each invocation runs a fresh request against its model with a baked persona prompt — they have no access to your scrollback or project memory, so the lead must paste the artifact into the brief.\n\n| Subagent | Model | Endpoint | Effort tiers (default) |\n|---|---|---|---|\n| `codex-critic` | gpt-5.5 | `/v1/responses` | low \\| medium \\| high \\| xhigh (xhigh) |\n| `codex-reviewer` | gpt-5.3-codex | `/v1/responses` | low \\| medium \\| high \\| xhigh (xhigh) |\n| `gemini-reviewer` | gemini-3.1-pro-preview | `/v1/chat/completions` | low \\| medium \\| high (high) |\n| `opus-critic` | claude-opus-4-6 | `/v1/messages` | low \\| medium \\| high (high) |\n| `gemini-critic` | gemini-3.1-pro-preview | `/v1/chat/completions` | low \\| medium \\| high (high) |\n| `peer-review-coordinator` | (meta) | — | — |\n\n`peer-review-coordinator` is a subagent (not an MCP tool) that fans out to the right combination of the critics in parallel based on artifact type — plan, diff, single file, or long-context — and aggregates findings.\n\n**Effort tiers** are exposed via the MCP tool's `effort` argument; subagents pass it through. `xhigh` routinely runs 60–90s; the proxy responds to `tools/call` requests with SSE-streamed responses (per MCP 2025-06-18 Streamable HTTP transport spec) so the connection stays open past the standard ~60s MCP per-tool-call ceiling and long calls complete transparently with no user setup.\n\n`gemini-critic` and `gemini-reviewer` both register only when `gemini-3.1-pro-preview` (or another `gemini-3.x-pro` model) is present in your Copilot model catalog — `gemini-critic` is the architecture-level critic, `gemini-reviewer` the line-level second-lab code reviewer on the same model at its highest reasoning tier. If absent, both personas are silently dropped from the MCP `tools/list` and the subagent set, and `peer-review-coordinator` skips them in routing decisions.\n\nFor codex-side write capability (a `codex-implementer` persona that can mutate files via Codex's tool-use sandbox), pass `--codex-cli`. Requires `codex` CLI 0.129+ on `PATH`; falls back to HTTP-only with a warning if codex is missing or older. Pass `--codex-mcp-only` to also pass `--strict-mcp-config` to Claude Code so only the proxy's MCP servers are loaded (hides any MCP servers in your existing `~/.claude/mcp.json`).\n\n### Code search (`mcp__search__code`)\n\nAlongside the peer reviewers, the same MCP surface exposes a `code` tool (under the `search` server — `mcp__search__code`) — fast structured code search over the workspace, ranked by **BM25F** (Robertson, Zaragoza, Taylor 2004) over four code-aware fields: matched line, surrounding context, file path tokens, and a symbol-definition heuristic. On top of that, the top hits get a tree-sitter pass that promotes true identifier-definition sites over incidental string matches; depth is controlled by the optional `structural` argument (`\"full\"` parses the top 50 hits, `\"topN\"` parses the top 10 for tighter latency on big repos). A single `notice` field surfaces in the response on the rare occasions an actionable degradation fires — the structural pass overran its 200ms wall-clock budget, or the response hit the 256KB size cap and was truncated; the message text tells the model what to retry. Defaults to a semantic mode (`mode: \"semantic\"`): it ranks by MEANING via ColBERT over a per-workspace index, and transparently falls back to lexical BM25F when that index isn't ready (building / stale / not yet provisioned), labelling the response `source` (`semantic`, `lexical`, or `lexical-fallback`) so a degrade is never silent. The `lexical` mode is the BM25F + tree-sitter path with shoulder pruning (best for exact symbols); `exact` and `regex` force fixed-string / PCRE2 search, and `ast` matches ast-grep structural patterns. Single-identifier queries in the lexical modes auto-expand across camelCase / snake_case / kebab-case skeletons so `getUserName` also matches `get_user_name`. (This one tool absorbs what was previously a separate `semantic_search` tool; ColBERT semantic search is just its default mode.)\n\n`workspace` is any absolute path the proxy process can read — typically the project root or a sub-tree you're working in. The model picks it. There's no allow-set or secret-shape file denylist: the threat model is symmetric since Claude Code already has Read / Bash / Edit tools that reach the same paths, so gating one tool would have been inconsistency rather than defense. Paths in results are returned relative to the workspace, never absolute.\n\nRipgrep is provided via the `@vscode/ripgrep` npm dependency (per-platform binary via `optionalDependencies` — no postinstall script needed). The proxy prefers system `rg` on `PATH` when available and falls back to the bundled binary otherwise. To opt into raw query/path logging for debugging, set `GH_ROUTER_DEBUG_CODE_SEARCH=1` — by default the proxy logs only counts and timings.\n\n---\n\n## Use with Codex CLI\n\nThe fastest path is the `codex` subcommand — it boots the proxy on a random port and spawns Codex CLI wired to it:\n\n```sh\nnpx github-router@latest codex\n```\n\nDefaults to `gpt-5.5`; falls back to `gpt-5.4` → `gpt-5.3-codex` → `gpt-5.2-codex` if your Copilot tier doesn't expose 5.5 yet. Override with `-m`:\n\n```sh\nnpx github-router@latest codex -m gpt-5.3-codex\n```\n\nOr run the proxy and Codex CLI separately:\n\n```sh\nnpx github-router@latest start --codex   # interactive launch-command generator\n# — or set env vars yourself —\nexport OPENAI_BASE_URL=\"http://localhost:8787/v1\"\nexport OPENAI_API_KEY=\"dummy\"\ncodex --full-auto -m gpt-5.5\n```\n\n---\n\n## Use with any OpenAI-compatible tool\n\nPoint any tool at `http://localhost:8787/v1`:\n\n```sh\ncurl http://localhost:8787/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\": \"gpt-4.1\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]}'\n```\n\n---\n\n## API Endpoints\n\n| Endpoint | Method | Format |\n|---|---|---|\n| `/v1/chat/completions` | POST | OpenAI Chat Completions |\n| `/v1/responses` | POST | OpenAI Responses (Codex models) |\n| `/v1/messages` | POST | Anthropic Messages |\n| `/v1/messages/count_tokens` | POST | Anthropic token counting |\n| `/v1/models` | GET | OpenAI model list |\n| `/v1/embeddings` | POST | OpenAI embeddings |\n| `/v1/search` | POST | Web search |\n| `/usage` | GET | Copilot usage \u0026 quotas |\n\nOpenAI-compatible endpoints are also available without the `/v1` prefix (for example, `/chat/completions`).\nAnthropic endpoints are only available under `/v1/messages`.\n\n\u003cdetails\u003e\n\u003csummary\u003eModel / endpoint compatibility\u003c/summary\u003e\n\n| Model | /chat/completions | /responses | /v1/messages |\n|---|---|---|---|\n| gpt-4.1, gpt-4o | Yes | Yes | No |\n| gpt-5.5, gpt-5.4 | No | Yes | No |\n| gpt-5.3-codex, gpt-5.2-codex | No | Yes | No |\n| claude-opus-4.8 (1M context as the single base slug) | Yes | No | Yes |\n| claude-opus-4.7-1m-internal (enterprise), claude-opus-4.7 | Yes | No | Yes |\n| claude-opus-4.6-1m, claude-opus-4.6, claude-sonnet-4.6 | Yes | No | Yes |\n| o3, o4-mini | Yes | Yes | No |\n\n\u003c/details\u003e\n\n---\n\n## Docker\n\nPre-built images on GitHub Container Registry:\n\n```sh\ndocker pull ghcr.io/animeshkundu/github-router:latest\ndocker run -p 8787:8787 -e GH_TOKEN=your_token ghcr.io/animeshkundu/github-router\n```\n\nOr build locally:\n\n```sh\ndocker build -t github-router .\ndocker run -p 8787:8787 -e GH_TOKEN=your_token github-router\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eDocker Compose\u003c/summary\u003e\n\n```yaml\nservices:\n  github-router:\n    build: .\n    ports:\n      - \"8787:8787\"\n    environment:\n      - GH_TOKEN=your_github_token_here\n    restart: unless-stopped\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePersistent token storage\u003c/summary\u003e\n\n```sh\nmkdir -p ./github-router-data\ndocker run -p 8787:8787 -v $(pwd)/github-router-data:/root/.local/share/github-router github-router\n```\n\n\u003c/details\u003e\n\n---\n\n## CLI Reference\n\n```\ngithub-router start [options]    Start the proxy server\ngithub-router claude [options]   Start proxy + spawn Claude Code wired to it\ngithub-router codex [options]    Start proxy + spawn Codex CLI wired to it\ngithub-router auth               Authenticate with GitHub\ngithub-router check-usage        Show Copilot usage/quotas\ngithub-router debug              Print diagnostic info\n```\n\nThe `claude` and `codex` subcommands accept all the shared flags below plus `-m`/`--model` to override the default model. Default models live in `src/lib/port.ts`:\n\n- `claude` → `claude-opus-4-8` (Anthropic dashed slug for UI compatibility; the proxy translates to Copilot's `claude-opus-4.8` — the single base slug already advertises 1M context via `max_context_window_tokens`, so no `-1m` sibling exists). Major.minor fallback chain: `claude-opus-4-7` → `claude-opus-4-6` → `claude-opus-4-5`.\n- `codex` → `gpt-5.5` → `gpt-5.4` → `gpt-5.3-codex` → `gpt-5.2-codex`\n\nFallback chains fire only on the implicit-default path; explicit `-m`/`--model` is always respected as-is.\n\n| Flag | Description | Default |\n|---|---|---|\n| `--port, -p` | Port | 8787 |\n| `--verbose, -v` | Debug logging | false |\n| `--account-type, -a` | `individual` / `business` / `enterprise` | individual |\n| `--rate-limit, -r` | Min seconds between requests | - |\n| `--wait, -w` | Queue requests instead of rejecting on rate limit | false |\n| `--manual` | Approve each request manually | false |\n| `--github-token, -g` | Pass token directly (skip auth flow) | - |\n| `--claude-code, -c` | Generate Claude Code launch command | false |\n| `--codex` | Generate Codex CLI launch command | false |\n| `--show-token` | Print tokens to console | false |\n| `--proxy-env` | Use HTTP_PROXY/HTTPS_PROXY env vars | false |\n\nAdditional flags accepted only by the `claude` subcommand:\n\n| Flag | Description | Default |\n|---|---|---|\n| `--model, -m` | Override the default Claude model | claude-opus-4-8 |\n| `--codex-mcp` / `--no-codex-mcp` | Wire peer-MCP review subagents (codex-critic / opus-critic / gemini-critic / codex-reviewer / peer-review-coordinator) into the spawned session | true |\n| `--codex-cli` | Add a `codex mcp-server` stdio backend so `codex-implementer` can mutate files. Requires codex CLI 0.129+; falls back to HTTP-only if absent | false |\n| `--codex-mcp-only` | Pass `--strict-mcp-config` to Claude Code so only the proxy's MCP servers load (hides any user MCP servers in `~/.claude/mcp.json`) | false |\n| `--stealth` | Opt back into VS Code-only beta-header filtering. Loses leverage features (task budgets, token-efficient tools, prompt caching, etc.) but minimizes the wire-fingerprint diff from VS Code Copilot Chat | false |\n| `--auto-update` / `--no-auto-update` | Check for and install latest Claude Code on launch (throttled to once per hour). Falls back gracefully if npm/network unavailable | true |\n| `--update-check` / `--no-update-check` | Check the npm registry for a newer Claude Code version on launch and warn if stale (~500ms cost). `--no-update-check` implies no auto-install | true |\n\n---\n\n## Development\n\n```sh\nbun install          # Install deps\nbun run dev          # Dev server with hot reload\nbun test             # Run tests\nbun run lint:all     # Lint\nbun run typecheck    # Type check\nbun run build        # Build for distribution\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimeshkundu%2Fgithub-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimeshkundu%2Fgithub-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimeshkundu%2Fgithub-router/lists"}