Quick Start
Basic Scan
Section titled “Basic Scan”art-dupl # Scan current directory (threshold: 5)art-dupl -t 15 # Larger clones onlyart-dupl ./src ./lib # Specific directoriesart-dupl -v # Verbose outputOutput Formats
Section titled “Output Formats”art-dupl --html > report.html # HTML report with syntax highlightingart-dupl --html --diff side-by-side # Side-by-side diff visualizationart-dupl --json -t 10 # JSON with statisticsart-dupl --sarif # SARIF for GitHub Securityart-dupl --plumbing # Machine-readable file:startLine-endLineart-dupl --all --output-dir ./reports # All formats to a directoryDetection Modes
Section titled “Detection Modes”art-dupl --semantic . # Default: finds renamed-variable clones (Type 2)art-dupl --exact . # Verbatim name matching (copy-paste only)art-dupl --structural . # AST shape only (loosest matching)Detection Methods
Section titled “Detection Methods”art-dupl -m art-dupl # Suffix tree (default)art-dupl -m hash # Hash-based (faster)art-dupl -m "hash,art-dupl" # Both, deduplicatedSorting
Section titled “Sorting”art-dupl --sort size # Largest clones first (default)art-dupl --sort occurrence # Most widespread firstart-dupl --sort total-tokens # Highest total token countProject Statistics
Section titled “Project Statistics”art-dupl stats # Colored summary with health gradeart-dupl stats --format json # Machine-readableart-dupl stats --format csv # Spreadsheet-compatibleFiltering
Section titled “Filtering”art-dupl --only go # .go files onlyart-dupl --only templ # .templ files onlyart-dupl --exclude-pattern "*_test.go" # Exclude testsart-dupl --include-generated sqlc # Include sqlc-generated filesReading Files from Stdin
Section titled “Reading Files from Stdin”find . -name '*_test.go' | art-dupl --filesConfiguration File
Section titled “Configuration File”Create dupl.json:
{ "threshold": 10, "outputFormat": "json", "paths": ["./src", "./internal"]}art-dupl -c dupl.jsonCLI flags override config file values. Config file overrides defaults.