Overview
Thetools 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 aToolCheck struct (src/config.rs:22) with the following fields:
The name of the tool/command to check. This should be the executable name as it appears in PATH.
Semver version requirement (e.g.,
">=18.0.0", "^3.9.0"). If omitted, only checks that the tool is installed.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
Theversion field supports standard semver syntax:
| Syntax | Meaning | Example |
|---|---|---|
>=X.Y.Z | Greater than or equal to | >=18.0.0 |
^X.Y.Z | Compatible with (minor versions) | ^3.9.0 allows 3.9.x, 3.10.x but not 4.0.0 |
~X.Y.Z | Approximately equivalent to (patch versions) | ~1.2.3 allows 1.2.x but not 1.3.0 |
X.Y.Z | Exact version | 1.65.0 |
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 defaultversion: Defaults toNone(no version check)required: Defaults totrue
