Installation
Hyena requires Dart SDK 3.10 or newer. Flutter projects can use the Dart SDK bundled with Flutter.
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. Commit the resulting dependency files according to the normal rules for the project.
Hyena v2 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. It stops and lists failures if any included file has an analyzer error. Complexity-only analysis parses syntax and does not require resolved elements.
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 2.0.0 and hyena_mcp 2.0.0 respectively.
See Migrating from v1.x to v2.0 before updating an existing installation.
