Codex CLI Launcher is an unofficial VS Code extension published to the Visual Studio Marketplace and Open VSX as mikesoft.vscode-codex-cli-launcher. It creates a side terminal and launches a user-configured Codex CLI command. Keep the extension small, cross-platform, and explicit about its unofficial status.
The repository is public and MIT licensed. Assume every change, comment, and commit message is world-readable.
- TypeScript compiled with the repository-local
typescriptcompiler to CommonJS-compatibleNodeNextoutput underout/. npmwith the committedpackage-lock.jsonis the only supported package manager. Do not introduce a second lockfile or package manager.- Node.js 22 or newer. CI runs Node 22 on
windows-latestandubuntu-latest. - Minimum supported editor is VS Code
^1.103.0.@types/vscodeis pinned to exactly1.103.0so the compiler cannot accept APIs that do not exist on the declared floor. - There is no linter or formatter.
.editorconfig(LF, UTF-8, two-space indent, final newline) plustscinstrictmode withnoUnusedLocalsandnoUnusedParametersare the only static checks.
src/extension.tsowns VS Code API integration, terminal lifecycle, workspace-trust checks, settings, and user messages.src/command-utils.tscontains pure command, naming, output-buffer, launch-session, and workspace-resolution helpers. Put testable logic here instead of embedding it in activation handlers.test/*.test.jscontains unit, metadata, packaging, lifecycle, and security-invariant tests. They run against compiledout/, so compile before running them directly.test/integration/runs the extension in the minimum supported VS Code release by default. Override withVSCODE_TEST_VERSION.docs/holds maintainer documentation and is excluded from the VSIX.media/holds the packaged Marketplace and toolbar artwork.
.github/ workflows, issue forms, PR template, CODEOWNERS, funding
docs/ architecture and release documentation (not packaged)
media/ icon.png (Marketplace) and launcher-mark.svg (toolbar)
src/ extension.ts and command-utils.ts
test/ unit and metadata tests plus the VS Code integration suite
out/ generated compiler output (never edit, never commit)
| Purpose | Command |
|---|---|
| Install | npm ci |
| Compile and type-check | npm run compile |
| Watch | npm run watch |
| Unit tests | npm run test:unit |
| Integration smoke test | npm run test:integration |
| All tests | npm test |
| Full validation (compile, tests, integration, packaged file list) | npm run check |
| Dependency audit | npm run audit |
| Build the VSIX | npm run package |
There is no dev server, no deploy step, and no publish script. Publishing is a manual maintainer action through vsce and ovsx; see docs/releasing.md.
Only activate may register on context.subscriptions: the two commands and the terminal-close listener. VS Code releases that array on deactivation only, so anything pushed per launch would accumulate for the whole session.
Every launch instead creates a disposal scope with createLaunchSession. Register launch-scoped listeners and timers on that scope. A scope ends when the command finishes, when the fallback sendText path runs, or when its terminal closes; deactivate drains whatever is left.
- Never download or install Codex CLI, generate installer scripts, or invoke Node child-process APIs. A missing default CLI may only offer the official documentation link.
- Never execute a command sourced from workspace settings.
cliCommandmust remain machine-scoped and resolved from user-level configuration. - Require a trusted workspace before creating a terminal or sending a command.
- Treat
cliCommandas an intentional shell command, preserve quoted executable paths, and do not silently rewrite it. - Keep shell-output capture bounded and limited to the missing-Codex detection path. Custom commands must not have their output read at all. Do not log terminal output or add telemetry.
src/extension.tsmust contain exactly one external URL, the official Codex CLI documentation link. Tests enforce this.- Do not add official OpenAI or Codex logos or imply endorsement.
The extension reads no environment variables at runtime. VSCODE_TEST_VERSION only selects the VS Code build used by the integration test.
Marketplace and Open VSX tokens (VSCE_PAT, OVSX_PAT) belong to the maintainer's local environment. Never commit them, never echo them, never add them to workflows, issue comments, or release notes. No repository secret is required by any workflow in this repository.
out/,.vscode-test/, and*.vsixare generated locally and must not be committed or edited.package-lock.jsonis maintained by npm. Change it only through npm commands.media/icon.pngandmedia/launcher-mark.svgare hand-authored published artwork. Do not regenerate, redraw, recolor, resize, rename, or move them, and do not add a script that writes tomedia/. Optimizing byte size is acceptable only when the rendered result, dimensions, transparency, format, and paths are preserved exactly.
- No breaking changes. Setting ids, command ids, the publisher, and the extension name are part of the installed user's configuration and must stay stable.
- Do not raise
engines.vscodewithout a real API requirement, and keep@types/vscodeequal to that floor. - Verify behavior on both Windows and POSIX shells when command parsing or terminal execution changes.
- Keep the version synchronized across
package.json,package-lock.json,CITATION.cff,CHANGELOG.md, andtest/metadata.test.js.
- Keep changes focused and add regression tests for behavior changes.
- Update
README.mdfor user-visible behavior andCHANGELOG.mdunderUnreleasedfor notable changes. - Pin GitHub Actions to full commit SHAs and grant only the permissions each workflow needs.
- Use concise conventional commit subjects.
Before proposing a change:
npm cinpm run checkafter any source, manifest, workflow, documentation, or packaging changenpm run auditafter any dependency or lockfile changenpm run packagefor release-facing changes, then inspect the file list and confirm that sources, tests, workflows,AGENTS.md, source maps, and local artifacts stay out of the VSIX
Do not disable, skip, or weaken a test to make validation pass.
- Flag any path that can bypass workspace trust, accept repository-controlled commands, execute installers, or expose terminal output.
- Flag any disposable registered on
context.subscriptionsoutsideactivate. - Treat packaged-file changes as release changes.
mainis protected: it requires a pull request, one approving review, passingvalidate (ubuntu-latest)andvalidate (windows-latest)checks, and linear history. Never push tomaindirectly, never force push, never rewrite history, and never approve or merge your own pull request.- Do not publish, tag, or create a release unless the maintainer explicitly requests it. The published Marketplace and Open VSX versions must always match the tag,
package.json, andCHANGELOG.md. - Do not delete files under
media/,docs/, or.github/without an explicit request. - Report what you actually ran and what actually happened. Do not claim a published release you did not perform.