rust-toolchain.toml, Cargo,
and a C/C++ compiler for Tree-sitter and its grammar scanners. Install Git to
compare repositories or register the Git diff driver.
Prerequisites
- Rust and Cargo. With rustup installed, commands in this checkout use the version
pinned in
rust-toolchain.toml. - A C/C++ compiler for the linked Tree-sitter runtime and grammar scanners.
- Git for cloning the repository, repository comparisons, and Git driver setup.
Install from a checkout
cargo run -p differens -- <inputs> from the checkout. Cargo downloads dependencies during the initial build; the installed CLI performs local comparisons without a language runtime or a grammar download.
Registry installation
Once the native release is published:Build a standalone executable
To build without installing into Cargo’s binary directory:target/release/differens on the build platform. The binary does not need a
JavaScript runtime or grammar files beside it. Native libraries required by its
build target still apply; building locally does not verify another platform.
cargo xtask package produces a native archive and checksum in target/packages.
Install the libraries
The workspace containsdifferens-core, differens-tiers, differens-narrate, differens-correlate, differens-git, and differens-engine. Depend on the stages you need. differens-core supports default-features = false for consumers that do not need JSON serialization or parsers.
Start with the core reference for tree construction or
tiers to compare source bytes. If you used an npm release,
follow the migration guide for CLI replacement,
Git driver setup, and the Rust equivalents of the JavaScript packages.
Choose a crate
For an integration against an unpublished checkout, add path dependencies to your
application’s
Cargo.toml. Replace the paths with the location of your clone
and keep the dependencies your example imports. Some examples also use
serde_json to construct data or handle serialization errors:
main programs as well as reusable helper
functions. Copy a complete program into src/main.rs of a Cargo application with
the matching dependencies, then run cargo run. If you construct trees without
parsers, depend on differens-core alone; default-features = false also omits
its optional serialization support.
Verify the installation
differens languages lists the grammars compiled into your binary. If the command
still runs an older installation, inspect type -a differens and check your
PATH. Continue with the quickstart to compare
files and read the output.