🏋️ Challenges — Module 04 (Automation)¶
- Headless: run
opencode run --format json "List the TODOs"and parse it withjq. - Sessions: chain two commands with
--continue, then export the session with--sanitize. - CI: copy
examples/ci/opencode-review.ymlinto a test repo, set the secret and open a PR with an intentional bug. - Quality gate: make the job fail when the output contains a high-severity finding.
💡 Solution (challenge 1)
opencode run --format json "List the TODO comments" | jq -r '.text'
💡 Solution (challenge 3 — essence)
- run: npm install --global @opencode/cli
- run: opencode run --standalone --agent reviewer "Review the PR and list findings by severity."
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
➡️ Module 05