Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/commands/plugin/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ export function registerPluginInstallCommand(plugin: Command) {
await installCopilotPlugin();
logInfo(`Archgate plugin installed for ${label}.`);
} else {
const url = buildMarketplaceUrl();
const url = buildVscodeMarketplaceUrl();
logWarn(
"Copilot CLI not found. To install the plugin manually, run:"
);
console.log(
` ${styleText("bold", "copilot plugin install")} ${url}`
` ${styleText("bold", "copilot plugin marketplace add")} ${url}`
);
console.log(
` ${styleText("bold", "copilot plugin install")} archgate@archgate`
);
}
break;
Expand Down
20 changes: 17 additions & 3 deletions src/helpers/plugin-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,30 @@ export async function isCopilotCliAvailable(): Promise<boolean> {
* Install the archgate plugin via the `copilot` CLI.
*
* Runs:
* copilot plugin install <authenticated-git-url>
* copilot plugin marketplace add <vscode-marketplace-url>
* copilot plugin install archgate@archgate
*
* Throws on failure so the caller can fall back to manual instructions.
*/
export async function installCopilotPlugin(): Promise<void> {
const url = buildMarketplaceUrl();
const url = buildVscodeMarketplaceUrl();
const cmd = (await resolveCommand("copilot")) ?? "copilot";

logDebug("Adding archgate marketplace to copilot CLI");
const addResult = await run([cmd, "plugin", "marketplace", "add", url]);
if (addResult.exitCode !== 0) {
throw new Error(
`copilot plugin marketplace add failed (exit ${addResult.exitCode})`
);
}

logDebug("Installing archgate plugin via copilot CLI");
const installResult = await run([cmd, "plugin", "install", url]);
const installResult = await run([
cmd,
"plugin",
"install",
"archgate@archgate",
]);
if (installResult.exitCode !== 0) {
throw new Error(
`copilot plugin install failed (exit ${installResult.exitCode})`
Expand Down
Loading