Hello World Workflow
This guide builds the smallest end-to-end workflow:
- You create a commit with
dwp-state: build - AYNIG runs
.aynig/command/build - The command emits
SET_STATE {...}and AYNIG writes the next state commit
1) Initialize the repo
aynig init2) Create a command
cat > .aynig/command/build <<'EOF'#!/usr/bin/env bashset -euo pipefail
echo "Build requested: ${BODY}" > build.out
git add build.outprintf '%s\n' 'SET_STATE {"state":"done","subject":"build: done","body":"Build completed.","keep_trailers":true}'EOF
chmod +x .aynig/command/build3) Request a build (commit protocol)
Create a commit with a trailer:
chore: request build
Build this project.
dwp-state: build4) Run
aynig run5) Verify
dwp-stateshould now bedonebuild.outshould exist
Notes
- AYNIG does not infer the next state — the command declares it with
SET_STATE {...}. - Use
COMMANDS.mdin your repo to document which states exist.