Skip to content

Getting started

Install, set an API key, type a prompt.

Requirements

  • Python 3.12+
  • An OpenAI-compatible endpoint with an API key. The free options:

uv tool install letscode
pipx install letscode
git clone https://github.com/abilian/letscode.git
cd letscode
uv sync
uv run letscode --version

First run

letscode --version          # confirm the install
letscode --init             # scaffold a commented ~/.letscode/config.toml (optional)

--version and --init work with no API key configured. If you start letscode without a key it tells you exactly what to set, rather than failing obscurely.

Interactive mode

export OPENAI_API_KEY="sk-..."
letscode

You should see a welcome banner and a prompt:

letscode · gpt-4o-mini · /help · /quit  ·  Ctrl+G or /edit to compose · Ctrl+J for newline
(while it's working: Enter to stop · type then Enter to stop & redirect)
>

Type a request — summarise this directory, or read README.md, or anything else — and the agent does the work. While it's working you can type: Enter stops it; type then Enter stops and redirects it to the new instruction.

One-shot mode

letscode "what does fib.py do?"

Single prompt, response printed, exits.

Options can go anywhere

letscode --model llama3.2 "your prompt" and letscode "your prompt" --model llama3.2 both work — options are parsed regardless of position.

For piping into scripts:

echo "summarise this code" | letscode -p < src/letscode/agent/loop.py

-p skips Rich rendering and writes the final assistant text to stdout. Exit codes: 0 ok, 1 error, 130 Ctrl+C.

Switching providers

The hosted OpenAI endpoint isn't the only option. Two env vars and a --model flag pick any other provider:

export OPENAI_BASE_URL="http://localhost:11434/v1"
export OPENAI_API_KEY="ollama"  # any non-empty string
letscode --model llama3.2 "your prompt"
export OPENAI_BASE_URL="https://api.fireworks.ai/inference/v1"
export OPENAI_API_KEY="$FIREWORKS_API_KEY"
letscode --model accounts/fireworks/models/minimax-m2p5 "your prompt"
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="$OPENROUTER_API_KEY"
letscode --model anthropic/claude-sonnet-4-5 "your prompt"

What's in the box

Type /help to see every command. The defaults:

  • Four tools the LLM can invoke: read, write, edit, bash.
  • Skills loaded from ~/.letscode/skills/, ~/.claude/skills/, ~/.agents/skills/, ~/.pi/agent/skills/ plus project-local variants. Anything written in the agentskills.io format loads unchanged.
  • Slash commands: /help, /quit, /reset, /model, /tools, /skills, /skill:<name>, /steer, /follow-up, /queue, /compact, /verbose, /footer, /plugins, /reload, and the tree-session commands /tree, /fork, /clone. Plugins add their own — e.g. letscode-memory contributes /remember, /memories, /forget. See the full reference.
  • Sessions persisted as JSONL under ~/.letscode/sessions/<cwd-hash>/<uuid>.jsonl. -c continues the most recent session for the current directory.

Next steps