CLI, JSON and MCP
denoise has three ways in besides the app. All run the same engine, so a command line, a script and an agent see what the app draws.
The commands are in the repository’s package.json as denoise, denoise-fn and denoise-data. They need Node 24 or later.
denoise: a change map
Section titled “denoise: a change map”denoise <repo> [--base <ref>] [--head <ref>] [--out <dir>] [--no-render]Reads a git repository and compares two commits. --head defaults to HEAD, and --base to the commit before it. It writes graph.json, report.md and model.json to --out (default out/<repo>-<sha>), then renders the pictures. --no-render stops after the files, and --no-functions skips the per-function schematics. --level picks their detail (default minimal).
denoise-fn: one function
Section titled “denoise-fn: one function”denoise-fn <repo> <file> <function> [--rev <ref>] [--level <level>] [--out <dir>] [--png]Draws one function as an SVG. --level is one of stub, shape, minimal, outline or full, or all to write one file per level. --rev is the commit to read (default HEAD; worktree reads the files on disk). --out defaults to out/functions. --png also writes a PNG. --no-legend leaves the legend out.
denoise-data: JSON
Section titled “denoise-data: JSON”denoise-data file <target> [path] # one file: summary and functionsdenoise-data tree <target> [path] [function…] # schematic treesdenoise-data map <target> [folder] # component map with layoutdenoise-data diff <target> # changed functions as diff treestarget is a local folder, a GitHub URL or owner/repo. Output is one JSON document on stdout, and errors are JSON on stderr.
| Option | Meaning |
|---|---|
--rev <ref|worktree> | Local: the revision to read (default: the working tree). |
--base <ref> | diff, local: the base revision (default HEAD). |
--head <ref|worktree> | diff, local: the head (default: the working tree). |
--path <file> | diff: only this file. |
--fn <name> | diff: only this function. |
--target <n> | map: about how many components (default 12). |
--tests | map: include test files. |
--pretty | Indent the JSON. |
--out <file> | Write to a file instead of stdout. |
Set GITHUB_TOKEN (or GH_TOKEN) to read private GitHub repositories. The token is yours, and nothing goes to the denoise server.
Every document starts with its schema name, denoise.data/1. The format is described in docs/data.md in the repository.
The app’s server also speaks MCP at /mcp, so an agent can ask for the same facts the app draws. It reads public GitHub repositories only. It has five tools, each with a target that is a GitHub URL or owner/repo:
| Tool | What it returns |
|---|---|
denoise_resolve | The commit denoise draws and the viewer URL; for a pull request, its change summary. |
denoise_file | The functions in one file, with complexity, imports and IO. |
denoise_tree | One function’s structure, exits and calls as an outline, with a link to the picture. |
denoise_map | The components of a repository or folder and the imports between them (at most 250 files). |
denoise_diff | A pull request, commit or compare: changed files and, with path, the functions that changed. |
Private repositories are not available over MCP. Use denoise-data with your own token.