Skip to content

Commit ca2c7f9

Browse files
committed
feat: trim oauth env var and update docs
1 parent ca803ba commit ca2c7f9

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ A reverse-engineered proxy for the GitHub Copilot API that exposes it as an Open
4040
- **Flexible Authentication**: Authenticate interactively or provide a GitHub token directly, suitable for CI/CD environments.
4141
- **Support for Different Account Types**: Works with individual, business, and enterprise GitHub Copilot plans.
4242
- **Opencode OAuth Support**: Use opencode GitHub Copilot authentication by setting `COPILOT_API_OAUTH_APP=opencode` environment variable.
43+
- **GitHub Enterprise Support**: Connect to GHE.com by setting `COPILOT_API_ENTERPRISE_URL` environment variable (e.g., `company.ghe.com`).
44+
- **Custom Data Directory**: Change the default data directory (where tokens and config are stored) by setting `COPILOT_API_HOME` environment variable.
4345

4446
## Demo
4547

src/lib/api-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto"
33
import type { State } from "./state"
44

55
export const isOpencodeOauthApp = (): boolean => {
6-
return process.env.COPILOT_API_OAUTH_APP === "opencode"
6+
return process.env.COPILOT_API_OAUTH_APP?.trim() === "opencode"
77
}
88

99
export const normalizeDomain = (input: string): string => {

src/lib/paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from "node:fs/promises"
22
import os from "node:os"
33
import path from "node:path"
44

5-
const AUTH_APP = process.env.COPILOT_API_OAUTH_APP || ""
5+
const AUTH_APP = process.env.COPILOT_API_OAUTH_APP?.trim() || ""
66
const ENTERPRISE_PREFIX = process.env.COPILOT_API_ENTERPRISE_URL ? "ent_" : ""
77

88
const DEFAULT_DIR = path.join(os.homedir(), ".local", "share", "copilot-api")

0 commit comments

Comments
 (0)