Docs / Reference6 min readEdit on GitHub

Commands and scripts#

Every command-line entry point in the repository: the root Makefile, the npm scripts of the web and mobile clients, the backend's standalone scripts, the developer tools under server/tests/tools/, and the eval CLI. Each entry says what it touches, because several of them reach production or spend real money when run from a configured checkout.

Terms used on this page#

  • Test stack: Postgres on 5433 and Redis on 6380 from docker-compose.test.yml, offset from the development ports so a running dev stack is never touched.
  • Eval stack: Postgres on 5434 and Redis on 6381 from docker-compose.eval.yml, with persistent volumes.
  • Configured checkout: one with a server/.env. On the maintainer's machine that file points at the production database and holds real keys.

Danger summary#

CommandTouches
make migrate, uv run alembic upgrade headthe database in server/.env: production in a configured checkout
make downgradethe same, one revision back
make db-truncate, python -m app.scripts.cleanempties every table of the server/.env database
make test-e2e-prodthe deployed site: writes and deletes one chat turn
make probe-ai, tests.tools.agent_smoke, tests.tools.decidereal provider calls on real keys
python -m evals run generate, run judge, gold checkreal spend, capped by --budget

make migrate-test, make test-*, and every eval command touch only the test or eval stack.

Makefile#

Run make or make help for the list. Postgres (with pgvector) and Redis are yours to supply; there is no development compose file.

Bootstrap and infrastructure#

TargetRuns
installuv sync in server/, npm install in client/
envcopies server/.env.example and client/.env.example to .env, never overwriting one
setupinstall, env, migrate
dev-infrastarts illume-postgres (pgvector/pgvector:pg16, 5432) and illume-redis (redis:7, 6379), reusing existing containers
dev-infra-downstops them; the data stays in the containers
test-infra, test-infra-downthe test stack
eval-infra, eval-infra-downthe eval stack

make env still prints that DOMAIN is missing from server/.env.example; the example now includes it, so the message is out of date.

Database#

TargetRuns
migratealembic upgrade head against SYNC_DATABASE_URL from server/.env
migrate-testthe same against postgresql://illume:test@localhost:5433/illume_test
migration m="…"alembic revision --autogenerate -m "…"
downgradealembic downgrade -1
db-truncatepython -m app.scripts.clean: truncates every table in foreign-key order
seed-e2escripts/seed_e2e.py against a running API
eval-migratepython -m evals db migrate

Dev servers#

Each runs in the foreground; use one shell per process.

TargetRuns
apiuv run fastapi dev, port 8000, reloading
workercelery -A app.core.celery worker -Q celery,sync with --pool=solo on Windows, --pool=prefork --concurrency=1 elsewhere
beatcelery -A app.core.celery beat
webnpm run dev, port 3000
stubscripts/openai_stub_server.py, port 8099

Celery's default prefork pool does not work on Windows. On Linux, --concurrency=1 matters: the default takes the container's reported CPU count, and two concurrent ingests can exhaust the box's memory. See deployment.

Tests, lint and build#

TargetRuns
testtest-be and test-fe
test-bepytest -m "not slow"
test-be-allpytest, including slow tests
test-be-one f=…one path or test id
test-fe, test-fe-uivitest run, or the watch UI
test-e2ePlaywright with e2e/playwright.config.ts; starts the API, the stub and a Next production build itself, needs only test-infra
test-e2e-prodPlaywright with e2e-prod/playwright.config.ts against the deployed site, reading client/.env.smoke
test-e2e-reportopens the last Playwright report
cov, cov-be, cov-fecoverage; the backend runs with -n auto
eval-selftestpython -m evals selftest, no database
eval-ciAI_API_KEY= OPENROUTER_API_KEY= pytest tests/evals
lintlint-be and lint-fe, the scope CI blocks on
lint-beruff check, ruff format --check and mypy over server/tests/
lint-be-appruff and mypy over server/app/, report only
lint-fenext typegen, tsc --noEmit, eslint over tests/, e2e/, e2e-prod/ and vitest.config.ts
fmt, fmt-be, fmt-feautofix the blocking trees
fmt-be-appruff over server/app/; a large diff
build-fenpm run build
docker-builddocker build -t illume-server:local server/
probe-aiscripts/probe_ai_provider.py
cleanremoves build and test artefacts and caches; never touches a database

