Skip to main content

sarand

English · فارسی

CI Version Python 3.11+ Rust core Platforms MIT license

Point it at any codebase. Get one report an AI assistant can actually use.

Quick start · Install · Usage · The report · More tools · Uninstall


Not to be confused with Sarand, a bioinformatics tool for antimicrobial-resistance gene neighbourhoods. This is an unrelated developer tool.

sarand scans a project, works out what it is, runs its tests, linters and security checks, and writes one file with everything an AI coding assistant needs: the project tree, the full source, the results, a health score and a written summary. Run it before you hand a codebase to an assistant, so the assistant starts with facts instead of guesses.

Why sarand

One command, one file
Tree, source, test results, lint output, security findings and a health score, in a single Markdown, JSON, text, HTML, PDF or SARIF file.
Written for AI
Includes an AI summary and a suggested reading order, so a model knows where to look first.
41 language and format analyzers
Python, Rust, Go, Node.js, TypeScript, C/C++, Java, Kotlin, Android, C#, Swift, PHP, Ruby, Lua, Dart, Zig, Haskell, Elixir, Erlang, Scala, shell, SQL, Nix, assembly (with its dialect) and more, plus Dockerfile, Kubernetes (Helm and Kustomize), GitHub Actions, Terraform, Protobuf, YAML, JSON, TOML, XML and Markdown. See the coverage matrix.
Safe by default
Files that contain secrets, and credential-shaped files, are left out of the report. With --security the git history is scanned too.
Fast, and never blocked
The heavy scanning runs in a Rust core. If it is not available, an equivalent pure-Python scanner takes over. A missing tool is skipped with a hint, never a crash.
Cross-platform by design
Meant to behave the same on Linux, macOS, Windows and Android (Termux). CI runs on all three desktop systems.

Quick start

Install it once with pipx (Python 3.11+; no Rust needed, the wheels are prebuilt):

pipx install sarand-cli
sarand --version

Other ways (from source, Arch, development) are under Install.

Then run it inside any project:

cd ~/my-project
sarand --full

The last lines tell you where the report went (by default the Downloads folder). Example output:

→ Detected: Rust, Python (cargo)
→ Scan engine: Rust core
→ Running tests (Python, Rust, Shell, JSON, TOML, Markdown)...
→ Running quality checks (Python, Rust, Shell, JSON, TOML, Markdown)...
→ Running security checks (Python, Rust, Shell, JSON, TOML, Markdown)...
→ Rendering Markdown report...
✓ Report completed

============================================================
Project: /home/you/my-project
Detected: Rust, Python
Engine  : Rust core
Output  : /home/you/Downloads/sarand-my-project-report.md
Files   : 163 included / 0 skipped / 1 excluded (secrets)
Health  : 76.0/100 (C)
============================================================

How it works

flowchart LR
    P[("Your project")] --> D["Detect languages<br/>and layout"]
    D --> S["Rust core scan<br/>tree, stats, hashes"]
    D --> A["Language analyzers<br/>tests, quality, security"]
    D --> G["Git, environment,<br/>TODOs, secrets"]
    S --> H["Health score<br/>and AI summary"]
    A --> H
    G --> H
    H --> R{"Renderer"}
    R --> O1["Markdown"]
    R --> O2["JSON, text, HTML"]
    R --> O3["PDF, SARIF"]
    O1 --> AI(["Your AI assistant"])

The CPU-heavy part (walking the tree, counting lines, hashing files to find duplicates) is a Rust crate exposed to Python through PyO3 and maturin. Everything that changes often, the analyzers, renderers, health score and CLI, is plain Python. If the Rust extension cannot be built or loaded on your platform, sarand falls back to a pure-Python scanner that produces the same report, only slower.

What's in the report

