CLI
Getting Started
Install → authenticate the model → first build → QA → ship. By the end you'll have built a real app from one prompt and either deployed it or delivered it to your GitHub.
1. Prerequisites
| Need | Why | Install |
|---|---|---|
| Node.js 18+ (20+ recommended) | Runs the CLI | nodejs.org |
| Git | Branching, PRs, and state | brew / apt install git |
| Claude Code, authenticated | TurkeyCode drives it to write code | npm i -g @anthropic-ai/claude-code |
| Claude Max/Pro or ANTHROPIC_API_KEY | Powers the model sessions | claude.ai / console.anthropic.com |
Optional, unlocked later: the GitHub CLI (gh auth login) for pushing builds and turkey deliver; and Jira env vars for story, run-ticket, and my-tickets.
Pick how the model is powered
Option A — Claude Max / Pro (recommended, no API key):
$ npm install -g @anthropic-ai/claude-code$ claude login# TurkeyCode now uses your Claude CLI session automatically.Option B — API key:
$ export ANTHROPIC_API_KEY=sk-ant-your-key-hereA note on cost
API keys bill per token and get expensive on large builds. A Claude Max subscription is flat-rate and usually far cheaper for this workload.2. Install the CLI
# Zero-install, one-off$ npx turkeycode run "your app description" # Or install globally (gives you both turkeycode and the turkey alias)$ npm install -g turkeycodeVerify:
$ turkeycode --version # -> 3.3.0$ turkey --help # turkey is an alias for turkeycode3. Your first build
The prompt is the hard part — so run converges with you first when you're at a terminal. It restates what it thinks you want, then hands you the next decision as a short list of options. You ratify by typing a number. It leans toward the smaller cut and won't bury you in questions.
$ mkdir bookmark-app && cd bookmark-app $ turkeycode run "Build a bookmark manager with tags, search, \ and a Chrome extension. Stack: Next.js, Tailwind, SQLite."What happens, in order:
| Step | What it does |
|---|---|
| 1. Scope | Short interactive loop converges on the spec (skip with --spec). |
| 2. Research | Stack, architecture, prior art → .turkey/reference/specs.md. |
| 3. Plan | 2–5 phases with deliverables → .turkey/phase-plan.json. |
| 4. Per phase | build → QA (smoke → functional → visual) → fix → retry (≤5) → review → merge. |
Skip the scope loop (go fully autonomous)
$ turkeycode run "Build a project management tool" --spec spec.mdThe loop is also auto-skipped whenever input is piped or there's no TTY — automation never blocks waiting for a number.
Scope without building
$ turkeycode scope "a habit tracker with streaks and reminders"# writes .turkey/reference/specs.md — then later:$ turkeycode resumeMake it scope like you
Drop a persona.md — your operating manual for how you scope, what you cut, your defaults — and the scope agent embodies it, generating the options you'd weigh in your voice.
$ turkeycode run "internal admin tool" --persona persona.mdLoad order (first found wins): --persona <file> → ./.turkey/persona.md → ~/.turkeycode/persona.md → a built-in scoping doctrine.
4. Run it in the background (long builds)
$ cd /path/to/project$ setsid nohup turkeycode run "your description" --verbose \ > build.log 2>&1 < /dev/null &Use setsid
Plainnohup & isn't enough — most shell/session cleanups kill the process group on disconnect. setsid fully detaches it.Monitor:
$ tail -f build.log # live log$ turkeycode status # structured status$ ps aux | grep turkeycode # confirm it's alive5. When things go sideways
| Symptom | Do this |
|---|---|
| Build seems stuck | turkeycode status, then tail build.log. QA cycles are slow. |
| QA failing on cosmetics | Re-run with --allow-warnings (only blockers must hit zero). |
| QA looping on real bugs | Inspect the latest report in .turkey/qa/. |
| "Claude not found" | npm i -g @anthropic-ai/claude-code then claude login. |
| Process died on disconnect | Use the setsid form above. |
| Want a clean slate | turkeycode reset --force nukes the .turkey/ state dir. |
A killed run leaves a record at .turkey/fatal.log, and you can almost always pick up where you left off with turkeycode resume.
6. Ship it
Web apps → host on turkeycode.ai
# Authenticate once (stores creds at ~/.turkeycode/credentials.json)$ turkey login # Deploy the current project$ turkey deploy# -> Live at https://my-app.turkeycode.aiPick a tier, subdomain, or inject env:
$ turkey deploy --tier starter$ turkey deploy --name cool-app$ turkey deploy --env .env.productionManage what you've shipped:
$ turkey apps # list deployed apps$ turkey apps status my-app # health + status$ turkey apps logs my-app # tail logs$ turkey apps delete my-app # tear downNon-web (CLI, library, desktop, mobile) → deliver to GitHub
$ turkey deliver # push to your GitHub (private by default)$ turkey deliver --public # public repo$ turkey deliver --name my-cli # custom repo nameUses your existing gh auth — no extra tokens. Go projects are cross-compiled (Linux/macOS/Windows), Rust gets a native release build, and a GitHub release is created with the binaries attached.
Try it locally first
$ turkey run-local # serves on :3000$ turkey run-local --port 80807. Iterate with tickets (optional, Jira)
With Jira configured (JIRA_HOST, JIRA_EMAIL, JIRA_TOKEN, and JIRA_PROJECT for story):
# Describe it -> TurkeyCode files its own pointed ticket, burns down the epic, runs it$ turkeycode story "users can export their dashboard to CSV" # Run a ticket that already exists$ turkeycode run-ticket PROJ-123 # Pick from tickets assigned to you$ turkeycode my-ticketsSee the Command Reference → Tickets for the full flag set and the bug-vs-story estimation flow.
Where state lives
Everything the orchestrator tracks is under .turkey/ in your project (gitignored):
.turkey/ state.json current phase, QA attempts audit.log timestamped event log fatal.log why a run died (if it did) reference/specs.md confirmed spec + research survey phase-plan.json the 2-5 phase plan phases/phase-N.done build completion gates qa/phase-N/ smoke/functional/visual reports + verdict reviews/ code review reports screenshots/ visual QA capturesturkeycode status reads this; turkeycode resume continues from it; turkeycode reset --force wipes it.