Installation & Build
dup-code-check is a Rust CLI binary. Node.js is only used as an installation option (npm). The npm package builds the binary from source when needed (Cargo), so Rust is required.
By default, project installs build on first run. Global installs may build during postinstall to avoid permission issues.
Security note: building runs a native build (Cargo), which may execute dependency build scripts. Depending on how you install, this may run during
postinstall(e.g. global installs) or on first run. Use--ignore-scripts/npm_config_ignore_scripts=trueif you need to avoid running install scripts.
Option A: Rust (recommended)
From the repo root:
cargo build --release -p dup-code-check
./target/release/dup-code-check --helpOr install locally:
cargo install --path . --bin dup-code-check
dup-code-check --helpOption B: Install via npm (project dependency)
npm i -D dup-code-checkAfter installation:
npx dup-code-check --helpTip: to build during install (project dependency), set
DUP_CODE_CHECK_BUILD_ON_INSTALL=1.Tip: to skip builds (install + first run), set
DUP_CODE_CHECK_SKIP_BUILD=1and build manually later.
Option C: Global npm install (local tooling)
npm i -g dup-code-check
dup-code-check --helpTip: global installs work best with install scripts enabled (
postinstallbuilds the binary).
Option D: Contribute / develop from source
git clone git@github.com:omne42/dup-code-check.git
cd dup-code-check
npm install
npm run build
./bin/dup-code-check --helpWhat does npm run build do?
npm run build executes scripts/build-binary.mjs:
cargo build --release -p dup-code-check- copy the output into
bin/
Output binary name:
- macOS / Linux:
bin/dup-code-check - Windows:
bin/dup-code-check.exe
Common build issues
If you see “Rust toolchain is required…”, check Troubleshooting.