Installation
Hyena requires Dart SDK 3.11 or newer (below 4.0.0) and depends on analyzer: ^14.0.0. Flutter projects can use the Dart SDK bundled with Flutter.
Because Hyena is a development dependency, other dev tools in the same project, such as code generators and custom lint plugins, must also accept analyzer 14.x. If one still requires an older analyzer, pub get reports a version conflict.
Add the development dependency
Section titled “Add the development dependency”For a Dart project:
dart pub add dev:hyena_dartFor a Flutter project:
flutter pub add dev:hyena_dartBoth commands update the project’s pubspec.yaml and resolve Hyena into that project’s package configuration:
dev_dependencies: hyena_dart: ^3.0.0Commit the resulting dependency files according to the normal rules for the project.
Hyena supports only project-local execution. Run it from the project that declares the dependency:
dart run hyena_dart analyze .This resolves the Hyena version selected by the project’s lockfile. It keeps local development and CI on the same analyzer version and avoids a separate global command mapping.
Source checkout
Section titled “Source checkout”Use a checkout when contributing to Hyena itself:
git clone https://github.com/Chandram-Dutta/hyena_dart.gitcd hyena_dartdart pub getdart run bin/hyena_dart.dart analyze .To test that checkout from another project, declare it as a project-local path dependency:
dev_dependencies: hyena_dart: path: ../hyena_dartThen run dart pub get and invoke dart run hyena_dart ... from the consuming project.
Prepare the target
Section titled “Prepare the target”Before running dead-code analysis, resolve the target package:
dart pub getDead-code analysis asks the official Dart analyzer to resolve every included Dart file. A non-generated file that fails to resolve, has analysis or syntax errors, or cannot be read is skipped: Hyena prints Warning: skipped <path>: <reason> to stderr and keeps analyzing the rest of the target. Generated files that fail resolution are silently ignored without a skippedFiles entry. Skips do not directly change the exit code, but missing references can cause dead-code findings that trip --fail-on; see Analysis flow. Complexity-only analysis parses syntax and does not require resolved elements.
If the project uses code generation, run it before analysis so generated files are up to date.
Confirm the installation
Section titled “Confirm the installation”dart run hyena_dart --helpdart run hyena_dart complexity --helpdart run hyena_dart --versiondart run hyena_dart:hyena_mcp --versionYou should see the analyze, dead-code, and complexity commands. The version commands print hyena_dart 3.0.0 and hyena_mcp 3.0.0 respectively.
See Migrating from v2.x to v3.0 before updating an existing v2 installation, or Migrating from v1.x to v2.0 for an older one.
