jscpd
[](https://github.com/kucherenko/jscpd/actions/workflows/nodejs.yml)
Copy/paste detector for programming source code. Supports 224+ formats. AI-ready with MCP server and token-efficient reporter. Now with a Rust-powered engine — 24-37x faster.
jscpd implements the Rabin-Karp algorithm to find duplicated code blocks across files.
Quick Start
# Install (all platforms — installs the jscpd command)
curl -fsSL https://jscpd.dev/install.sh | bash
# TypeScript engine (Node.js, v4.x)
npm install -g jscpd@4
jscpd /path/to/code
# or use without installing
npx jscpd@4 /path/to/code
# Rust engine (v5.x, 24-37x faster) — installs the jscpd command
npm install -g jscpd@5
jscpd /path/to/codeRust engine — cpd command only
npm install -g cpd cpd /path/to/code
Rust-native install (exposes both jscpd and cpd)
cargo install jscpd
Nix (installs both jscpd and cpd)
nix run github:kucherenko/jscpd -- /path/to/code
or install permanently
nix profile install github:kucherenko/jscpd
Homebrew (macOS/Linux)
brew install jscpd
## Documentation
| Document | Description |
|----------|-------------|
| [TypeScript (v4.x)](docs/typescript.md) | Node.js engine — CLI, reporters, config, detection modes |
| [Rust (v5.x)](docs/rust.md) | Rust engine — installation, CLI, reporters, blame, Rust API |
| [AI-Ready](docs/ai-ready.md) | AI reporter, agent skills, MCP server |
| [Programming API](docs/api.md) | TypeScript and Rust programmatic APIs |
| [CI & Pre-Commit Hooks](docs/ci-and-hooks.md) | GitHub Action, pre-commit hooks |
| [Packages](docs/packages.md) | Monorepo package and crate overview |
| | TypeScript (v4) | Rust (v5) | |---|---|---| | npm package | jscpd@4 | jscpd@5 or cpd | | CLI command | jscpd | jscpd (from jscpd@5) or cpd (from cpd) | | Speed | Baseline | 24-37x faster | | Formats | 224 | 223 | | Node.js required | Yes | No (self-contained binary) | | Programming API | TypeScript (jscpd(), detectClones()) | Rust (cpd-finder crate) | | LevelDB store | Yes | No | | Reporters | 13 | 13 |