Code Artisan
⚡ A web coding agent project — similar in spirit to bolt.new and v0.dev — built as a hands-on way to learn modern AI agent development.
Ask AI about Code Artisan
Powered by Claude · Grounded in docs
I know everything about Code Artisan. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
CodeArtisan
A web coding agent project — similar in spirit to bolt.new and v0.dev — built as a hands-on way to learn modern AI agent development.
🎬 Demo
https://github.com/user-attachments/assets/449acf6a-e12d-4dd5-a826-5ae6d825d68a
✨ Features
-
Hand-rolled Agent SDK. No Vercel AI SDK or LangChain — a first-principles ReAct loop with multi-provider support, middleware, tools, and a sandbox abstraction, all fully pluggable.
-
MCP support. Built-in MCP marketplace — install with one click and the agent automatically picks up the new tools on the next turn.
-
Built-in Skills system. Ships with skills like full-stack app scaffolding; the agent reads them on demand to accelerate common tasks.
-
Sandboxed isolation. Every conversation runs in its own E2B sandbox; file snapshots restore the workspace on cold start. When using the Agent SDK standalone, swap to
LocalSandboxto run on your own machine. -
Full-featured workspace. Live preview, Monaco editor, PTY-backed xterm terminals (agent and user share one session manager), file tree + full-text search, all over a single conversation-scoped WebSocket.
🏛️ Architecture
Monorepo
| Package | What it does |
|---|---|
@code-artisan/agent | Environment-agnostic Agent SDK — ReAct loop, providers, tools, middlewares, sandbox interface |
@code-artisan/backend | Hono + Bun server — turn orchestration, persistence, auth, sandbox lifecycle, PTY sessions |
@code-artisan/frontend | Vite + React 19 SPA — workspace UI, Monaco, xterm, live preview |
@code-artisan/cli | Terminal UI for the agent SDK (Ink-based). Scaffolded — future home for a standalone CLI |
@code-artisan/shared | Shared types: message blocks, model catalog, conversation shapes |
🛠️ Tech Stack
Frontend — Vite 6 · React 19 · TypeScript 5.9 · Tailwind v4 · shadcn/ui · TanStack Router · TanStack Query · Zustand · Monaco · xterm.js · react-resizable-panels
Backend — Bun · Hono 4 · Drizzle ORM · Postgres · better-auth (GitHub OAuth) · anthropic-ai/sdk · modelcontextprotocol/sdk
Sandbox — E2B Code Interpreter (PTY API)
Infrastructure — Supabase (Postgres + Object Storage) · Railway / Docker (deploy)
Models — Any Anthropic or OpenAI-compatible gateway (switch via LLM_BASE_URL)
🚀 Quick Start
Prerequisites
- Node.js ≥ 20
- pnpm ≥ 9
- Bun ≥ 1.x
- An E2B API key
- A Supabase project (Postgres + Storage bucket named
attachments) - An LLM API key — Anthropic, or any OpenAI-compatible gateway
- A GitHub OAuth App
Setup
git clone https://github.com/lhz960904/code-artisan.git
cd code-artisan
pnpm install
# Configure environment
cp .env.example .env
# Fill in DATABASE_URL, SUPABASE_*, LLM_API_KEY, E2B_API_KEY, GitHub OAuth, ...
# Push schema to your database
pnpm --filter @code-artisan/backend run db:push
# (First time only) Build the E2B sandbox template
pnpm sandbox:build
# Start frontend (:3000) + backend (:3001) in parallel
pnpm dev
Open http://localhost:3000.
Build for production
pnpm build
pnpm --filter @code-artisan/backend run start
A Dockerfile is included for containerized deploys (Railway-ready).
🗺️ Roadmap
See TODO.md.
- Plan mode
- Versioning
- One-click deploy
- Built-in database
- Shareable links
- Element picker — click in preview to fill the prompt
- i18n framework
🤝 Issues & PRs
Issues and PRs are welcome — feel free to open one any time. For Chinese-speaking folks who'd rather chat directly, add me on WeChat:
📄 License
MIT © lhz960904
