Skip to content

Quickstart: CLI

This guide walks you through installing the wh CLI, creating a repository, and writing your first data — all from the terminal.

Prerequisites: You’ll need a WarmHub account. The CLI will prompt you to sign in on first use — see Getting Access for details.

The CLI is currently published to GitHub (requires Node 22+):

Terminal window
echo "@warmhub:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc
Terminal window
npm install -g @warmhub/cli@next
wh --version

After installing, the wh command is available everywhere.

Writing data requires authentication. Log in with a single command:

Terminal window
wh auth login

This opens your browser — sign in with email, Google, or GitHub. After you confirm, the CLI saves your credentials and auto-refreshes them in the background.

Verify it worked:

Terminal window
wh auth status

For CI/CD or headless environments, see Getting Access for non-interactive options including personal access tokens.

Organizations are the top-level namespace. Create one to hold your repositories:

Terminal window
wh org create myorg

A repo is where all your data lives — shapes, things, assertions, and commits:

Terminal window
wh repo create myorg/world -d "My first repo"

Most wh commands operate on a specific org/repo. Set it once with wh use so you don’t need --repo on every command:

Terminal window
wh use myorg/world

This writes a .wh file in the current directory. All subsequent commands in this directory will target myorg/world automatically.

You can also specify a repo per-command with the --repo flag, or set the WARMHUB_REPO environment variable. The CLI resolves the target repo using this priority: --repo flag > WARMHUB_REPO env > .wh file.

Shapes define the structure of your data. Create a Location shape with three fields:

Terminal window
wh shape create Location --fields '{"x":"number","y":"number","label":"string"}'

All data writes go through commits. Add a thing named cave under the Location shape:

Terminal window
wh commit create --add cave --shape Location --data '{"x":3,"y":7,"label":"Dark Cave"}' -m "Add first location"

This creates an atomic commit containing a single add operation. The thing’s wref (WarmHub reference) is Location/cave.

See all active things in the repository:

Terminal window
wh thing head

This returns the current snapshot of active repo data at the latest version.

WarmHub hides system-managed component infrastructure records by default.

Component-seeded data things under your own shapes are still included. Add --exclude-components to hide all component-owned data things too.

Retrieve a single thing by its wref:

Terminal window
wh thing view Location/cave

Assertions are claims about another thing. Create a Belief shape, then assert something about the cave:

Terminal window
wh shape create Belief --fields '{"safe":"boolean","confidence":"number"}'
Terminal window
wh assertion create --shape Belief --about Location/cave --data '{"safe":true,"confidence":0.8}'

The assertion is linked to Location/cave via its about reference. This relationship is immutable — once set, it cannot be changed.

List all assertions about a specific thing:

Terminal window
wh assertion list Location/cave

See recent commits to understand the history of changes:

Terminal window
wh commit list --last 5

Every mutation in WarmHub is recorded as a commit with an author, message, timestamp, and stable commit ID.

JSON output. Add --json to any command for machine-readable output:

Terminal window
wh thing head --json

Reactive mode. Use --live to watch for real-time changes:

Terminal window
wh thing head --live

Agent context. The wh prime command outputs a complete context dump — shapes, sample wrefs, commit history, and write examples — in a single call. This is designed for AI agents that need to bootstrap their understanding of a repo:

Terminal window
wh prime
wh prime --json # structured version
  • Core Concepts — if you haven’t already, review the mental model behind orgs, repos, shapes, things, assertions, and commits
  • MCP Quickstart — connect an AI agent to WarmHub via the Model Context Protocol
  • Data Modeling — learn about wrefs, shapes, things, and assertions in detail
  • CLI Reference — full command reference for all wh commands