Skip to content

Commit 8a92f88

Browse files
authored
Merge pull request #1 from square/install_hints_startup
prompt for install
2 parents 3983b3c + bcd3778 commit 8a92f88

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/extension.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@ import * as vscode from 'vscode';
22
import * as fs from 'fs';
33
import * as os from 'os';
44
import * as path from 'path';
5+
import { execSync } from 'child_process';
56

67
let gooseTerminal: vscode.Terminal | undefined;
78
const terminalName = '🪿 goose agent 🪿';
89
const tempFilePath = path.join(os.tmpdir(), 'goose_open_files.txt');
910
const tempFilePathDirty = path.join(os.tmpdir(), 'goose_unsaved_files.txt');
1011

11-
1212
export function activate(context: vscode.ExtensionContext) {
13-
vscode.window.showInformationMessage('goose agent activated');
13+
14+
// Check if goose CLI is installed
15+
try {
16+
execSync('goose');
17+
} catch (error) {
18+
const installUrl = 'https://github.com/square/goose-vscode';
19+
vscode.window.showErrorMessage('Goose CLI is required to be installed', { modal: true }, 'Install').then(selection => {
20+
if (selection === 'Install') {
21+
vscode.env.openExternal(vscode.Uri.parse(installUrl));
22+
}
23+
});
24+
return; // Exit activation if goose is not installed
25+
}
26+
27+
vscode.window.showInformationMessage('goose agent starting - this may take a minute.. 🕐');
28+
1429

1530
const updateOpenFiles = () => {
1631
const openTextDocuments = vscode.workspace.textDocuments.filter(doc => !(doc.fileName.startsWith('git') || doc.fileName.endsWith('.git')));

0 commit comments

Comments
 (0)