Skip to main content

Overview

The tools section validates that required command-line tools are installed and meet version requirements. This is useful for ensuring developers have the correct versions of languages, package managers, and build tools.

Configuration

Each tool check is defined by a ToolCheck struct (src/config.rs:22) with the following fields:
string
required
The name of the tool/command to check. This should be the executable name as it appears in PATH.
string
Semver version requirement (e.g., ">=18.0.0", "^3.9.0"). If omitted, only checks that the tool is installed.
boolean
default:"true"
Whether the tool is required. If true, missing or incompatible tools will cause validation to fail.

Examples

Basic Tool Check

Check that a tool is installed without version requirements:

Version Requirements

Specify minimum versions using semver syntax:

Optional Tools

Mark tools as optional when they’re nice-to-have but not essential:

Real-World Examples

Semver Version Syntax

The version field supports standard semver syntax:
If the version field is omitted or set to null, envcheck will only verify that the tool is installed without checking its version.

Default Behavior

From the struct definition in src/config.rs:22:
  • name: Required field, no default
  • version: Defaults to None (no version check)
  • required: Defaults to true
When required: true, the validation will fail if:
  • The tool is not found in PATH
  • The tool version doesn’t match the specified requirement