RepoLens for VS Code
Architecture documentation intelligence — right inside your editor.
RepoLens scans your repository and gives you a live view of your system architecture: modules, domains, dependencies, tech stack, and generated documentation — all in your VS Code sidebar.

Features
Architecture Explorer
A dedicated sidebar showing your project's structure at a glance:
- Project overview — file count, module count, API endpoints, pages
- Tech stack — auto-detected frameworks, languages, build tools, test frameworks
- Business domains — modules grouped by inferred domain (Auth, API, UI, etc.)
Module Browser
Browse all modules with file counts and domain tags. Click to navigate directly to the module directory.
Document Viewer
View generated RepoLens documentation grouped by audience:
| Audience |
Documents |
| Stakeholders |
Executive Summary |
| Everyone |
System Overview, Business Domains, Route Map, Data Flows, Architecture Diff, System Map, Architecture Drift, Code Health Report |
| Engineers |
Architecture Overview, Module Catalog, API Surface, Developer Onboarding, GraphQL Schema, TypeScript Type Graph, Dependency Graph, Security Hotspots, and any other generated page |
Those groups match the CLI 1.15.5 document plan (non-technical is Stakeholders). publish writes each page twice: a numbered file such as 00-executive-summary.md, and the older name such as executive_summary.md. Architecture Diff is 08-change-impact.md and architecture_diff.md. The sidebar shows each page once and prefers the numbered file. CLI 1.15.5 skips Route Map and GraphQL Schema when the scan finds no routes or GraphQL schema, unless documentation.sections lists that key.
Files are read from documentation.output_dir (default .repolens). That directory must stay inside the repository. The preview redacts tokens before rendering.
System Map
Visual dependency map of your modules — color-coded by domain. Open as a full webview panel for detailed exploration.
CodeLens Annotations
Inline annotations at the top of each file showing which module and domain it belongs to.
Status Bar
Live status showing module and file counts after scanning. Click to re-scan.
Commands
| Command |
Description |
RepoLens: Scan Repository |
Scan the workspace and populate the views |
RepoLens: Generate Documentation |
Run publish and show redacted output in the RepoLens channel |
RepoLens: Show System Map |
Open the full-size system map |
RepoLens: Open Config |
Open .repolens.yml or .repolens.yaml, or scaffold one |
RepoLens: Refresh |
Refresh the tree views |
Generate Documentation and scaffolding do not type into a terminal. The extension starts node with the installed repolens binary and a fixed argument list (shell: false).
| Action |
Arguments |
| Generate Documentation |
publish, plus --config when a config file is in the workspace |
| Create config |
init --quick --target <workspace> |
--quick skips the interactive wizard. CLI 1.15.0+ writes a Markdown-only config and sets scan.include and module_roots from the languages it finds in the repo. A non-TTY session also scaffolds init as --quick when the flag is omitted. The extension still passes --quick. --target may be an absolute directory and must already exist (CLI 1.15.0+ exits 2 when it does not). There is no flag for the output directory or for scan globs. Those belong in .repolens.yml and must be relative.
The extension itself runs publish and init. It does not run mcp, badge, or comment. The argument builder accepts the CLI 1.15.5 commands and flags and rejects anything else before the process starts:
- Commands:
init, doctor, migrate, publish, demo, watch, uninstall, feedback, mcp (1.14.0+), badge (1.15.2+), comment (1.15.2+), version, help
- Values:
--config, --target, and on 1.15.2+ --format, --out, --base, --head, --url, --link, --label
- Switches:
--quick, --non-interactive, --dry-run, --force, --strict (1.15.0+), --verbose, --help / -h, --version / -v
publish does not take --dry-run. The parser accepts the switch and then ignores it. publish --strict exits 2 when a configured publisher is missing credentials. Markdown needs none. The extension does not pass --strict.
repolens version prints the version and exits 0 before flag checks. Other commands exit 2 for an unknown flag, a missing --config / --target value, a missing target directory, an empty scan (publish, demo, doctor, or watch), badge with nothing to score, comment without a base or head ref, or publish --strict without credentials. They exit 1 for a runtime error or an unknown command, and 0 on success.
CLI 1.15.5 has no GitHub App command or flag. That mode is still a roadmap item in CHAPIBUNNY/repolens and is not on npm. Passing an app flag exits 2. This extension does not send one.
Getting Started
- Install the extension from the VS Code Marketplace (
ext install repolensdox.repolensdox)
- Open a project that has a
.repolens.yml config (or any project)
- With RepoLens: Scan on open left at its default, the extension scans when a workspace is open. A
.repolens.yml (or .repolens.yaml) plus CLI 1.12.4 or newer uses the full scanner. Anything else uses the built-in scanner. The full scanner was checked against CLI 1.15.5.
- Click the RepoLens icon (a camera aperture with a git branch) in the activity bar to open the sidebar. The status bar item uses the telescope icon and scans again when clicked.
With the RepoLens CLI (recommended)
Install @chappibunny/repolens 1.12.4 or newer in the workspace. 1.15.5 is the release this extension was checked against. The extension loads that package's public entry (loadConfig and scanRepo from src/index.js) and runs the repolens binary. The scan result is still filesCount, modules as { key, fileCount }, api[].methods, and the tech stack on metadata. Do not install the unscoped repolens package — it is a different project, and update checks query @chappibunny/repolens.
npm install @chappibunny/repolens@^1.15.5
npx @chappibunny/repolens init --quick
.repolens.yml paths must stay inside the repository. CLI 1.12.4 and 1.15.5 reject:
- absolute
scan.include patterns, including Windows drive paths
.. in scan.include
- an absolute
documentation.output_dir, or one that escapes the repository with ..
Use a relative glob such as src/**/*.ts and an output directory such as .repolens. The extension checks those values before publish and reports them in the output channel. CLI 1.15.0+ exits 2 when publish or demo matches 0 files, and it does not write empty docs.
Publishers on CLI 1.12.4 are notion, markdown, confluence, and github_wiki. Markdown is what the sidebar reads. Notion, Confluence, and GitHub Wiki run inside publish when that CLI is configured. Their tokens stay in the environment. They are not passed as arguments.
CLI 1.13.0 adds the obsidian publisher. The extension treats that name as valid once 1.13.0 or newer is installed. On 1.12.x the CLI still exits with Unknown publisher: obsidian, and the extension tells you to upgrade or remove it.
On startup the extension asks the npm registry for @chappibunny/repolens (@chappibunny%2frepolens). It does not query the unscoped repolens package. The check is skipped when CI or GITHUB_ACTIONS is set.
Without the CLI
The extension includes a lightweight built-in scanner that works on any project — no additional dependencies required.
Settings
| Setting |
Default |
Description |
repolens.autoScanOnOpen |
true |
Scan when a workspace is open |
repolens.showStatusBar |
true |
Show module and file counts in the status bar |
repolens.enableCodeLens |
true |
Show the module and domain CodeLens |
Requirements
- VS Code 1.100.0 or later
- Node.js 18+ (the CLI requires it; 22 is used in CI)
- Optional:
@chappibunny/repolens 1.12.4 or newer in the workspace for the full scanner (checked against 1.15.5)
Security
- System Map and document preview webviews set a Content-Security-Policy (
default-src 'none'). Repository text is escaped before it is rendered. The system map script uses a per-render nonce.
- Generate Documentation, and Open Config when it scaffolds a file, start the CLI with
node and an argument array. The extension does not send those commands through a shell, and it does not put tokens on the command line.
- CLI output and generated markdown are redacted before they are shown. Publisher credentials stay in the environment the CLI already uses; they are not written into logs.
Publishing
Marketplace publishing is tag-triggered and does not run in pull-request CI. CI runs vsce package only.
- Create an Azure DevOps Personal Access Token with the Marketplace (Manage) scope.
- In this GitHub repository, open Settings → Secrets and variables → Actions, and add the token as
VSCE_PAT.
- Do not commit the token, print it, or put it in the workflow file. The publish workflow reads
${{ secrets.VSCE_PAT }}.
- Push a tag that matches
v* (for example v0.2.3) to run .github/workflows/publish.yml. Do not publish from a pull request.
That workflow installs with npm ci, lints, tests, and publishes with @vscode/vsce 4 (vsce publish). It does not run on pull requests. Pull-request CI runs vsce package and does not publish.
Marketplace id: repolensdox.repolensdox (listing). Earlier versions (up to 0.1.0) were published as CHAPIBUNNY.repolens-architecture; uninstall that one and install this listing.
Development
npm ci
npm run lint
npm test
npm run compile
npm run package:dry-run
npm test covers flag and path rules, secret redaction, webview content security policy, scan-result normalization, the vendored braces override, and a scan of this repo with the installed CLI. Node.js 22 is what CI uses. CI uses npm ci against the lockfile.
braces is a direct dev dependency on third_party/braces, and overrides.braces is $braces so fast-glob / micromatch (via @chappibunny/repolens) use that copy instead of the registry. GHSA-vfj7-8cjw-p6xm covered every published release (<=3.0.3), 3.0.3 is still the latest tag, and GitHub withdrew that advisory on 2026-10-23. The vendored package is 3.0.3 plus a nesting-depth limit, versioned 3.0.4, so the lockfile is outside that range. See that directory's README.
Links
License
MIT