intentdiff
v0.1.1
Published
A structure-aware Git diff that separates formatting, movement, refactoring, and meaningful edits.
Readme
intentdiff
intentdiff is a structure-aware Git diff for code review. It helps you see what actually changed by separating formatting noise, moved code, probable renames, import reorders, comment/doc edits, and meaningful edits.
This npm package provides the intentdiff command for JavaScript/TypeScript developers who prefer npm-based installation.
Install
npm install -g intentdiff
intentdiff --helpThis package is currently a lightweight installer shim. On first run it installs the native Rust CLI with:
cargo install intentdiff --lockedRequirements:
- Node.js 18+
- Rust/Cargo available on
PATH, unlessINTENTDIFF_BINARYpoints to a preinstalled native binary
If you already installed the native binary:
INTENTDIFF_BINARY=/path/to/intentdiff intentdiff --helpQuick start
# unstaged Git changes
intentdiff
# staged changes
intentdiff --staged
# compare revisions
intentdiff main...HEAD
intentdiff HEAD~1 HEAD
# direct file comparison
intentdiff old.ts new.ts
# machine-readable output
intentdiff --format json
# CI-style check
intentdiff --check --meaningful-onlyWhy use it?
Normal diffs show changed text. intentdiff tries to classify review intent:
formatting_onlycomment_onlyimport_reordermoved_unchangedmoved_modifiedprobable_renameliteral_changedoperator_changedtextual_changebinary_changeunknown
It intentionally avoids unsafe claims like “no behavioral change” unless a future verification subsystem proves that under explicit assumptions.
Example
No meaningful syntax-level changes detected.
Summary
3 files changed
0 meaningful edits
2 formatting-only changes
1 unchanged code moves
Run with --show-noise to inspect formatting changes.Language support
v0.1 focuses on a practical vertical slice:
- Rust
- Python
- JavaScript
- TypeScript / TSX
- JSON
- YAML
- TOML
- Markdown
Unsupported or malformed files fall back to token or normalized textual comparison. Changes are not silently dropped because parsing failed.
Privacy and safety
By default, intentdiff:
- makes no network requests;
- collects no telemetry;
- does not execute project code;
- does not run formatters or external tools automatically.
The npm shim may invoke Cargo to install the Rust binary. The core CLI remains local-first.
More information
- GitHub: https://github.com/harivilasp/intentdiff
- crates.io: https://crates.io/crates/intentdiff
- npm: https://www.npmjs.com/package/intentdiff
Current limitation
This npm package is a shim in v0.1, not a bundled native binary package. Prebuilt platform binaries are planned.
