Installation
Install hammerkit, write a build file and run your first cached task.
Tasks that declare an image run in a container, so you also need a running
container engine such as Docker. Check it
with docker info.
Install hammerkit
npm install --global hammerkitDescribe a task
Create a .hammerkit.yaml next to your code. A task names the image it runs in,
the files it reads (src) and its commands:
tasks:
hello:
image: alpine:3.21
src: [hello.txt]
cmds:
- cat hello.txtecho "It's hammer time" > hello.txtRun it
hammerkit hellotask: hello - It's hammer time
Summary:
hello executed 2.3s
1 executed, 0 cached (0% cache hit), 2.3s totalRun it again
Nothing in src changed, so hammerkit reuses the result instead of running the
task:
Summary:
hello cached 0ms
0 executed, 1 cached (100% cache hit), 11ms totalChange hello.txt and it runs again. That's the whole idea —
caching explains what counts as an input.
In CI
The container image contains hammerkit and can be used with Docker-in-Docker (dind) — the usual approach for container builds on CI systems.
The no0dles/hammerkit-github-action action installs hammerkit; it needs
actions/setup-node first.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
- uses: no0dles/hammerkit-github-action@v1.3
- run: hammerkit buildTo reuse results between CI runs and machines, see caching strategy in CI.