Skip to content

Command line ​

sourcetruth <dir> [mode] [options]

Modes ​

Pick one. Without a mode, sourcetruth prints a summary and the blind spots.

ModeOutput
--htmlThe interactive map, as one self-contained HTML file
--surfaceState-changing actions that at most one party can take alone
--holesOnly the calls that couldn't be traced, with their source lines
--graphWhich contract creates or calls which
--jsonThe full model — see JSON model

Options ​

Option
-o, --out <file>Write the output to a file instead of stdout
--title <text>Name the map (default: the directory name)
--lang daml|evmForce the language instead of detecting it
--min-resolution <N>Exit 1 if less than N% of links could be traced
--include-testsAlso draw test packages, test/, TestContracts/, mocks/, *.t.sol
--include-libsDraw vendored dependencies as if they were your code
--datedStamp today's date on the map (off by default, so maps of the same code are identical)
--demo [daml|solidity]Render a bundled example instead of <dir>
-v, --versionPrint the version
-h, --helpPrint usage

Exit codes ​

CodeMeaning
0Mapped
1Nothing found, or traced below --min-resolution
2Bad usage — unknown option, missing directory, unknown language

Blind spots on their own never change the exit code.

Examples ​

bash
sourcetruth --demo -o demo.html
sourcetruth ./contracts --html -o map.html --title "Vault v2 review"
sourcetruth ./daml --surface
sourcetruth ./src --holes
sourcetruth ./src --min-resolution 90
sourcetruth . --json -o model.json

Released under the MIT License.