Skip to main content

VS Code extension

The Reqbook VS Code extension is the in-editor bridge for teams that write API specs directly in a Reqbook collection. It keeps the workflow narrow: edit markdown in VS Code, call the rqb binary for validation and execution, and keep the browser UI available for larger visual workflows.
The extension requires the rqb binary. It auto-detects rqb from RQB_PATH, workspace build outputs, Cargo, Homebrew, and PATH. Use reqbook.rqbPath only when you need an explicit override.

Demo

The demo shows a runnable endpoint in VS Code with inline CodeLens actions, direct execution through rqb, and the structured result panel.
To publish the optimized Cloudflare Stream version, set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN, then run node scripts/upload-cloudflare-stream-video.mjs docs/assets/vscode-demo.mp4 "Reqbook VS Code demo". Stream returns a player iframe, not an MP4 source, so replace the <video> block above with the returned mdx_embed after the upload is ready.

Commands

Open an endpoint or flow markdown file, then run these commands from the Command Palette or editor context menu:
CommandWhat it does
Reqbook: Preview EndpointOpens a VS Code webview preview of the current markdown spec with action buttons.
Reqbook: Run SpecSaves the current file, runs rqb exec for endpoints or rqb flow for flows/pipelines, and shows a compact result panel.
Reqbook: Validate Current FileSaves the current file, runs rqb validate <file>, and shows validation output.
Reqbook: Show Agent ContextRuns rqb context <file> and shows the surgical context that coding agents should use.
The result panel shows endpoint status, duration, request URL, response diff, structured assertions, flow steps, captures, and raw command output.

Auto-detect run buttons

The extension detects runnable Reqbook files and shows Run controls only for those files:
  • The collection root is the nearest parent directory with reqbook.md or mad.md; it does not need to be named api-docs.
  • Endpoint specs inside that collection with method: and path: frontmatter show Run Endpoint.
  • Flow and pipeline specs under <collection>/flows/ or <collection>/pipelines/ show Run Flow.
  • Non-runnable collection docs such as <collection>/reqbook.md, <collection>/mad.md, README.md, and _shared/env.md do not show Run controls.
Runnable files get both an inline CodeLens button at the top of the editor and a Run button in the editor title bar.

Variable autocomplete

The extension suggests variables while editing {{variable}} templates and path params. Suggestions are collected from:
  • <collection>/_shared/env.md
  • .env.local
  • :pathParam values in the current spec
  • Capture: ... as <name> directives in <collection>/flows/ and <collection>/pipelines/
This keeps authoring fast without adding a separate project config format.

Settings

SettingDefaultDescription
reqbook.rqbPathrqbOptional path to the rqb binary. The extension auto-detects common local and installed paths when this remains rqb.
reqbook.envdevEnvironment used for Run Endpoint and Show Agent Context.
reqbook.apiDocsRootemptyOptional collection root override. Relative paths resolve from the workspace root.
reqbook.resultPaneltrueShow command output in the Reqbook result panel. If disabled, output goes to the output channel.
Example workspace setting:
{
  "reqbook.rqbPath": "/Users/you/.cargo/bin/rqb",
  "reqbook.env": "dev"
}

Development install

The extension source lives in packages/vscode/.
cd packages/vscode
npm ci
npm test
npm run check
npm run package -- --out /tmp/reqbook-vscode-0.1.4.vsix
Install a pre-release VSIX with:
code --install-extension /tmp/reqbook-vscode-0.1.4.vsix
For local development, open the repository in VS Code, open packages/vscode/extension.js, and run the extension in an Extension Development Host. The extension has no runtime npm dependencies.

Release checklist

Before publishing to the Visual Studio Marketplace:
  • Confirm the Marketplace publisher matches the publisher field in packages/vscode/package.json.
  • Run npm ci, npm test, npm run check, and npm run package from packages/vscode/.
  • Install the generated VSIX and smoke test preview, run, validate, context, variable autocomplete, and a missing-rqb failure.
  • Confirm the released rqb binary version matches the extension docs.
  • Keep generated .vsix files and Marketplace tokens out of git.

When to use each surface

SurfaceBest for
VS Code extensionFast edit-run-validate loops while authoring markdown specs.
rqb serve browser UIRich request editing, response inspection, flow canvas, and visual review.
rqb-cliCI, scripts, PR checks, imports, exports, and automation.
MCP / agent skillsLet coding agents discover, author, execute, and debug API specs.
The same markdown files power every surface.