Section What it tells you
Quick Context A short, bounded block at the top: project, structure, checks, critical findings, declared frameworks and what to read first
Architecture and risks Components, workspace members, entry points, Compose and Kubernetes items, and nine rule-based risks; each risk names the report fields it comes from and says what it does not show
Relevant source (--relevant-source) A small, byte-bounded selection of source snippets chosen by fixed signals; secret patterns are withheld line by line
Detected project Languages, build tools and entry points
Environment OS, CPU, memory and toolchain versions
Git Branch, dirty state and recent history
Health score 0–100 with a grade and concrete recommendations
AI summary A written overview and a suggested reading order
Project statistics Files, lines and language breakdown
TODO / FIXME markers Every marker, with its location
Test results Pass or fail per language, with output
Quality checks Linters, formatters and type checkers (--quality)
Security checks Vulnerability, secret and supply-chain checks (--security)
Known issues Problems sarand recognised in the tool output
Project tree and files The tree and, unless you pass --no-source, every included file
Which tools does sarand use for each language?

sarand drives the standard tools of each ecosystem. Nothing here is required: a tool that is not installed is skipped and sarand --doctor tells you how to install it.

Ecosystem Tools sarand can drive
Python tests: pytest · quality: ruff, mypy · security: pip-audit, bandit
Rust tests: cargo · quality: rustfmt, cargo-clippy · security: cargo-audit, cargo-deny
Go tests: go · quality: staticcheck · security: govulncheck
Node.js tests: npm · quality: eslint
TypeScript quality: tsc
CSS quality: stylelint
Zig tests: zig
Assembly built in: names the dialect of every assembly file, no external tool needed
Swift tests: swift, xcodebuild · quality: swift-format, swiftlint
SQL quality: sqlfluff
C/C++ detection: cmake · quality: clang-tidy · security: cppcheck
Java / Kotlin / Android tests: mvn, gradle (uses ./gradlew when present) · quality: checkstyle and spotbugs
Lua tests: busted · quality: luacheck
Ruby tests: bundle
PHP security: composer
Dart / Flutter tests: dart
Kotlin quality: ktlint, detekt
C# tests: dotnet
Shell tests: bats · quality: shellcheck, shfmt
YAML quality: yamllint
Markdown quality: markdownlint
JSON quality: jsonlint
TOML quality: taplo
XML quality: xmllint
R tests: Rscript
Perl tests: prove · quality: perlcritic
Julia tests: julia
Objective-C tests: xcodebuild
Groovy quality: codenarc
PowerShell tests: pwsh
Nix tests: nix · quality: nixpkgs-fmt
Haskell tests: stack, cabal · quality: hlint
Elixir tests, quality, security: mix (Credo and MixAudit only when the project depends on them)
Erlang tests, quality: rebar3 (EUnit, xref)
Scala tests: sbt · quality: scalafmt through sbt, when the project uses it
Dockerfile quality: hadolint
Kubernetes quality: helm lint per chart, kustomize build per overlay (never applies anything; remote bases and unbuilt dependencies are skipped); opt-in: with SARAND_KUBECONFORM_SCHEMAS set, rendered charts and overlays are validated by kubeconform against local schemas (docs/KUBERNETES.md)
Docker Compose quality: docker compose config per Compose file, with its override or variant (never builds, pulls or starts anything; variables are not interpolated, remote include: files are skipped)
GitHub Actions quality: actionlint
Terraform quality: terraform fmt, tflint (never init, plan or apply)
Protobuf quality: buf lint

Assembly needs no external tool. sarand recognises .asm, .s/.S, .nasm, .yasm, .masm, .fasm, .a51, .a65, .a86 and .z80 files in the project root and in the first-level src/, asm/, boot/, kernel/ and firmware/ folders, and names the dialect of each file in the "Detected project" section: x86 (NASM, GNU as with AT&T or Intel syntax, MASM/TASM, FASM; 16, 32 or 64-bit), ARM (A32/T32), AArch64, RISC-V, MIPS, PowerPC, 6502, Z80, AVR, Motorola 68000 and 8051. It is a transparent heuristic, not a parser: a file it cannot place is reported as Unidentified instead of a guess, and nothing is ever assembled or run.

