A terminal coding agent with a Claude Code–style interface, built provider-agnostic: one agent engine drives OpenAI, Google Gemini, and xAI (Grok) — with runtime model switching, smart routing, a secure first-run key setup, and an optional hosted server mode.
Status: working scaffold. Architecture, types, agent loop, providers, tools, secure key store, Ink TUI, and an HTTP+SSE server are wired end-to-end and typecheck clean. A live end-to-end provider call (the "smoke test") is the next verification step.
- Architecture — layers, the canonical model, and the agent loop
- Agent graphs — LangGraph-shaped state machines on the polycode loop (no LangChain)
- Getting Started — prerequisites, install, first run, smoke test
- Configuration — config file, tiers, env precedence
- Providers & Models — OpenAI/Gemini/xAI, current model IDs, adding a provider
- Security & Keys — secure key store, permission modes, sandboxing
- CLI Reference — flags and slash commands
- Packages — per-package reference
- Build & Deploy — bundle, publish, Docker server image
- Continuity / Handoff — current state, decisions, gotchas, next steps
polycode is a pnpm monorepo (TypeScript). The agent loop, tools, permission engine,
and UI only ever see canonical types — every provider quirk (message shapes, tool-call
formats, stop reasons, reasoning channels) is normalized inside a thin adapter over the
Vercel AI SDK. That seam is what makes "multiple API models" tractable. Keys are captured
on first run via a masked prompt and stored in the OS keychain. The same engine runs
locally in an Ink TUI or behind an HTTP+SSE server.
Repo: gasantiago16/polycode (public, experimental alpha).