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