Skip to content

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.

Terminal window
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).

Terminal window
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.

Terminal window
denoise-data file <target> [path] # one file: summary and functions
denoise-data tree <target> [path] [function…] # schematic trees
denoise-data map <target> [folder] # component map with layout
denoise-data diff <target> # changed functions as diff trees

target is a local folder, a GitHub URL or owner/repo. Output is one JSON document on stdout, and errors are JSON on stderr.

OptionMeaning
--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).
--testsmap: include test files.
--prettyIndent 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:

ToolWhat it returns
denoise_resolveThe commit denoise draws and the viewer URL; for a pull request, its change summary.
denoise_fileThe functions in one file, with complexity, imports and IO.
denoise_treeOne function’s structure, exits and calls as an outline, with a link to the picture.
denoise_mapThe components of a repository or folder and the imports between them (at most 250 files).
denoise_diffA 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.