Skip to content

fp & repo

canontra fp <FILE> [-l|--language LANG] [--json | --hash | -q]
canontra repo <DIR> [--json] [--cache]
canontra commit <REVISION> [--json]
canontra evolution <REV1> <REV2> [--json]
canontra watch [DIR] [--debounce-ms MS] [--poll-ms MS] [-v|--verbose]

Aliases: fingerprint for fp, repository for repo, w for watch.

  • fp: Parses one source file (.py, .pyi, .js, .jsx, .mjs, .cjs, .ts, .tsx, .go, .rs) or standard input (-) and prints its 9-tier FingerprintBundle (F0 through F4).
  • repo: Scans an entire repository in parallel, builds compact CSR call and data-flow graphs, and computes F_R, F_WCG, F_WDF, and F_W4.
  • commit: Computes a RepositoryManifest at a Git revision (such as HEAD, HEAD~1, a tag, or a commit SHA) using read-only git commands.
  • evolution: Compares semantic changes between two Git revisions (REV1 and REV2) at both file and repository level.
  • watch: Polls a directory and updates the repository Merkle DAG as files change.
Flag Short Applies To Default Description
--language -l fp - python Language for stdin input (python, py, typescript, ts, javascript, js, go, rust, rs)
--json - fp, repo, commit, evolution false Print full manifest as JSON
--hash -q fp false Print only the 64-character composite F4 SHA-256 hash
--cache - repo, auto-dispatch false Use the CNTR\x07 incremental cache with FileGraphSummary payloads (.canontra/cache.bin)
--debounce-ms - watch 50 Debounce window in milliseconds
--poll-ms - watch 100 Directory polling interval in milliseconds
--verbose -v watch false Print verbose watcher logs

With --json, fp outputs file, language, engine_version, and fingerprints (source, structural, declaration, dependency, call_graph, control_flow, data_flow, type_contract, composite).

Exit codes: 0 on success, 2 on invalid flags, 3 on parse failure, 4 on missing path, Git failure, or path outside the project root.

Terminal window
# Fingerprint one file
canontra fp src/auth.py
# Read from standard input
cat src/handler.ts | canontra fp - -l typescript --hash
# Fingerprint a repository using the CNTR\x07 slab cache
canontra repo . --cache --json
# Compare semantic changes across 5 commits
canontra evolution HEAD~5 HEAD --json