* `~/.copilot` existing is NOT proof the CLI is installed: the VS Code * Copilot Chat extension drops MCP socket-handoff lock files into * `~/.copilot/ide/` on launch, so a machine with only the VS Code * extension still has the dir (with a lone `ide` entry). Count the dir * as a CLI footprint o
()
| 66 | * on first run. |
| 67 | */ |
| 68 | function cliConfigDirPresent(): boolean { |
| 69 | let entries: string[]; |
| 70 | try { |
| 71 | entries = fs.readdirSync(configDir()); |
| 72 | } catch { |
| 73 | return false; |
| 74 | } |
| 75 | return entries.some((e) => e !== 'ide'); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Best-effort check that the `copilot` binary is reachable on PATH. |