Your first X07 program
This page shows the minimal “hello world” shape for agents and for humans.
X07 programs are stored as x07AST JSON (*.x07.json). Agents should modify programs via JSON Patch applied to a known-good base.
Create a project (canonical)
mkdir myapp
cd myapp
x07 init
This creates:
x07.json(withosandsandboxprofiles)x07.lock.jsonsrc/main.x07.json(a minimal program)tests/tests.json+tests/smoke.x07.json(a harness smoke test)
If you are creating a publishable package repo (for x07 pkg publish), use x07 init --package instead of x07 init.
Make it return bytes
Create patch.json:
[
{"op":"replace","path":"/solve","value":["bytes.lit","hello\\n"]}
]
Apply and validate:
x07 ast apply-patch --in src/main.x07.json --patch patch.json --out src/main.x07.json --validate
x07 fmt --input src/main.x07.json --write
Lint
x07 lint --input src/main.x07.json
x07 lint prints an x07diag JSON report to stdout.
Run
x07 run
The runner prints a JSON report; the program’s bytes output is in solve_output_b64.
Next
- For packages and lockfiles, see Packages.
- For the repair loop, see Repair loop.