Project-wide checks that run with --security: gitleaks (secrets, including git history) and syft (software bill of materials with a license summary). PDF output needs an HTML-to-PDF engine: wkhtmltopdf (upstream archived it in 2023, so some distributions no longer ship it) or WeasyPrint (pip install weasyprint, or pipx inject sarand-cli weasyprint for a pipx install; it also needs the Pango system library). If no engine works, sarand says why, writes the same report as Markdown next to the intended PDF path and exits non-zero. On Termux and Android neither engine has been verified; use --format html and print from a browser there.

Install

Requirements

Needed For
Python 3.11 or newer Running sarand
A Rust toolchain, 1.88 or newer (rustup.rs) Only to build from source; the PyPI wheels need none
pipx Recommended installer
Per-language tools Optional, see sarand --doctor

From PyPI (no Rust needed)

pipx install sarand-cli
sarand --version

The package is called sarand-cli on PyPI (the name sarand there belongs to an unrelated project); the command it installs is sarand. Prebuilt wheels cover Linux (glibc) on x86_64 and aarch64, macOS on Intel and Apple silicon, and Windows on x64, for every Python from 3.11 on. Other systems build from source, as below. To upgrade: pipx upgrade sarand-cli.

From source with pipx

pipx builds sarand in its own isolated environment and puts the sarand command on your PATH.

pipx install ~/sarand
sarand --version

To upgrade after pulling new source, use the installer script instead of a plain pipx install, which does not refresh an existing copy. It builds the current source first and only then replaces the old installation; if the build fails (no network, no Rust toolchain) your previous installation is restored, and it retries slow network failures on its own:

./install.sh

It finishes by printing the version it installed and tells you if a different sarand earlier on your PATH would still run instead of it.

If pipx itself is missing, install it with your package manager (sudo pacman -S python-pipx, brew install pipx, sudo apt install pipx) or with pip, then reload your shell:

python3 -m pip install --user pipx
pipx ensurepath

Arch Linux (AUR)

The AUR package is drafted but not published yet, so yay -S sarand does not work today. Use pipx.

Development install

pip install maturin
cd sarand
maturin develop --release

Building the package needs a Rust toolchain: the build backend is maturin, and pip install -e . fails without one (it tries to download Rust and gives up when it cannot). If the extension will not build on your platform (possible on some Termux/aarch64 toolchains), run sarand straight from the source tree instead. With no compiled core importable it uses the pure-Python scanner, and the report says Scan engine: pure-Python fallback:

python3 -m venv .venv && . .venv/bin/activate
pip install rich PyYAML filelock
PYTHONPATH=python python -m sarand --help

Point it at a project with -p, for example PYTHONPATH=/path/to/sarand/python python -m sarand -p ..

Platform notes: Windows, macOS, Android/Termux
  • Windows. install.sh is a Bash script. In PowerShell run pipx install . from the repository instead.
  • macOS. Nothing special: install pipx with Homebrew and follow the steps above.
  • Android / Termux. Everything works in the terminal. The paste helper (sarand.rc) copies to the clipboard through the OSC 52 terminal sequence, so it needs no clipboard tool and no graphical session.

Usage

I want to… Command
Analyse the current directory sarand
Analyse another project and lint it sarand --project ~/my-project --quality
Get the most complete report possible sarand --full
Run security checks sarand --security
Skip the slow vulnerability lookups sarand --security --skip-audit
Write JSON without running tests sarand --skip-tests --format json -o report.json
Export a PDF sarand --format pdf
Feed code-scanning tools sarand --security --format sarif
Leave the source out of the report sarand --no-source
Choose the output folder once sarand --set-output-dir ~/ai-reports
Cap the size of each embedded file sarand --full --max-file-size 1M
Speed up repeat runs sarand --cache
Check the environment sarand --doctor

--full is shorthand for "give me everything": it turns on --quality and --security and removes the limits on file size, tree depth and tree entries. A --max-depth, --max-entries or --max-file-size you pass yourself still wins.

