56dde9cf915cad5ee7ea20fc292ee26fbf351f34
Spiceflow
AI Session Orchestration PWA for monitoring and interacting with Claude Code and OpenCode sessions.
"The spice must flow."
Architecture
┌─────────────────┐ ┌─────────────────────────┐ ┌─────────────────┐
│ Claude Code │◀───▶│ Spiceflow Server │◀───▶│ PWA Client │
│ (CLI) │ │ (Clojure) │ │ (Svelte) │
└─────────────────┘ │ │ └─────────────────┘
│ ┌─────────────────┐ │
┌─────────────────┐ │ │ SQLite + DB │ │
│ OpenCode │◀───▶│ │ Abstraction │ │
│ (CLI) │ │ │ WebSocket/SSE │ │
└─────────────────┘ │ └─────────────────┘ │
└─────────────────────────┘
Quick Start
Prerequisites
- Clojure CLI (deps.edn)
- Node.js 18+ and pnpm
- SQLite
Server
cd server
clj -M:run
The server will start on http://localhost:3000.
Client
cd client
pnpm install
pnpm dev
The client dev server will start on http://localhost:5173 with proxy to the API.
Production Build
# Build client
cd client
pnpm build
# Run server (serves static files from client/build)
cd ../server
clj -M:run
API Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/health |
Health check |
| GET | /api/sessions |
List all tracked sessions |
| POST | /api/sessions |
Create/import a session |
| GET | /api/sessions/:id |
Get session with messages |
| DELETE | /api/sessions/:id |
Delete a session |
| POST | /api/sessions/:id/send |
Send message to session |
| GET | /api/discover/claude |
Discover Claude Code sessions |
| GET | /api/discover/opencode |
Discover OpenCode sessions |
| POST | /api/import |
Import a discovered session |
| WS | /api/ws |
WebSocket for real-time updates |
Development
Running Tests
# Server tests
cd server
clj -M:test
# Client type checking
cd client
pnpm check
Project Structure
spiceflow/
├── server/ # Clojure backend
│ ├── deps.edn
│ ├── src/spiceflow/
│ │ ├── core.clj # Entry point
│ │ ├── config.clj # Configuration
│ │ ├── db/
│ │ │ ├── protocol.clj # DataStore protocol
│ │ │ ├── sqlite.clj # SQLite implementation
│ │ │ └── memory.clj # In-memory impl for tests
│ │ ├── adapters/
│ │ │ ├── protocol.clj # AgentAdapter protocol
│ │ │ ├── claude.clj # Claude Code adapter
│ │ │ └── opencode.clj # OpenCode adapter
│ │ ├── api/
│ │ │ ├── routes.clj # REST endpoints
│ │ │ └── websocket.clj # WebSocket handlers
│ │ └── session/
│ │ └── manager.clj # Session lifecycle
│ └── test/spiceflow/
│
├── client/ # SvelteKit PWA
│ ├── src/
│ │ ├── routes/ # SvelteKit routes
│ │ └── lib/
│ │ ├── api.ts # API client
│ │ ├── stores/ # Svelte stores
│ │ └── components/ # UI components
│ └── static/ # PWA assets
│
└── README.md
Configuration
Server
Configuration via resources/config.edn or environment variables:
| Variable | Default | Description |
|---|---|---|
SPICEFLOW_PORT |
3000 | Server port |
SPICEFLOW_HOST |
0.0.0.0 | Server host |
SPICEFLOW_DB |
spiceflow.db | SQLite database path |
CLAUDE_SESSIONS_DIR |
~/.claude/projects | Claude sessions directory |
OPENCODE_CMD |
opencode | OpenCode command |
PWA Icons
Generate PWA icons from the SVG favicon:
cd client/static
# Use a tool like svg2png or imagemagick to generate:
# - pwa-192x192.png
# - pwa-512x512.png
# - apple-touch-icon.png (180x180)
License
MIT
Description
Languages
Clojure
36.7%
TypeScript
31.4%
Svelte
28.5%
Shell
2.3%
CSS
0.6%
Other
0.5%