Skip to content

Getting Started

Quickstart

Install Fensu, initialize a repository, and read your first faults in a few minutes.

This guide gets Fensu running against a Python repository and walks through reading its output.

pip install fensu
fensu --version

Fensu needs Python 3.12 or newer.

The fensu distribution provides the Python authoring/API surface and installs the lockstep fensu-cli binary distribution, which owns the fensu command. Use that executable for built-in commands; python -m fensu is retired. See the CLI execution model for native commands and custom-rule hosting.

Fensu includes a compiled analysis core. Prebuilt wheels cover Linux (x86_64 and aarch64), macOS (Intel and Apple silicon), and Windows (x86_64). Where no compatible wheel is available, pip builds from source; this requires Rust 1.95 or newer, including when installing fensu-cli from its source distribution.

fensu init is the fastest way to start. It detects your layout, writes a fensu.toml with the full ruleset enabled, runs a first check to show current drift, and installs agent skill files:

fensu init --yes

The native initializer is non-interactive. For an empty repository with no code, run fensu init --yes --name my_package; init scaffolds a src/ package and tests/ directory. Pass --no-skills only when automation explicitly needs configuration without repository-local agent guidance.

Existing configuration is preserved: init changes nothing when fensu.toml already exists. Use fensu skills to install or refresh guidance for a configured project. See fensu init for detection and setup options, or the Rust and TypeScript/SvelteKit guides for language-specific configuration.

Verify that every generated local skill is present and current before calling onboarding complete:

fensu skills --check

Prefer to write configuration by hand? A minimal fensu.toml only needs your product roots:

roots = ["src/my_package"]

tests defaults to ["tests"], tooling is optional, and every rule family is on by default. See Configuration for scopes, selection, and the full schema.

Run Fensu against the configured repository:

fensu check

If everything conforms, Fensu prints a summary and exits 0:

Found 0 faults

When it finds a problem, it prints a diagnostic for each fault and exits 1. The output points at the exact line, shows the source, and explains the fix:

FFL102 import 'my_package.payments.processing._helpers.charge_card' reaches into internal structure of 'my_package.payments'
--> src/my_package/orders/checkout/main/place_order.py:1:0
|
1 | from my_package.payments.processing._helpers.charge_card import charge_card
| ^
|
= help: Import from classes, models, types, constants, exceptions, or a thin main/ entry.

Every diagnostic has two parts: the message states the contract that was violated, and the = help: line states the normal correction. The messages are written to be read at the moment of violation, by a person or an agent, so the fix is clear without opening the docs. Look up any code in full with fensu rule <CODE>.

fensu check cannot see that two valid functions are the same logic. Run the advisory duplicated-code report to find copies that may have drifted apart:

fensu dupes

It exits 0 whatever it finds, so there is nothing to fix before you move on. See Duplicated code for how to read the clusters.