Large projects and small devices

Before it renders anything, sarand tells you how much source it is about to embed (Embedding about 12.4 MiB of source from 163 file(s)) and warns when that looks too large for the memory this machine has free. A complete --full report of a big project can be slow, or run out of memory, on a phone or a 2 GB laptop; the warning never blocks the run. To get a lighter report, use --no-source, lower --max-file-size (the default is 2M; --full removes it), or leave --full out.

Running sarand again on the same project replaces its previous report at that path and says so, so reports never pile up under one filename.

All options
Option Meaning
-p, --project PATH Project root (default: current directory)
-d, --output-dir PATH Folder for the report
-o, --output-name NAME Report file name (default: sarand-<project>-report.<ext>)
--set-output-dir PATH Save PATH as the default output folder and exit
-f, --format FORMAT markdown (default), json, text, html, pdf or sarif
--skip-tests Do not run tests
--jobs N Start at most N external tools at once (default: one per CPU and per GiB of free memory, at most 8; the SARAND_JOBS variable works too)
--quality Run lint, format and type checks for each detected language
--security Run security and vulnerability checks for each detected language
--skip-audit Skip pip-audit and cargo-audit, whose database lookups can take tens of seconds
--full --quality + --security + no truncation limits
--max-depth N Maximum project tree depth
--max-entries N Maximum entries per tree level
--max-file-size SIZE Largest source file to embed, for example 512K, 2M or 1G (default 2M; larger files are listed as skipped). Overrides the no-limit behaviour of --full
--no-source Do not embed file contents
--no-health Skip the health score
--relevant-source[=TOKENS] Add a small selection of source snippets to read first, at most TOKENS × 3 bytes (default 6000 tokens, allowed 200 to 200000). Off by default
--focus TEXT With --relevant-source: prefer files whose path contains these words
--cache Skip re-scanning TODOs and secrets in files unchanged since the last --cache run
--clear-cache Delete this project's scan cache and exit
--doctor Diagnose the environment and exit
-v, --verbose / --debug More logging
--version Print the version and exit; warns when the running copy is a stale editable install

Security checks

--security adds the security tools of every detected language (for example bandit and pip-audit for Python, cargo-audit and cargo-deny for Rust, govulncheck for Go) and three project-wide checks:

Check What it does
Secret scan gitleaks looks for credentials in the working tree and the whole git history. Findings are redacted.
SBOM and licenses syft lists every dependency per ecosystem and summarises licenses. Copyleft is advice only, unless you add a license policy.
Lockfile check Confirms that the manifest has a lockfile and that the lockfile is not git-ignored.

Independently of this flag, sarand never copies a file that contains a detected secret into the report, and reports how many files it left out.

Trust model: scanning runs project code

You run What sarand starts Can project code run?
sarand --skip-tests Nothing beyond reading and hashing files, the secret and TODO scans, version probes of installed tools and read-only git commands No project toolchain. git itself honours the repository's own configuration
sarand (default) Adds the project's test suite with its own toolchain: pytest, cargo test, npm test, go test, mvn test or ./gradlew test, dotnet test, swift test, zig build test, phpunit, ... Yes: conftest.py, build.rs and procedural macros, the test script of package.json, the project's own gradlew wrapper script, ...
--quality Linters, formatters and type checkers Mostly read-only, but some run project-controlled code: npm run lint (a script from package.json), cargo clippy (build scripts and procedural macros), ESLint and stylelint (JavaScript config files), mypy plugins, bundle exec (the Gemfile is Ruby), Maven and Gradle plugin tasks
--security Dependency audits, gitleaks, SBOM (syft) They read manifests and lock files, but cargo audit, npm audit, pip-audit, govulncheck and bundler-audit (it downloads its advisory database first) contact the network, and most of them send package names and versions, and ./gradlew dependencyCheckAnalyze runs Gradle
--full All of the above Yes

What sarand does not do, and a test keeps it that way: install dependencies, run make, start a shell, or run a package.json script other than test and lint.

