Get shelby running in ten minutes
Shelby is a small coding agent you can read end to end. Install it, point it at the demo app, then open it up and see how an agent really works.
Setup
- Check you have Node 18 or newer
node -vPrints v18 or higher? Carry on. Otherwise install Node from nodejs.org first.
- Install shelby
npm install -g shelby-agentPermissions error on Mac or Linux? Skip the install and use
npx shelby-agenteverywhere you seeshelbybelow. - Clone the demo app and go inside it
git clone <DEMO-APP-URL> cd <DEMO-APP-FOLDER> && npm installShelby works on the folder you run it in, so always start it from inside the app.
- Add your API key
shelbyThe first run creates a
.envfile and stops. Open it, paste your key afterOPENROUTER_API_KEY=, save, and runshelbyagain. Never commit.env. - Check it works
shelby --doctorEvery line should show a tick, including tool-calling: emitted tool_calls.
- Start it and say hello
shelbyAnswer
yto trust the folder. Shelby asks before every edit or command. Type/tracefirst to watch each step as it happens.
shelby --demo. It swaps the model for a scripted one so the real loop, /trace and /tools all work offline.See inside the agent
- /trace
- Live view of every request, tool call and result
- /prompt
- The exact system prompt the model gets
- /messages
- The raw message list, resent every step
- /tools
- Everything the model can call
- /context
- How big the conversation has grown
- /log
- Where this session is recorded
- /doctor <model>
- Does this model emit tool calls?
- --src
- Prints the folder with shelby's readable source
Pick a task
Full list of 22: open the task board.
- Use it: ask for a new page, then run
/reviewon the result. - Break it: run
/doctor tencent/hy3:free, switch to it with/model, and watch it describe actions instead of doing them. - Build a tool: copy
word_count.mjsinto.shelby/tools/, restart, then make it refuse files outside the repo. - Read the code: run
shelby --srcand start atagent.ts.
If something goes wrong
| You see | Try |
|---|---|
| command not found: shelby | Use npx shelby-agent, or reopen the terminal after installing. |
| Missing OPENROUTER_API_KEY | Key is empty or .env is in the wrong folder. It must sit in the app folder you run shelby from. |
| 401 or "User not found" | Stray space or quote in the key, or an expired key. Re-paste it and run --doctor. |
| It talks about editing files but nothing changes | The model can't call tools. Run /doctor and switch to openai/gpt-4o-mini. |
| Anything else | Run shelby --doctor, then put your hand up. |