Facts — a Go port of Puppet Facter

Every fact about the machine.

Facts discovers hardware, networking, OS, cloud metadata, and operator-supplied facts as one canonical tree: embeddable as a Go library, scriptable as the facts CLI.

$ go get github.com/ncode/facts
$ brew install ncode/tap/facts
$ facts --json os.family kernel.version.full
Library

Hermetic by default.

An engine is an isolated, immutable unit of discovery configuration. It reads core facts only until you opt into config files, external facts, registered facts, or system defaults.

Engine

Construct explicit discovery inputs with no package-global collector and no shared mutable state.

Snapshot

Discover once, then query and decode an immutable canonical tree as often as needed.

Typed views

Decode subtrees into caller-owned Go types and fail loudly when the shape does not match.

CLI

Every fact, one command.

The facts binary keeps the Ruby Facter process-boundary contract for output formatting, exit status, stderr diagnostics, external facts, environment facts, and config semantics.

$ facts os.name
Darwin

$ facts --external-dir ./facts.d site_role
web