Skip to content

feat: add VS Code & Copilot CLI as editor targets#46

Merged
rhuanbarreto merged 13 commits into
mainfrom
feat/vscode-copilot-cli-support
Mar 10, 2026
Merged

feat: add VS Code & Copilot CLI as editor targets#46
rhuanbarreto merged 13 commits into
mainfrom
feat/vscode-copilot-cli-support

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

  • Adds VS Code (--editor vscode) and Copilot CLI (--editor copilot) as new editor targets for archgate init
  • VS Code: configures .vscode/settings.json with git marketplace URL + MCP server (additive merge)
  • Copilot CLI: auto-installs via copilot plugin install with CLI detection, falls back to manual instructions; configures .github/copilot/mcp.json
  • Both use the same git-based plugin format already served by plugins.archgate.dev — no backend changes needed
  • Documentation guides added for both editors with sidebar entries

New files

  • src/helpers/vscode-settings.ts — VS Code settings merge + configure
  • src/helpers/copilot-settings.ts — Copilot CLI MCP config merge + configure
  • docs/src/content/docs/guides/vscode-plugin.mdx
  • docs/src/content/docs/guides/copilot-cli-plugin.mdx

Modified files

  • src/helpers/plugin-install.ts — VS Code + Copilot CLI install functions
  • src/helpers/init-project.tsEditorTarget type extended, editor routing
  • src/commands/init.ts — 4-editor support, refactored output with lookup tables
  • docs/astro.config.mjs — sidebar entries for new guides

Note

pt-br translations for the two new guide pages are not included (no existing pt-br/guides/ translations exist yet).

Test plan

  • bun run typecheck passes
  • bun run lint passes (no new warnings)
  • bun test — all 240 tests pass
  • archgate init --editor vscode creates .vscode/settings.json with marketplace URL + MCP server
  • archgate init --editor copilot creates .github/copilot/mcp.json and attempts copilot plugin install
  • Existing --editor claude and --editor cursor flows unchanged
  • Docs site builds and shows new guide pages in sidebar

🤖 Generated with Claude Code

rhuanbarreto and others added 13 commits March 4, 2026 23:36
Add support for two new editors in `archgate init`:
- VS Code (`--editor vscode`): configures .vscode/settings.json with
  the git marketplace URL and MCP server
- Copilot CLI (`--editor copilot`): auto-installs via `copilot plugin
  install` or prints manual commands, configures .github/copilot/mcp.json

Both use the same git-based plugin format already served by the plugins
service — no backend changes needed.

Includes documentation guides for both editors and sidebar entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bun.$ hangs on Windows due to pipe deadlocks — this was discovered in
production and fixed in ca33377. This commit:

- Creates ARCH-007 ADR mandating Bun.spawn over Bun.$ for all subprocess
  execution, with automated rule (no-bun-shell) that blocks Bun.$ usage
- Updates ARCH-006 to remove Bun.$ recommendations and add Windows caveat
- Cherry-picks the Bun.spawn migration from ca33377 (git-files, upgrade,
  plugin-install) and fixes remaining Bun.$ usage in git.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add test suites for vscode-settings and copilot-settings helpers
(ARCH-005 compliance). Add full Portuguese translations for the
VS Code and Copilot CLI plugin guide pages (GEN-002 compliance).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
VS Code uses a dedicated .vscode/mcp.json file for MCP servers (with
"servers" key), not .vscode/settings.json. The chat.plugins.marketplaces
setting is application-scoped and must be set in user-level settings.

Changes:
- Rewrite vscode-settings.ts to write .vscode/mcp.json (workspace)
  and user settings.json (marketplace URL) separately
- Auto-detect user settings path per platform (Win/Mac/Linux)
- Remove installVscodePlugin from plugin-install.ts (no longer needed)
- Update docs (en + pt-br) to reflect the two-file approach
- Update tests for new merge functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agent plugins require VS Code February 2026 release (1.99) or later.
Added caution callout to both English and pt-br guide pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
VS Code settings.json and mcp.json use JSONC (JSON with Comments) which
includes single-line comments, block comments, and trailing commas.
JSON.parse() fails on these files. Use Bun's built-in JSONC parser instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use Bun.JSONC.parse to read existing user settings.json (supports
comments and trailing commas), merge the marketplace URL additively,
and write back. All existing settings data is preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
VS Code has built-in defaults for chat.plugins.marketplaces (github/copilot-plugins,
github/awesome-copilot) that are implicit — not written to settings.json. When we
explicitly set the key, VS Code stops using its defaults. Now we seed the array with
these defaults when the key is absent from the file, preventing silent override.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Override both APPDATA (Windows) and HOME (macOS/Linux) in tests so
getVscodeUserSettingsPath() resolves into the temp directory on all
platforms. Use the real path resolver in tests instead of hardcoding
Windows-specific paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
VS Code Copilot expects .github/plugin/ manifest format, which is
served from a separate virtual git repo at /archgate-vscode.git.
Claude Code and Copilot CLI continue using /archgate.git with the
.claude-plugin/ format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rhuanbarreto rhuanbarreto merged commit 86ce264 into main Mar 10, 2026
6 checks passed
@rhuanbarreto rhuanbarreto deleted the feat/vscode-copilot-cli-support branch March 10, 2026 12:37
@archgatebot archgatebot Bot mentioned this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant