fix: copilot-cli integration
This commit is contained in:
parent
c4876ce0dc
commit
053839938b
@ -32,18 +32,10 @@ Or via Homebrew:
|
||||
brew install github/copilot/copilot
|
||||
```
|
||||
|
||||
Or use the `gh copilot` extension:
|
||||
|
||||
```bash
|
||||
gh extension install github/gh-copilot
|
||||
```
|
||||
|
||||
Verify installation:
|
||||
|
||||
```bash
|
||||
copilot --help
|
||||
# or
|
||||
gh copilot --help
|
||||
```
|
||||
|
||||
## Quick start
|
||||
|
||||
@ -85,10 +85,11 @@ const DEFAULT_CODEX_BACKEND: CliBackendConfig = {
|
||||
|
||||
const DEFAULT_COPILOT_CLI_BACKEND: CliBackendConfig = {
|
||||
command: "copilot",
|
||||
args: ["-p"],
|
||||
resumeArgs: ["-p", "--resume", "{sessionId}"],
|
||||
args: ["--allow-all-tools"],
|
||||
resumeArgs: ["--allow-all-tools", "--resume", "{sessionId}"],
|
||||
output: "text",
|
||||
input: "arg",
|
||||
promptArg: "-p",
|
||||
modelArg: "--model",
|
||||
modelAliases: COPILOT_CLI_MODEL_ALIASES,
|
||||
sessionIdFields: ["session_id", "sessionId"],
|
||||
|
||||
@ -445,7 +445,11 @@ export function buildCliArgs(params: {
|
||||
}
|
||||
}
|
||||
if (params.promptArg !== undefined) {
|
||||
args.push(params.promptArg);
|
||||
if (params.backend.promptArg) {
|
||||
args.push(params.backend.promptArg, params.promptArg);
|
||||
} else {
|
||||
args.push(params.promptArg);
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@ export function isCliProvider(provider: string, cfg?: MoltbotConfig): boolean {
|
||||
const normalized = normalizeProviderId(provider);
|
||||
if (normalized === "claude-cli") return true;
|
||||
if (normalized === "codex-cli") return true;
|
||||
if (normalized === "copilot-cli") return true;
|
||||
const backends = cfg?.agents?.defaults?.cliBackends ?? {};
|
||||
return Object.keys(backends).some((key) => normalizeProviderId(key) === normalized);
|
||||
}
|
||||
|
||||
@ -87,6 +87,8 @@ export type CliBackendConfig = {
|
||||
imageArg?: string;
|
||||
/** How to pass multiple images. */
|
||||
imageMode?: "repeat" | "list";
|
||||
/** Flag used to pass the prompt (e.g. -p, --prompt). */
|
||||
promptArg?: string;
|
||||
/** Serialize runs for this CLI. */
|
||||
serialize?: boolean;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user