Dev Setup
Prerequisites
Section titled “Prerequisites”| Requirement | Version | Install |
|---|---|---|
| Python | 3.11+ | python.org |
| Node.js | 20+ | nodejs.org |
| pnpm | 9+ | npm install -g pnpm |
| Git | any | git-scm.com |
Clone and install
Section titled “Clone and install”-
Clone the repository
Terminal window git clone https://github.com/snippbot/snippbot.gitcd snippbot -
Create a Python virtual environment
Terminal window python3.11 -m venv .venvsource .venv/bin/activate # macOS/Linux# .venv\Scripts\activate # Windows -
Install Python packages in editable mode
Terminal window pip install -e packages/corepip install -e packages/localpip install -e packages/cliOr with Make:
Terminal window make install-dev -
Install UI dependencies
Terminal window cd packages/ui && pnpm install && cd ../..# Or:make install-ui -
Configure your API key
Terminal window snippbot config set anthropic_api_key sk-ant-your-key -
Start the dev servers
Terminal window make devThis runs both the backend daemon (with auto-reload) and the UI dev server (with hot-reload).
Dev server URLs
Section titled “Dev server URLs”| Service | URL | Description |
|---|---|---|
| UI (Vite) | http://localhost:5173 | React frontend with hot-reload |
| API (daemon) | http://localhost:18781 | Python backend |
| Docs | http://localhost:4321 | make docs-dev |
The UI dev server proxies /api requests to the backend automatically.
Individual commands
Section titled “Individual commands”make dev-local # Backend only (auto-reload)make dev-ui # UI only (Vite hot-reload)make docs-dev # Docs site (Starlight)Makefile targets
Section titled “Makefile targets”make install # Install all dependenciesmake dev # Run all dev serversmake build # Build all packagesmake test # Run all testsmake lint # Run linters (ruff, mypy, ESLint)make lint-fix # Auto-fix linting issuesmake format # Format codemake clean # Remove build artifactsmake docs-dev # Start docs dev servermake docs-build # Build static docs sitePackage structure
Section titled “Package structure”packages/├── core/ → snippbot_core Shared business logic├── local/ → snippbot Self-hosted daemon + API server├── cli/ → snippbot_cli CLI commands├── ui/ → (React) Web frontend (bundled into local)├── docs/ → (Astro Starlight) This documentation site└── device/ → snippbot_device Remote device agentDocs development
Section titled “Docs development”To work on this documentation site:
make docs-dev # Start at http://localhost:4321make docs-build # Build static outputmake docs-preview # Preview built outputAdd content by creating .mdx files in packages/docs/src/content/docs/. The file path becomes the URL slug.