Skip to content

Development Setup

Set up a development environment for contributing to Ash.

Prerequisites

  • Python 3.12+
  • uv package manager
  • Docker
  • Git

Setup

  1. Clone the repository

    Terminal window
    git clone https://github.com/dcramer/ash.git
    cd ash
  2. Install dependencies

    Terminal window
    uv sync --all-groups

    This installs all dependencies including dev tools.

  3. Install prek hooks

    Terminal window
    # Install prek (if not already installed)
    curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.2.28/prek-installer.sh | sh
    # Install hooks
    prek install
  4. Create config file

    Terminal window
    uv run ash init

    This creates ~/.ash/config.toml. Edit it to add your API keys (Anthropic + OpenAI).

  5. Run database migrations

    Terminal window
    uv run ash upgrade
  6. Build the sandbox

    Terminal window
    uv run ash sandbox build

Development Tools

ToolPurposeCommand
ruffLinting + formattinguv run ruff check --fix .
pytestTestinguv run pytest
prekGit hooksprek run --all-files

Running Locally

Interactive chat:

Terminal window
uv run ash chat

Start server:

Terminal window
uv run ash serve

Code Quality

Run linter:

Terminal window
uv run ruff check --fix .

Format code:

Terminal window
uv run ruff format .

Both run automatically via prek hooks.

Adding Dependencies

Add runtime dependency:

Terminal window
uv add <package>

Add dev dependency:

Terminal window
uv add --dev <package>

IDE Setup

VS Code

Recommended extensions:

  • Python
  • Ruff
  • Even Better TOML

Settings:

{
"python.defaultInterpreterPath": ".venv/bin/python",
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}