These instructions apply to the entire repository.
Copilot CLI Launcher is a small, privacy-first VS Code extension published as a VSIX. It creates a fresh side terminal and starts a user-configured GitHub Copilot CLI command. The extension must remain unofficial, local-only, and free of telemetry, installers, or background network behavior.
The repository is public and MIT licensed. Treat everything committed here as world-readable: no internal endpoints, customer data, credentials, or unreleased claims.
- TypeScript compiled by
tsc(no bundler) to CommonJS-compatibleout/viamodule: NodeNext,target: ES2022,strict: true. - Runtime: the VS Code extension host. Declared engine floor is
^1.103.0;@types/vscodemust stay aligned with it. - Tooling runtime: Node.js 22 with npm 11.16.0 (the versions CI uses).
- Package manager: npm 11.16.0, with the committed
package-lock.json. Do not introduce a second package manager, lockfile, or apackageManagerfield — a metadata test asserts its absence. - npm install scripts are denied unless their exact package version appears in
allowScripts. Review the script before approving it withnpm approve-scripts; never broaden an existing approval or carry it to a new dependency version without re-reviewing that version. - No runtime dependencies. Everything in
devDependenciesis build, test, or packaging tooling.
src/extension.ts: VS Code activation, commands, terminal lifecycle, prompts, and shell-integration wiring. The only module allowed to importvscode.src/command-utils.ts: pure command parsing, risk classification, output bounding, naming, disposable bookkeeping, and workspace resolution helpers. Must stay free ofvscodeimports so it is unit-testable under plain Node.test/command-utils.test.js:node:testunit tests against the compiledout/command-utils.js.test/metadata.test.js: asserts package metadata, ignore rules, documentation, CI, and source-level invariants. Version-sensitive — update it with every version bump.test/integration/: VS Code integration smoke test driven by@vscode/test-electron.media/icon.png: the single packaged product artwork, used for both the Marketplace listing and the editor-title command icon.docs/: engineering notes and the release checklist..github/: issue templates, pull request guidance, CI, and the Open VSX publish workflow.
npm ci --strict-allow-scripts
npm run check
npm run auditnpm run check= clean compile, unit + metadata tests, VS Code integration smoke test, andvsce lspackage-content validation. It is the single gate to run before any commit.- Focused runs:
npm run test:unit,npm run test:integration,npm run test:metadata,npm run test:command-utils. - Build a release candidate only after those pass:
npm run package -- -- --out .vsce/vscode-copilot-cli-launcher-<version>.vsixNever commit or hand-edit: node_modules/, out/, out/**/*.map, .vscode-test/, .vsce/,
*.vsix, *.tsbuildinfo, logs. out/ is wiped by npm run clean on every compile, so edits
there are lost. Edit package-lock.json only through npm.
- Keep TypeScript strict and move reusable decision logic into pure functions in
command-utils.tswith focused tests. - Preserve Workspace Trust checks and resolve
copilotCliLauncher.cliCommandfrom user or machine configuration only. A workspace must not be able to choose the command that is executed. - Send the configured command exactly once. Shell-integration and fallback paths must remain mutually exclusive.
- Register per-launch listeners and timers through the disposable registry in
command-utils.ts, never directly oncontext.subscriptions. VS Code drainssubscriptionsonly at deactivate, so pushing there on every launch grows that array without bound and pins each launch's captured terminal output. A metadata test enforces a singlecontext.subscriptions.pushcall inextension.ts. - Keep captured terminal output bounded and in memory only; never persist command output.
- Do not add telemetry, analytics, filesystem scanning, child-process installers, package-manager
execution, or automatic downloads.
extension.tsmust not importnode:child_process,node:fs,node:os, ornode:path— a metadata test asserts this. - Use official GitHub documentation for Copilot CLI installation guidance. Do not bundle GitHub or Microsoft trademarks or artwork without permission.
- Update tests,
README.md, andCHANGELOG.mdwhenever user-visible behavior changes.
- No breaking changes without an explicit, authorized major-version decision. Setting IDs
(
copilotCliLauncher.cliCommand,copilotCliLauncher.terminalName), command IDs (copilotCliLauncher.openCli,copilotCliLauncher.openSettings), the publishermikesoft, and the extension namevscode-copilot-cli-launcherare part of the public contract. - Raise
engines.vscodeonly when a newly used API actually requires it, and align@types/vscodein the same change. - The extension supports Windows, macOS, and Linux. Keep path and quoting handling platform-neutral and covered by tests.
media/icon.png is the product artwork and must not be redesigned, recolored, renamed, or moved.
It may only be losslessly recompressed, preserving dimensions, format, and appearance. A metadata
test requires it to stay at least 256x256 and under 256 KiB.
The extension itself reads no environment variables and stores no secrets. Publishing tokens
(VSCE_PAT for the Visual Studio Marketplace, OVSX_PAT for Open VSX) exist only as CI secrets or
an operator's local environment. Never place them in files, command arguments, logs, pull requests,
or shell history, and never echo their values — check only for presence.
mainis protected: required status checkscheck (ubuntu-latest)andcheck (windows-latest), one approving review, linear history, and required conversation resolution. Work on a dedicated branch and open a pull request; never force-push, rewrite history, or bypass protection.- Keep workflow permissions minimal and pin third-party actions to immutable commit SHAs.
- Do not weaken branch protection, required checks, review requirements, secret scanning, or push protection.
- Do not commit, push, tag, create a release, or publish to a registry unless the user explicitly requests that action.
Semantic versioning. Keep the version synchronized across package.json, package-lock.json
(both the root and packages[""] entries, via npm version --no-git-tag-version), CITATION.cff,
the version assertion in test/metadata.test.js, the default tag input of
.github/workflows/publish-open-vsx.yml, and CHANGELOG.md (Keep a Changelog format, with the
comparison links at the bottom).
Follow docs/RELEASING.md, wait for required CI checks, and verify every
target registry after publication:
- Visual Studio Marketplace:
mikesoft.vscode-copilot-cli-launcher, published withvsce. - Open VSX:
mikesoft/vscode-copilot-cli-launcher, published by the Publish Open VSX workflow from an existing GitHub Release asset, or withovsxas an authorized local fallback.
npm ci --strict-allow-scriptssucceeds from the committed lockfile.npm run checkpasses end to end (compile, unit, metadata, integration,vsce ls).npm run auditreports no high-severity advisories.npm run packageproduces a VSIX whose file list contains onlyout/*.js,media/icon.png,package.json, and the root documentation and licence files — no sources, tests, maps, lockfile, or local tooling.- Version references are synchronized and
CHANGELOG.mdhas a dated entry with real changes only. npm ci --strict-allow-scriptsemits no pendingallowScriptswarning; any newly requested install script is reviewed and pinned to its exact package version before approval.
- Read this file,
README.md,CONTRIBUTING.md, anddocs/RELEASING.mdbefore changing anything. - Prefer small, reviewable diffs. Do not perform cosmetic refactors that enlarge the diff without a concrete benefit.
- Never invent changelog entries, badges, statistics, links, or release results. Verify every command and URL you document.
- Never delete user data, local
.vsce/artwork sources, or untracked local files. - Report failures with their real output instead of working around checks.