Skip to content
kareki Documentation

kareki Documentation

kareki is a workspace-wide dead code finder for Dart and Flutter. It follows references across Melos and pub workspaces to find unused public APIs, files, dependencies, and parameters that package-local analysis cannot see.

It is designed for real codebases: generated code can be described with presets, existing findings can be captured in a baseline, and configuration drift can be checked with kareki doctor.

Quick start

Add kareki to your development dependencies:

pubspec.yaml
dev_dependencies:
  kareki: ^0.10.2

Install the project’s dependencies and run code generation, then execute from the workspace root:

dart run kareki

What it finds

RuleFinds
unused_elementPublic declarations with no caller in the workspace
unused_fileDart files that are never imported, exported, or used as a part
unused_pub_dependencyDeclared packages with no recognized source, analyzer configuration, native plugin, or font asset use
test_only_usedLibrary declarations referenced only by tests
unused_parameterParameters never read by their declaration
unused_parameter_optionalOptional parameters never passed at any call site

Tool comparison

FeaturekarekiciachDart Code Linterdependency_validatorDart standard analysis
Detect unused public declarations and members✅✅✅——
Detect unused private declarations and members✅✅✅—✅
Detect unused values of public enums✅✅✅——
Detect cycles of public declarations unreachable from entry points✅————
Detect unused Dart files✅—✅——
Detect unused pub dependencies✅——✅—
Detect optional public API parameters never supplied by callers✅————
Detect public declarations used only by tests✅————
Dedicated unused-l10n checks✅—✅——
Report only new findings using a baseline✅————
Check stale exclusions and baseline entries✅————
Automatically remove unused public declarationsNot planned✅———

See the comparison details for required settings, limitations, and versions compared.

Explore the documentation

  • CLI reference — commands, options, formats, and exit codes
  • Configuration — workspace settings, presets, exclusions, and suppressions
  • Baseline — adopt kareki incrementally in an existing codebase
  • Doctor — detect stale exclusions and suppressions
  • How it works — understand the analysis pipeline and its boundaries
  • Comparing similar tools — ciach, Dart Code Linter, and other Dart tools
  • Best practices — schedule cleanup pull requests with an AI agent

Links

Last updated on