Walkthrough

Step-by-step guide to producing hello-world-pico.
TipTry it yourself

Follow along in your own environment. Copy the commands and adapt them to match your setup.

ImportantBefore you start

Complete the one-time setup so that command -v pico points at this repository’s bin/pico and not at /usr/bin/pico (the Alpine/nano text editor).

Step 1 — Set up your working directory

From the root of your local clone of the academy repository, create a scratch working directory for the lab and enter it:

mkdir -p work/hello-pico && cd work/hello-pico

The work/ directory is ignored by git so anything you create there stays local. Starter files (if any) live under downloads/. For Hello Pico the starter directory is intentionally empty — you will author the single Rule yourself.

Step 2 — Author your first Rule

Create rules/hello.yaml with a single Rule that declares a greeting:

# rules/hello.yaml
id: rule.hello
kind: greeting
value: "Hello, Pico!"

This is the minimum declarative input the Parser needs.

Step 3 — Run the Parser

Run the Parser against the rule file to produce an internal representation:

pico parse rules/hello.yaml --out build/parsed.json

Inspect build/parsed.json — it should contain the same id, kind, and value fields, plus parser-added metadata such as _parsed_at and _parser_version.

Step 4 — Run the Composer

Turn the parsed representation into a Pico:

pico compose build/parsed.json --out build/hello-world-pico

The Composer writes an executable hello-world-pico artifact to build/hello-world-pico.

Step 5 — Verify

Confirm the Pico prints the expected greeting:

./build/hello-world-pico
# → Hello, Pico!

Troubleshooting

WarningHeads up
  • If pico opens a text editor instead of running, your shell is still resolving pico to /usr/bin/pico. Re-run the PATH export from one-time setup and confirm with command -v pico.
  • If pico parse fails, re-read rules/hello.yaml for YAML indentation errors or unsupported keys — the reference Parser only accepts id, kind, and value.
  • If the Composer step fails, delete build/ and re-run from Step 3.

Next

Compare your result against the reference solution.