Skip to content

Installation

Hyena requires Dart SDK 3.10 or newer. Flutter projects can use the Dart SDK bundled with Flutter.

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

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. It stops and lists failures if any included file has an analyzer error. Complexity-only analysis parses syntax and does not require resolved elements.

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 2.0.0 and hyena_mcp 2.0.0 respectively.

See Migrating from v1.x to v2.0 before updating an existing installation.