feat: add GitHub Copilot provider

Copilot device login + onboarding option; model list auth detection.
This commit is contained in:
Mustafa Tag Eldeen authored and Peter Steinberger committed 2026-01-12 16:52:15 +00:00
1 parent 717a259056
commit 3da1afed68
19 files changed
+926 -1122

No files matched your search

+26
View File
@@ -1,6 +1,7 @@
import type { Command } from "commander";
import {
githubCopilotLoginCommand,
modelsAliasesAddCommand,
modelsAliasesListCommand,
modelsAliasesRemoveCommand,
@@ -374,6 +375,31 @@ export function registerModelsCli(program: Command) {
}
});
auth
.command("login-github-copilot")
.description(
"Login to GitHub Copilot via GitHub device flow (TTY required)",
)
.option(
"--profile-id <id>",
"Auth profile id (default: github-copilot:github)",
)
.option("--yes", "Overwrite existing profile without prompting", false)
.action(async (opts) => {
try {
await githubCopilotLoginCommand(
{
profileId: opts.profileId as string | undefined,
yes: Boolean(opts.yes),
},
defaultRuntime,
);
} catch (err) {
defaultRuntime.error(String(err));
defaultRuntime.exit(1);
}
});
const order = auth
.command("order")
.description("Manage per-agent auth profile order overrides");