Skip to content

Dev Setup

RequirementVersionInstall
Python3.11+python.org
Node.js20+nodejs.org
pnpm9+npm install -g pnpm
Gitanygit-scm.com
  1. Clone the repository

    Terminal window
    git clone https://github.com/snippbot/snippbot.git
    cd snippbot
  2. Create a Python virtual environment

    Terminal window
    python3.11 -m venv .venv
    source .venv/bin/activate # macOS/Linux
    # .venv\Scripts\activate # Windows
  3. Install Python packages in editable mode

    Terminal window
    pip install -e packages/core
    pip install -e packages/local
    pip install -e packages/cli

    Or with Make:

    Terminal window
    make install-dev
  4. Install UI dependencies

    Terminal window
    cd packages/ui && pnpm install && cd ../..
    # Or:
    make install-ui
  5. Configure your API key

    Terminal window
    snippbot config set anthropic_api_key sk-ant-your-key
  6. Start the dev servers

    Terminal window
    make dev

    This runs both the backend daemon (with auto-reload) and the UI dev server (with hot-reload).

ServiceURLDescription
UI (Vite)http://localhost:5173React frontend with hot-reload
API (daemon)http://localhost:18781Python backend
Docshttp://localhost:4321make docs-dev

The UI dev server proxies /api requests to the backend automatically.

Terminal window
make dev-local # Backend only (auto-reload)
make dev-ui # UI only (Vite hot-reload)
make docs-dev # Docs site (Starlight)
Terminal window
make install # Install all dependencies
make dev # Run all dev servers
make build # Build all packages
make test # Run all tests
make lint # Run linters (ruff, mypy, ESLint)
make lint-fix # Auto-fix linting issues
make format # Format code
make clean # Remove build artifacts
make docs-dev # Start docs dev server
make docs-build # Build static docs site
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 agent

To work on this documentation site:

Terminal window
make docs-dev # Start at http://localhost:4321
make docs-build # Build static output
make docs-preview # Preview built output

Add content by creating .mdx files in packages/docs/src/content/docs/. The file path becomes the URL slug.