Skip to content

Getting started

Setting assay up takes one development dependency, one line in analysis_options.yaml and one program installed per machine. Steps 1 to 3 do each by hand; assay init, in step 4, writes the line of step 2 for you.

Terminal window
dart pub add dev:assay_lints
# in a project that uses Flutter
flutter pub add dev:assay_lints

assay_lints holds the three presets and nothing else: no code and no dependencies, so it can never make your pub get fail over a conflict. It needs Dart 3.11 or later.

At the top of the project’s analysis_options.yaml:

include: package:assay_lints/recommended.yaml

That one line is all you write. The preset names the analyzer plugin, the package assay, at exactly the version of assay_lints. The analysis server fetches the plugin the first time it starts for the project, apart from your dependencies, and violations show in the editor and in dart analyze. That first start compiles the plugin, once per project directory.

The three presets are core, recommended and strict. Moving to another is a change of one word.

3. Install the command-line program, once per machine

Section titled “3. Install the command-line program, once per machine”
Terminal window
dart pub global activate assay_cli

This installs the command assay. Run it from the package root, the directory that holds pubspec.yaml and analysis_options.yaml:

Terminal window
assay check

It reads the preset from the project’s own assay_lints, so fetch the dependencies first (dart pub get or flutter pub get). Until you do, every command stops with The file package:assay_lints/recommended.yaml cannot be read., and the Next: row of its verdict says to fetch the packages.

dart pub global activate puts the command in the pub cache’s bin directory: ~/.pub-cache/bin on macOS and Linux, %LOCALAPPDATA%\Pub\Cache\bin on Windows, or bin under PUB_CACHE where that variable is set. If that directory is not on your PATH, run the program as:

Terminal window
dart pub global run assay_cli:assay <command>

Or put the directory on the PATH, then open a new terminal:

  • macOS (zsh is the default shell): add export PATH="$PATH:$HOME/.pub-cache/bin" to ~/.zshrc.
  • Linux: add the same line to ~/.bashrc, or to the start-up file of your shell.
  • Windows: add %LOCALAPPDATA%\Pub\Cache\bin to your user’s Path under Settings → System → About → Advanced system settings → Environment Variables.

The agent plugin runs with the agent’s PATH, which can differ from your terminal’s, and also looks in the pub cache’s bin directory. If assay is anywhere else, set its command in the setting assay_command (Claude Code) or the environment variable ASSAY_COMMAND (Codex); see The gate and agent setup.

assay init does step 2 for you:

Terminal window
assay init # adopt recommended, or keep the preset adopted
assay init --preset strict # adopt strict instead

Without --preset, init keeps the preset the options file already includes (a project on strict stays on strict), and adopts recommended where it includes none. With --preset, it adopts that preset and says which one it replaced, so pass it only when you mean to change the preset.

In a project that has no analysis_options.yaml:

╭──────────────────────────────────────────────────────────────────────────────╮
│ assay init │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Files ───────────────────────────────────────────────────────────── 1 file ─╮
│ analysis_options.yaml created │
│ + Its `include:` names `package:assay_lints/recommended.yaml`: the project │
│ adopts the preset recommended. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────────────╮
│ ✓ 1 file changed. │
╰──────────────────────────────────────────────────────────────────────────────╯
To judge an AI agent's changes at the end of each turn, install the agent plugin
of assay: it is separate from this program.

init edits an existing options file in place and keeps everything else in it. It never writes a plugins: entry or an agent hook, and a second run changes nothing. It ends by saying that the agent plugin, which holds Claude Code or Codex to the gate, is installed in the agent (The gate and agent setup). Its options, output and exit codes are on assay init.

  • Add assay or assay_cli to its pubspec. The plugin comes through the preset, and the program is installed per machine. A project that depends on assay brings back the dependency conflict this layout avoids; that is not supported.
  • Run dart run assay_cli:assay. The program is installed by global activation only.
  • Write a plugins.assay entry, in its own options file or one it includes. It would replace the preset’s entry and drop its rule map, so assay reports it as a configuration error. Tune everything under the assay: key (Configuration).
  • Include a file of assay by path. Adopt a preset by its package:assay_lints/… address only.

assay is three packages, and you write each name in its own places.

Name Where you write it
assay_lints The development dependency in pubspec.yaml, and the include: address: include: package:assay_lints/recommended.yaml.
assay The assay: key of analysis_options.yaml; the command, assay check; the prefix of a suppression, // ignore: assay/avoid_dynamic. It is also the name of the analyzer plugin, in the plugins.assay entry that the preset carries and a project never writes.
assay_cli Only to install the program, dart pub global activate assay_cli, and in the fallback form dart pub global run assay_cli:assay <command>.

The prefix of a suppression is assay/, the plugin’s name, never assay_lints/. A suppression can also name an assay rule by its name alone; see Suppressions.

Dart 3.11 and later, within the analyzer’s major version 14: the plugin and the program accept analyzer from 14.3.0 to below 15.0.0. assay’s own CI runs on Dart 3.11 and on the newest stable Dart.
Flutter Any release whose Dart is 3.11 or later.
macOS and Linux Supported.
Windows Not supported in this version: a known defect stops every command at start, to be fixed before the release. The agent plugin has a launcher for Windows PowerShell, and its POSIX launcher runs where Claude Code runs hooks with Git Bash.