Safer ways to scan code you do not trust

  1. Use sarand --skip-tests (without --quality, --security or --full), which starts no project toolchain.
  2. Or scan inside a disposable VM, container or throwaway user that holds no credentials and, if possible, has no network.
  3. Add --no-source when you only want the structure and the health summary: it keeps file contents out of the report (it does not change what runs).
  4. Read a report before you share it. Secret exclusion is best effort (a list of credential-shaped file names, 16 content rules, and gitleaks with --security), not a guarantee.

To report a vulnerability privately, see SECURITY.md.

Check results and TODO markers

Each check ends as PASS, FAIL, SKIP (tool missing or not applicable) or INCONCLUSIVE. INCONCLUSIVE is for dependency-audit tools (cargo audit, pip-audit, npm audit, govulncheck, ...) that exited 0 but reported that they could not finish, usually because the network was unreachable. It counts as not run in the report's execution coverage instead of earning a green PASS, and a failing exit is never downgraded. The errors listed in a report come only from checks that failed.

The TODO scan skips golden, fixture and snapshot directories and Markdown or reStructuredText prose by default, and the report states how many markers it suppressed. Add project-specific exclusions in .sarand.toml:

[todo]
exclude_globs = ["vendor/*"]

Secret handling

Files whose name looks like a credential (.env*, *.pem, secrets.yaml, kubeconfig, .docker/config.json, *.tfvars, ...) are left out before their content is read, and so is any file in which the built-in scan finds a credential-shaped value. With --security, a file that gitleaks flags is left out too. If your project keeps deliberately fake credentials in its own tests, list those files so they stop lowering the health score:

[secrets]
fixture_paths = ["tests/test_secrets.py"]

Entries are fnmatch globs on the project-relative path (case-sensitive; * also matches /). The default is an empty list, so every finding counts. A listed file is still never copied into the report and its findings are still listed. A glob that would match every file is rejected, and so is any mistake in the table: sarand warns and counts every finding instead.

License policy

By default sarand only advises about copyleft licenses, because whether one matters depends on your project. If you know your rules, write them in a .sarand.toml at the project root and --security enforces them against the SBOM:

[licenses]
allow   = ["MIT", "Apache-2.0", "BSD-*", "ISC", "PSF-2.0"]
deny    = ["AGPL-*", "GPL-*"]
warn    = ["MPL-2.0"]
unknown = "allow"

[[licenses.exceptions]]
package = "somelib"
reason  = "GPL-3.0, used only as a build tool and never shipped"
Key Meaning
allow If set, every license must match one of these (or warn). Patterns are case-insensitive and support *.
deny A match is a violation and fails the check. deny always wins.
warn Acceptable, but reported for review.
unknown What to do with a package that reports no license: allow (default), warn or deny.
exceptions Per-package exceptions. A written reason is required, a version is optional.
  • A OR B lets you choose, so a package is judged by its best alternative; A AND B needs every part to pass.
  • Common non-SPDX spellings such as Apache 2.0 or PSFL are mapped to their SPDX ids. Any other unrecognised string must be listed in allow exactly as it is reported.
  • A mistake in the file (a typo like alow, a wrong type, invalid TOML) is an error, never silently ignored.
  • syft reads no license for Rust crates because Cargo.lock carries none, so keep unknown = "allow" there and let cargo deny cover Rust.

Health score

The score is transparent and adds up to 100:

Part Points
Tests pass 25
No critical errors in quality or security 20
Test and quality tooling present 15
Reasonable TODO count and code hygiene 15
Security tooling run and clean 15
Clean git state 10

Grades: A 90 and above, B 80, C 70, D 60, F below 60.

A score is only as trustworthy as the checks behind it, so every report states its execution coverage: how many of the checks you asked for ran to a verdict (6 of 11 requested checks), which ones did not run and why, and which groups had nothing requested. A check whose tool is not installed is skipped, and a skipped check proves nothing. When no check was requested at all there is no percentage and the report says so; it is never 100%. Coverage says what ran, not how complete or correct the analysis is. A security run in which every check was skipped no longer earns the full security points. See docs/EXECUTION_COVERAGE.md.

