High-Performance Polyglot Code Clone Detection & Refactoring Engine
Interface Pillar 1 of 4: Terminal CLI Engine (crates/cddm-cli)
The CDDM CLI provides 22 subcommands for high-speed terminal-based duplication analysis, differential CI/CD verification, automated AST refactorings, and multi-repository federation.
-v, --verbose: Increase verbosity level (-vfor debug,-vvfor trace).-q, --quiet: Suppress all non-error console output.--log-level <LEVEL>: Set explicit log level (trace,debug,info,warn,error,off).--log-file <PATH>: Write structured application logs to a file.-h, --help: Print command help and options.-V, --version: Print version information.
| Command | Usage | Description | Key Options |
|---|---|---|---|
cddm scan |
cddm scan [OPTIONS] [DIRECTORY] |
Scan target directory for code duplication, clone pairs, and DRY health score | --min-tokens, --format, --fail-threshold, --languages, --ignore, --git-blame, --cross-language, --rules, --enforce-policies, --threads |
cddm dead-code (alias dead) |
cddm dead-code [OPTIONS] [DIRECTORY] |
Detect unreferenced functions, unreachable code blocks, and dead duplicate clones | --min-tokens, --format, --coverage, --static-only, --languages |
cddm prune |
cddm prune [OPTIONS] [DIRECTORY] |
Automatically prune unreachable dead clone clusters and unreferenced code | --dry-run, --safe-only, --threshold, --min-tokens, --format, --languages |
cddm diff |
cddm diff [OPTIONS] <BASE_REF> [TARGET_REF] |
Differential clone scan comparing working tree against Git base revisions | --matrix, --cross-language, --fail-threshold, --git-blame, --rules |
cddm semantic |
cddm semantic [OPTIONS] [DIRECTORY] |
Analyze cross-language semantic clones and dense neural algorithmic equivalences | --threshold, --neural, --neural-threshold, --min-tokens, --threads |
cddm refactor |
cddm refactor [OPTIONS] |
Synthesize deduplication refactoring patches, AST rewrites, and AI prompts | --pair, --cluster, --ast, --output, --prompt, --verify, --test-cmd, --apply-branch |
cddm extract |
cddm extract [OPTIONS] |
Extract duplicate clone clusters into standalone shared packages or crates | --cluster, --pkg-name, --pkg-type, --target-dir, --dry-run |
cddm serve |
cddm serve [OPTIONS] |
Launch the embedded React 19 Studio WebUI dashboard in browser | --port, --open |
cddm watch |
cddm watch [OPTIONS] [DIRECTORY] |
Continuous file watcher with real-time incremental rescanning on save | --min-tokens, --debounce-ms, --serve, --open, --fail-threshold |
cddm lsp |
cddm lsp [OPTIONS] [DIRECTORY] |
Start Language Server Protocol (LSP 3.17) daemon for real-time IDE diagnostics | --min-tokens |
cddm trend |
cddm trend [OPTIONS] [DIRECTORY] |
Analyze historical duplication trajectories and DRY score across Git commits | --max-samples, --min-tokens, --format |
cddm hook |
`cddm hook <install | uninstall | status> [OPTIONS]` |
cddm ignore |
`cddm ignore <init | check> [OPTIONS]` | Manage .cddmignore suppression rules and inspect file/line suppression status |
cddm rules |
`cddm rules <init | check> [OPTIONS]` | Manage architectural boundary policies and zero-duplication zones (.cddmrules.toml) |
cddm init |
`cddm init <gitea | github | gitlab |
cddm comment |
cddm comment [OPTIONS] [DIRECTORY] |
Generate formatted Markdown DRY health tables for Pull / Merge Request comments | --platform, --fail-threshold, --min-tokens, --output |
cddm heal |
cddm heal [OPTIONS] |
Autonomous AI Code Surgeon refactoring with closed-loop test repair loop | --cluster, --pair, --provider, --model, --api-key, --verify, --test-cmd, --branch, --max-iterations |
cddm cache |
`cddm cache <export | import> [OPTIONS]` | Manage persistent fingerprint cache and export/import portable .cddmpack bundles |
cddm monorepo |
cddm monorepo [OPTIONS] [DIRECTORY] |
Discover and scan multi-package monorepos for cross-package duplicates | --min-tokens |
cddm tui |
cddm tui [OPTIONS] [DIRECTORY] |
Launch the interactive 12-tab Terminal UI (TUI) Studio dashboard | --watch, --fail-threshold, --min-tokens, --languages, --ignore |
cddm overlap |
cddm overlap [OPTIONS] [DIRECTORY] |
Detect reimplemented standard library and ecosystem package algorithms | --threshold, --format |
cddm hub |
`cddm hub <init | scan | extract> [OPTIONS]` |
cddm coverage |
cddm coverage [OPTIONS] |
Correlate runtime execution coverage reports with duplicate code clones | --report, --dead-code-only, --min-hits, --risk-threshold, --format |
cddm scan ./src --min-tokens 40 --format consolecddm diff main --fail-threshold 3.0 --format sarif --output results.sarifcddm heal --cluster 1 --provider gemini --model gemini-2.5-pro --verify --test-cmd "cargo test"cddm init gitea --fail-threshold 5.0 --write