Getting Started
Junior hands tasks to an LLM through deterministic runbooks; the built-in flagship — and this walkthrough — is code review. Five minutes from zero to a structured review of your changes. The same mechanics drive any runbook you write (Runbooks in YAML).
1. Install
Section titled “1. Install”The core install is the CLI plus the default pydantic harness (pydantic-ai):
uv tool install "junior @ git+https://github.com/mishachepi/junior.git"The default harness makes one structured API call — export OPENAI_API_KEY or
ANTHROPIC_API_KEY and there is nothing else to set up. Prefer a local coding-agent CLI
instead? --harness claudecode / codex / pi need no API key, only the CLI logged in.
Verify the setup — junior list shows every runbook and harness, with install state and
readiness:
junior listHarnessesclaudecode * claude CLI subprocess (no API key) ✓ installed · readycodex codex CLI subprocess ✗ not installed...If claudecode says ✓ installed · ready, you’re good. Prefer another harness —
codex, pydantic, or pi for local models? Each is one extra away —
see the install matrix and Choosing a harness.
2. Configure once
Section titled “2. Configure once”junior initThe wizard walks you through every choice and explains each one: where to save the
config (global ~/.config/junior/settings.yaml, or local ./.junior.yaml to
commit and share with your team), the runbook, the harness, and the output.
API keys are never written to the config — they stay in env vars
(junior config env lists exactly what your combination needs).
Check what you ended up with at any time:
junior config show # effective config as YAML + status headerjunior config path # which config files exist and where Junior looks3. Your first review
Section titled “3. Your first review”[!WARNING] Run Junior from the branch with your changes. By default it diffs
<target-branch>...HEAD; onmainitself the diff is empty and Junior exits with «no changes found, nothing to review».
cd /path/to/your/repogit checkout my-feature-branch[!NOTE] The commands below use the runbook you picked in
junior init— this walkthrough assumeslocal_review. There is no implicit default: with nothing configured,junior runexits 2 and asks you to choose one. Not sure what’s set?junior config show. Override any run with--runbook local_review.
Start with the free preview — dry-run shows the plan, the collected context, and the
exact system prompt + user message the harness would receive, without calling any AI:
junior dry-run --runbook local_reviewHappy with it? Run the real thing:
junior run --runbook local_review # raw structured result (JSON) → stdoutjunior run --runbook local_review --publish # pretty Markdown review in the terminalWithout --publish you get the raw JSON — stable, pipe- and redirect-safe (logs go to
stderr, so junior run > review.json captures only the result). With --publish the
runbook renders it for humans instead:
## Junior Code Review
The refactor changes a parameterized SQLite query into string interpolation...
#### 🔴 Critical
- **[security]** `app.py:4` — The changed query interpolates `user_id` directly into SQL, replacing the previous parameterized query... - Suggestion: Keep the query parameterized: `db.execute("... WHERE id = ?", (user_id,))`Exit code 1 means blocking findings (a critical issue or a request_changes
recommendation) — that’s what makes CI gates work; 0 means clean. The full table is
in the CLI reference.
Steer the review with your own instructions — inline or from files, repeatable:
junior run --prompt "Focus on security and error handling"junior run --prompt-file docs/review-rules.md4. Every run is on the record
Section titled “4. Every run is on the record”Each successful run writes a secret-free JSON trace to .junior/output/ in your project
(runbook, harness, tokens, findings, the full structured output). The directory ships its
own .gitignore, so it never shows up in your repo’s git status. Browse it any time:
junior runs # table of recent runsjunior runs last | jq .output # newest result, pipe-safeYou delegated the review — the record is how you own it. Disable with --no-record.
5. Where to next
Section titled “5. Where to next”- See what teams do with it — six ready-made scenarios, from CI gates to pipelines of juniors on local models: Use cases.
- Post to a real PR/MR — locally or as a CI gate —
junior run --runbook github_pr_review --publish(orgitlab_pr_review/bitbucket_pr_review); copy-paste pipelines in CI Setup, tokens and platform variables in the FAQ. - Build your own runbook in YAML — a manifest with a prompt, an optional schema, and two shell commands; chain several Juniors with pipes. Runbooks in YAML.
- Tune the prompts — how
--prompt/--prompt-filelayer onto the runbook’s role, plus ready-to-copy examples: Prompts. - Understand the design — why Junior is a deterministic wrapper around a non-deterministic worker: Philosophy.