Skip to content

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.

For a Dart project:

Terminal window
dart pub add dev:hyena_dart

For a Flutter project:

Terminal window
flutter pub add dev:hyena_dart

Both commands update the project’s pubspec.yaml and resolve Hyena into that project’s package configuration:

pubspec.yaml
dev_dependencies:
hyena_dart: ^3.0.0

Commit 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:

Terminal window
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.

Use a checkout when contributing to Hyena itself:

Terminal window
git clone https://github.com/Chandram-Dutta/hyena_dart.git
cd hyena_dart
dart pub get
dart run bin/hyena_dart.dart analyze .

To test that checkout from another project, declare it as a project-local path dependency:

pubspec.yaml
dev_dependencies:
hyena_dart:
path: ../hyena_dart

Then run dart pub get and invoke dart run hyena_dart ... from the consuming project.

Before running dead-code analysis, resolve the target package:

Terminal window
dart pub get

Dead-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.

Terminal window
dart run hyena_dart --help
dart run hyena_dart complexity --help
dart run hyena_dart --version
dart run hyena_dart:hyena_mcp --version

You 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.