A security tool that fails can mean it could not run, it found an advisory, or a dependency broke a policy; sarand keeps these apart, lists every cargo audit / cargo deny advisory by id with its severity only when the tool printed one, and marks its applicability as unknown: an advisory is a tool result, not proof of exploitability. See docs/SECURITY_EVIDENCE.md.

Every finding has a stable id, so one problem told in several places is counted once (docs/FINDINGS.md); only a TODO or FIXME written as a task counts as debt and the other markers are shown by category (docs/MARKERS.md); every check has exactly one state (docs/CHECK_STATES.md); and Markdown, HTML, JSON, SARIF and text carry the same facts (docs/RENDERERS.md). The evidence behind these rules, with a before and after on a real project, is in docs/R13_COMPLETION_REPORT.md.

Configuration

The report folder is chosen in this order:

  1. --output-dir on the command line
  2. The SARAND_OUTPUT_DIR environment variable
  3. The folder saved with --set-output-dir
  4. ~/Downloads

The saved setting lives in a per-user config file:

System Location
Linux $XDG_CONFIG_HOME/sarand/config.json or ~/.config/sarand/config.json
macOS ~/Library/Application Support/sarand/config.json
Windows %APPDATA%\sarand\config.json

The --cache data is stored in the output folder under .sarand-cache.

More tools

Read the JSON report from a script

sarand --format json starts with a schema_version (MAJOR.MINOR). Adding a key raises MINOR and a script must ignore keys it does not know; removing, renaming or retyping one raises MAJOR and the CHANGELOG says so. Every key and field is listed in docs/JSON_SCHEMA.md (فارسی), and a test fails if the code and that page drift apart.

Give an AI only the code that matters

A report of a whole project can be far larger than a chat can use. --relevant-source adds one small block at the end of the report's context sections: snippets from files the report already includes, chosen by fixed signals, not by meaning. It is a selection, not a summary.

sarand --relevant-source
sarand --relevant-source=3000 --focus "login auth" --format json --no-source
Signal Weight
The path contains a --focus word 5
The file is changed or untracked in git 4
The file is an entry point 3
The file is in the report's "read first" list 2
A secret pattern matched in the file 2
The file has a TODO-style marker 1

Files are ranked by the sum of their weights; ties go to the file with more marked lines, then to the path, so the same input always gives the same block. At most 20 files are shown, files with identical content count once (the others are named), and each snippet states its file, line range and reason.

The size limit is on bytes: the block, with its headings, labels and line numbers, never exceeds TOKENS × 3 UTF-8 bytes. That is a conservative estimate, not a promise about any one model's tokenizer; the JSON report states bytes_cap and bytes_used. When space runs short, file names are kept before snippets, and what was dropped is counted.

Secrets are handled twice. The content of a file that sarand excluded for secrets is never read, and every line of every snippet is checked against the secret patterns just before it is written; a match becomes a line saying which pattern matched, never its value. A secret that no pattern recognises is not withheld, which is the same limit the embedded source has.

Paste a large report into a chat

Some chats take no file upload. python3 -m sarand.rc.command splits any file, typically a sarand --full report, into paste-sized chunks. Every chunk sits inside an integrity-checked envelope (session id, per-chunk hash and a final report hash) that an AI receiver can verify. It walks you through the chunks one at a time and remembers where you stopped, and on terminals that support OSC 52 (Termux included) it copies each chunk straight to the clipboard.

sarand --full -d ~/reports
python3 -m sarand.rc.command --source ~/reports/sarand-my-project-report.md

Run the second command again with no options for the next chunk. State is kept in .sarand-rc/. See docs/RC-AI-RECEIVER.md for the protocol as the receiving AI sees it.