next typegen comes first because next-env.d.ts is gitignored; without it tsc cannot resolve asset imports.

Web client scripts#

From client/package.json:

ScriptCommand
devnext dev
build, startnext build, next start
linteslint (over src/ by default)
typechecktsc --noEmit (run npx next typegen first on a fresh checkout)
test, test:run, test:ui, test:coverageVitest
test:e2ePlaywright, local stack
test:e2e:prodPlaywright, deployed site
test:e2e:reportthe HTML report

Mobile app scripts#

From mobile/package.json:

ScriptCommand
startexpo start --dev-client (a development build, not Expo Go)
android, iosexpo run:android, expo run:ios
test, test:watchJest
typechecktsc --noEmit

See the mobile app.

Backend services#

Run from server/:

uv sync
uv run fastapi dev
uv run celery -A app.core.celery worker --loglevel=info --pool=solo -Q celery,sync
uv run celery -A app.core.celery beat
uv run alembic revision --autogenerate -m "describe the change"

The worker must consume both queues: celery for initial ingests and sync for background updates. Beat is a separate process; production passes -s /var/illume/celerybeat-schedule so its last-run times survive a redeploy.

Standalone scripts#

ScriptPurpose
app/scripts/clean.pytruncates every table in foreign-key order; run as python -m app.scripts.clean
scripts/seed_e2e.pyregisters the E2E user through the real endpoint, then inserts two fully ingested repositories with the test factories; safe to re-run
scripts/openai_stub_server.pyan OpenAI-compatible stub on 8099; the E2E API points OPENAI_BASE_URL and AI_BASE_URL at it. Imports no app configuration
scripts/probe_ai_provider.pysends each generation call shape, byte for byte, to a real provider, so a wire-format mismatch shows up here rather than as empty artefacts. Flags --provider, --model, --base-url; imports no app configuration
scripts/mcp_dev.pymigrates and seeds the test stack, then serves the API on 8010 for trying the MCP endpoint by hand; --cleanup deletes the seeded user. Sets every Settings field so nothing falls through to server/.env

Developer tools#

Run from server/ as modules. All use the 30-file retrieval fixture repository.

ToolSpends creditPurpose
tests.tools.call_toolnocalls any agent tool by name with JSON arguments and prints what the model would see; --list, --json, --schema
tests.tools.retrieval_tracedepends on presetshows which retrieval channels found which files for a question; --preset, --with-grep, --list
tests.tools.agent_smokeyesruns the agent on three fixture questions; key from AGENT_SMOKE_API_KEY only
tests.tools.decideyesruns the decision points once each against Jev, or --decider llm
uv run python -m tests.tools.call_tool grep_code '{"pattern": "bcrypt"}'
uv run python -m tests.tools.retrieval_trace "What relies on RateLimiter?"

The eval CLI#

uv run python -m evals <command> from server/. Importing it pins every setting to the eval stack, so it cannot touch the development or production database. The full guide is on the eval harness.

CommandActions or key flags
dbmigrate, status
corpusingest, snapshot, restore, report; --repo, --corpus, --name
mineclone a corpus repository and cache its PRs; --repo, --refresh
goldbuild, phrase, check, verify, split; --include-anchor, --include-rationale, --include-structural, --include-unanswerable, --tuning-test-split, --annotator, --checker-model
rungenerate, judge, judge-label, judge-agreement; --slice, --arms, --run, --subset ARM=N, --repeats, --off-peak-only, --judge-model, --sample-only, --labelled-only, --compare-judge-model, --wait
report--run (required), --mode simple|full|pilot, --out, --judge-slug
selftestthe metric self-tests
budgetspend so far; --project with --items, --arms, --repeats to estimate a planned run

gold, run and budget take --budget and --stop in US dollars, defaulting to STARTER_BUDGET_USD = 10.0 and STARTER_STOP_USD = 9.50 in evals/settings.py. The budget is cumulative across a run's resumptions.

Design trade-offs and limits#

  • One Makefile, two platforms. Recipes use bash (SHELL := /bin/bash); on Windows they need Git Bash or WSL.
  • Production one typo away. migrate, downgrade and db-truncate follow server/.env. The test-stack variants exist precisely because of this.
  • No dev compose file. dev-infra uses bare docker run containers without volumes, so docker rm loses the data.