Skip to content

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.

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.

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.

Terminal window
# Full report across every section (generic + any host-registered)
harn env
# Just the language runtimes
harn env runtimes
# Docker daemon + running containers
harn env docker
# Current branch + submodule status
harn env git
  • Every check runs defensively — a missing CLI is reported as not found / not installed rather than throwing, so the full report always completes.
  • The git section only adds the submodule row when harn is 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.