Option Effect
--source FILE File to split (default: README.md, or the SARAND_RC_SOURCE variable)
(none) Send the next unsent chunk
-i, --info Show session and progress
-b, --back Send the previous block again
-br, --back-run Send the last history entry again
-n N Jump to block N
-c, --chunk N Send chunk N of the current block
--verify Check that the saved chunks rebuild the source byte for byte; sends nothing
--reset, --clean Delete the state and start a new session

Device storage and environment audit

python3 -m sarand.device_report.command is a separate, read-only tool. It scans a whole device, not one project, for space hogs, duplicate and stale files, build caches, package-manager footprints and Android/Termux environment details, and writes one Markdown report as evidence for a cleanup decision. It never deletes, moves, changes or installs anything.

python3 -m sarand.device_report.command --full -o ~/device-report.md
Device audit options
Option Effect
-o, --output PATH Report path
-r, --root DIR Extra scan root, repeatable (default: $HOME, plus /sdcard if present)
-x, --exclude PATH Exclude a path from every scan, repeatable
-q, --quick Skip the duplicate and stale-file scans, the two slowest
--full Always run those scans and remove the --top row cap
-n, --top N Rows per top-space table (default 30)
-d, --old-days N Age in days for a stale file (default 180)
-m, --min-file-size MB Minimum size for the large-files section (default 50)
-u, --dup-min-size MB Minimum size considered for duplicate scanning (default 5)
-D, --max-depth N Maximum scan depth, 0 for unlimited (default)
--min-top-space MB Minimum size for a row in the summary's top-space table (default 1.0)
--expand-aggregates List every cache directory instead of one line per pattern
--summary-only Render only the executive summary; excludes --full

Built-in diagnostics

sarand --doctor checks the Rust core, your Python version, every per-language tool and the PDF engines. Each line says whether the tool is present and, if it is not, the exact command that installs it. A missing tool is informational; only an unsupported Python version fails the command. sarand --doctor also shows which copy of sarand is running (its version, where it lives, whether it is an editable development install) and warns when a second copy on your PATH shadows it or when an editable install lags behind its source tree. Every command above also answers to --help.

Add a language with a plugin

Implement the LanguageAnalyzer protocol (matches, entry_points, run_tests, run_quality, and optionally run_security) in your own package and register it in your pyproject.toml:

[project.entry-points."sarand.analyzers"]
zig = "sarand_zig_plugin:ZigAnalyzer"

sarand finds it and runs it alongside the built-in analyzers. A plugin that raises, returns the wrong type or cannot be loaded is skipped with a reported reason; it never crashes a scan. The full contract, version compatibility rules and author workflow are in docs/PLUGINS.md, with a working example in examples/sarand-plugin-justfile.

Monorepos and workspaces

sarand detects Cargo workspaces and npm, Yarn and pnpm workspaces and lists their members. For Node workspaces it runs tests and lint inside each member (labelled packages/api: npm test) and skips whatever the root script already fans out, so nothing is reported twice. What is and is not supported, and how the health score treats members, is in docs/WORKSPACES.md.

Troubleshooting

sarand --version shows an old version right after installing

Another copy of sarand comes first on your PATH, typically a development virtualenv that is still active, and it shadows the one pipx just installed. ./install.sh names both copies when this happens, and sarand --doctor lists them. Run deactivate (or remove the old copy) and then hash -r. If it is a development install whose recorded version lags the source, maturin develop --release refreshes it.

sarand: command not found

Run pipx ensurepath, then open a new terminal. On Windows, also check that the pipx bin folder is on PATH.

The build fails with a Rust error

Install a Rust toolchain from rustup.rs and try again, or run sarand from the source tree on the pure-Python scanner, which needs no build (see the development install section).

A check shows as skipped

The tool behind it is not installed. sarand --doctor lists it with the install command.

The security checks are slow

Vulnerability databases are queried over the network. Add --skip-audit to skip pip-audit and cargo-audit; the static checks still run.

The report says files were excluded because of secrets

That is intended. Files that contain a detected secret are never written into the report. Remove or rotate the secret, then run again.

