Hammer CLI Overview
Hammer CLI brings the same build engine from the Hammer app to your terminal. Build sites, validate content, and integrate Hammer into any workflow — all from the command line.
What is Hammer CLI?
Hammer CLI is a command-line interface that gives you full access to the Hammer build engine from your terminal. It uses the exact same compiler as the Hammer app — your builds produce identical output whether you use the GUI or the CLI.
With Hammer CLI you can:
- Build Hammer sites from the terminal or shell scripts
- Validate content structure and required fields before deployment
- Run health checks on your project configuration
- Integrate Hammer into CI/CD pipelines and automation workflows
- Build multiple sites in parallel across your machine
The CLI binary is called hammer. Running hammer with no subcommand defaults to hammer build.
Why Use the CLI?
The Hammer app is ideal for visual development with live reload and project management. The CLI complements it for workflows where a terminal is the better tool.
Automation
Script your builds, validate content on commit, and deploy automatically. The CLI supports machine-readable JSON output for every command, making it straightforward to integrate with any toolchain.
CI/CD Pipelines
Run hammer check and hammer build as quality gates in your deployment pipeline. Consistent exit codes and structured output make it easy to catch issues before they reach production.
Team Workflows
When multiple people contribute content to a Hammer site, the CLI lets you validate all content files against your schema without opening the app. Run checks locally, in pre-commit hooks, or in your CI service.
Batch Operations
Build multiple Hammer sites in one go. The CLI has no global state or lockfiles, so you can run multiple hammer processes concurrently on different projects without conflicts.
CLI vs the Hammer App
The CLI and the Hammer app share the same build engine. Here's how they compare:
| Feature | Hammer App | Hammer CLI |
|---|---|---|
| Build engine | HammerBuilder | Same HammerBuilder |
| Content Mode | Full support | Full support |
| Build output | Identical | Identical |
| Live reload | Yes | Not available |
| Forge deployment | One-click deploy | Builds for Forge (deploy separately) |
| Project management | Multi-project sidebar | One project per invocation |
| JSON output | N/A | All commands |
| Platform | macOS (SwiftUI) | macOS (Terminal) |
Available Commands
Hammer CLI provides four commands:
-
hammer build— Run the full build pipeline and output your site to theBuild/directory -
hammer check— Validate content files against your schema (requires Content Mode) -
hammer info— Display project structure and configuration details -
hammer doctor— Run environment and project health checks
Every command supports --format json for machine-readable output. See the Command Reference for full details on each command.
Next Steps
Ready to get started? Here's where to go next:
- Getting Started — Install the CLI and run your first build
- Command Reference — Full options and output for every command
- Automation & CI/CD — Integrate Hammer into your deployment pipeline