@mohammadpalla/diet-code
v0.3.1
Published
Put your AI coding agent on a diet — deterministic dead-code analyzer, cleanup, and agent benchmark for TypeScript/JavaScript. Self-contained Rust binary, zero runtime dependencies.
Maintainers
Readme
diet-code (npm)
Put your AI coding agent on a diet.
Deterministic dead-code analyzer, cleanup tool, and agent benchmark for TypeScript/JavaScript. This npm package ships a self-contained Rust binary — no Rust toolchain, no native build step, no runtime dependencies.
Install
npm install -g @mohammadpalla/diet-codeor run without installing:
npx @mohammadpalla/diet-code analyze .The postinstall script downloads the prebuilt binary for your platform
(linux/macOS/Windows × x64/arm64) from GitHub Releases and verifies its
SHA-256 checksum. No binary leaves your machine; no telemetry.
Usage
diet-code analyze . # dead-code evidence + summary
diet-code analyze . --json # stable JSON report
diet-code explain <finding> # evidence for one finding
diet-code clean --dry-run # preview the deterministic patch plan
diet-code clean # apply it on a diet-code/<timestamp> branch
diet-code benchmark --tasks tasks.json --reps 3Full docs, methodology, and benchmark results: https://github.com/Mohammad-Palla/diet-code#readme
Prefer building from source? Clone the repo and run
cargo install --path crates/diet-code-cli. Not published to crates.io.
Supported platforms
| OS | arch | artifact |
|---|---|---|
| Linux | x64, arm64 | static musl binary |
| macOS | x64 (Intel), arm64 (Apple Silicon) | |
| Windows | x64 | .exe |
Anything else prints a clear error with the from-source fallback. You can
also bypass the download (DIET_CODE_SKIP_DOWNLOAD=1), point at a mirror
(DIET_CODE_DOWNLOAD_BASE_URL=…), or override the binary entirely
(DIET_CODE_BINARY_PATH=/path/to/diet-code).
License
MIT — see LICENSE.
