GitHub Copilot CLI brings the Copilot coding agent to your terminal: it reads code, edits files, runs commands and looks up issues/PRs. It is a closed-source tool (npm package @github/copilot, proprietary licence, no source). In its default mode it goes through GitHub's own model routing, which needs a signed-in GitHub account plus an active Copilot subscription (billed in premium requests). But it ships an official BYOK (bring-your-own-key) mode: set COPILOT_PROVIDER_BASE_URL and requests go straight to the OpenAI-compatible endpoint you name - the official docs state GitHub authentication is not required in that mode. Point that variable at our gateway and it works; this page only shows how to connect, we do not manage your GitHub account or subscription.
base_url or *_BASE_URL setting./v1 for anything speaking the OpenAI wire (/v1/chat/completions).GET /v1/models.Skip it — one-line setup
The script installs GitHub Copilot CLI from its official source, writes the gateway settings into the
tool's own config file (backing up any existing one) and runs a live check. It asks for your gateway key, or
take it from --key / --key-file. --uninstall restores exactly what it wrote.
curl -fsSL https://quantoport.com/agents/copilot-cli/setup | bash
1 · Install
Install GitHub Copilot CLI from its own official source.
npm install -g @github/copilot # needs Node.js 20+; or use the official installer: curl -fsSL https://gh.io/copilot-install | bash; Windows: winget install GitHub.Copilot
2 · Configure — point it at QuantoPort
Gateway base URL https://quantoport.com; get your key from the console.
BYOK is official and is driven purely by environment variables (there is no config-file setting for it): 1) Set four variables (base URL points at the gateway's OpenAI-compatible path, including /v1): export COPILOT_PROVIDER_BASE_URL="https://quantoport.com/v1" export COPILOT_PROVIDER_TYPE="openai" export COPILOT_PROVIDER_API_KEY="YOUR_API_KEY" export COPILOT_MODEL="YOUR_MODEL" On the China endpoint use base_url https://api.shinlinkai.com/v1 (OpenAI-compatible /v1/chat/completions only). 2) Recommended: put those four lines in a file under ~/.copilot/ (chmod 600) and source it from ~/.bashrc. 3) Non-interactive/scripted runs must add --allow-all-tools (or export COPILOT_ALLOW_ALL=true), otherwise it waits for approval. 4) Back up ~/.bashrc and any existing env file before editing; our one-line script does that for you.
3 · Verify
One request proves you are on our channel.
copilot -p "reply with OK" --allow-all-tools -s # Expected output: OK (this already runs through the gateway; add -v or check ~/.copilot/logs/ to see requests going to COPILOT_PROVIDER_BASE_URL)
4 · Common pitfalls
- GitHub Copilot CLI is closed source: the npm package is @github/copilot, LICENSE.md is proprietary, and no source is provided.
- Keep the two modes apart: default mode = GitHub account + active Copilot subscription, models routed by GitHub, billed in premium requests;
BYOKmode = the official docs state GitHub authentication is not required and requests go straight to COPILOT_PROVIDER_BASE_URL. Connecting to our gateway uses BYOK. - We only provide the connection method; we do not manage or resell your GitHub account or subscription.
BYOKis environment-variable only; after writing an env file, source it in a new shell (or re-open the terminal) - you can also export once in the current session.- The model name must be one the gateway actually serves;
COPILOT_PROVIDER_WIRE_MODELoverrides the model name sent to the gateway, whileCOPILOT_PROVIDER_MODEL_IDselects the agent-side model config (token limits, tool support). - Non-interactive runs (copilot -p) must add
--allow-all-toolsorCOPILOT_ALLOW_ALL=true, or it blocks waiting for tool approval. BYOKworks without a GitHub subscription; if a GitHub login is also present, theBYOKvariables take precedence.- Wire formats: both sites serve the OpenAI-compatible
/v1/chat/completions, which is whatBYOKuses by default; https://quantoport.comadditionally serves/v1/responses, so you may add exportCOPILOT_PROVIDER_WIRE_API="responses" (withCOPILOT_PROVIDER_TYPE=openai) there, while https://api.shinlinkai.comhas no/v1/responsesand that variable must not be set.
Sources for the tool-side steps: docs.github.com/en/copilot/how-tos/set-up/install-copilot-cl docs.github.com/en/copilot/concepts/agents/about-copilot-cli github.com/github/copilot-cli www.npmjs.com/package/@github/copilot