Uninstall

Installed with pipx:

pipx uninstall sarand-cli

Installed as a development install:

pip uninstall sarand

sarand keeps a few things outside the package. Delete them if you want a clean removal:

What Where
Saved settings The config file listed under Configuration
Reports Your output folder, ~/Downloads by default
Scan cache .sarand-cache inside the output folder (or run sarand --clear-cache first)
Paste-helper state .sarand-rc/ in the directory where you ran it

Contributing

AGENTS.md is the source of truth for architecture, conventions and the roadmap. Before opening a pull request, run:

ruff format .
ruff check .
mypy .
pytest -q

Continuous integration also runs cargo fmt, cargo clippy and cargo test, and repeats everything on Linux, macOS and Windows. The full checklist is in CONTRIBUTING.md. Please report vulnerabilities privately, as described in SECURITY.md.

License

Released under the MIT License.

Metadata

Release files for sarand-cli 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sarand-cli 0.8.0
File Size Uploaded Provenance Actions
sarand_cli-0.8.0.tar.gz 947.5 kB With provenance Details for sarand_cli-0.8.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sarand-cli 0.8.0
File Actions
sarand_cli-0.8.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for sarand_cli-0.8.0-cp311-abi3-win_amd64.whl
sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_x86_64.whl
sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_aarch64.whl
sarand_cli-0.8.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for sarand_cli-0.8.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
sarand_cli-0.8.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for sarand_cli-0.8.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
sarand_cli-0.8.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for sarand_cli-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
sarand_cli-0.8.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for sarand_cli-0.8.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 10.1 MB

Release files / sarand_cli-0.8.0.tar.gz

Download URL sarand_cli-0.8.0.tar.gz
Size 947.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c19eb1724248a8aa8ceacc025611fe1374a922b4606e8d2d62f68bd74edf9844
BLAKE2b-256 checksum
How to use checksums
c775229ce08fc01714a9975a57da03f6fca83bebe936db2c77b97ee25e23878d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-win_amd64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
6e0aca5ef89c88ec69d26dde5fa2caa2e7fbc39e9941220765d0eda022c586d0
BLAKE2b-256 checksum
How to use checksums
54b35d8d74817cb3668fc329da627f1e8e34a81549714f1c14edc4f53d8e6e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
a7e890eeabcc46a3b8d451f55e6ea2ea1690cd50d229ec572cf93fff6f385284
BLAKE2b-256 checksum
How to use checksums
5dda865f532e216cdf918619274b12b5e2599c4c03d927ab3fe54eb2f993e687
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 1.4 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
a58ab89df3bc449492d92208f2e6d88729f6390662f6534748a880acce72c662
BLAKE2b-256 checksum
How to use checksums
83cb7f555f646cf92d45af1792f0efebbd6857c83316193df555ffb62c66ad8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7196ea97037a41521f40d3fe82809b327986be3c7d23d71183366f787717c14d
BLAKE2b-256 checksum
How to use checksums
0e30c1bc5395425592cc459b70e0273840e293653d144cbecc9feac175210a90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.3 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
8ab20c1aafd1fc46bd14154ec6187490e9d23a2a4f322096ac33774c11359f80
BLAKE2b-256 checksum
How to use checksums
d37108294a228876137f528e0a6e8b05a6b2793f937d6b12c2690cf9865376ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
36798c88ea60b3e8ebf223b17e59683e9427b7180ed404f1a66e6c2c0ae4429b
BLAKE2b-256 checksum
How to use checksums
07346ba4536438989f0be8cb449a1d3242312c85f418f9c63ef0d2df99e3f5c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / sarand_cli-0.8.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL sarand_cli-0.8.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b13de3df5113bf93b5823d197b9eb2bb8425eb43fd6b621271dbb3a254f56518
BLAKE2b-256 checksum
How to use checksums
7d723668304aa9dd52264219e661ee8da391f383f563bf4567f36890997b2980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for sarand-cli 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for sarand_cli-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page