Sakura Architecture Documentation
Overview
Sakura is a deterministic AI CLI with plan/apply safety gates and AWS passthrough. It is structured as a monorepo with three packages: the CLI (/), a serverless API (/api), and a Next.js marketing/dashboard frontend (/web).
Sources: package.json, CLAUDE.md, README.md
System Architecture
Sources: src/sakura.ts, src/cli.ts, src/repl/index.ts, api/template.yaml
Request / Data Flow
Interactive REPL — General Intent
Sources: src/repl/index.ts, src/repl/tool-loop.ts, src/tools/executor.ts, src/prompts-client.ts
AWS Mutating Command — Plan/Apply Gate
Sources: src/repl/aws-handler.ts, src/planning/planner.ts, src/aws/guard.ts, src/aws/runner.ts, src/planning/store.ts
API Provider — Streaming SSE Flow
Sources: src/providers/api.ts, api/src/routes/llm.ts, api/src/services/model-router.ts