harn env
harn env [section]A quick health check of the local toolchain. Run it with no arguments for the full report, or pass one section name to scope it. harnery ships three generic sections (language runtimes, Docker, and git), and each check reports ok, missing, warn, or info. Useful for confirming an environment is set up before starting work, or for a fast “why isn’t this working?” glance.
Sections
Section titled “Sections”| Section | Reports |
|---|---|
runtimes |
Node.js, Bun, Python, and PHP versions (or “not found”). |
docker |
Docker version and how many containers are running. |
git |
The current branch, plus submodule initialization status when run inside a monorepo. |
These are the sections harnery core ships. It carries no provider-specific checks itself.
Host-registered sections
Section titled “Host-registered sections”An embedding host can add its own sections through context.envSections when it builds the program (see embedding). Each entry is a name mapped to an async probe returning rows in the same shape as the built-in checks, and it merges in after the generic sections, so harn env <name> and the full report pick it up automatically. This is how a host exposes, say, cloud-provider connectivity checks without harnery core knowing about any particular cloud.
Examples
Section titled “Examples”# Full report across every section (generic + any host-registered)harn env
# Just the language runtimesharn env runtimes
# Docker daemon + running containersharn env docker
# Current branch + submodule statusharn env git- Every check runs defensively: a missing CLI is reported as
not found/not installedrather than throwing, so the full report always completes. - The
gitsection only adds the submodule row whenharnis invoked inside a monorepo whose root and submodule list are known; standalone, it reports just the current branch. - Passing an unknown section name prints the list of valid sections (including host-registered ones) and exits non-zero.