Setup, run, and troubleshoot the site locally using the repository's supported toolchain.
- Node.js 20.x (
nvm use). - Bun 1.3+ (
bun --version). - Optional: Playwright browser dependencies for end-to-end tests.
nvm use.bun install.- Copy
.env.exampleto.env.localif needed for local overrides.
For an automated setup pass, run bun run setup:codex.
- It installs dependencies with
bun install --frozen-lockfile. - It runs
bun run checkby default. - It can install Playwright browsers (
--install-playwright) when needed.
- Start development server:
bun dev. - Build production bundle:
bun run build. - Preview production build:
bun run preview. - Preview Cloudflare Worker build:
bun run preview:cf.
bun run check.
bun run check runs:
bun run agent:doctor.bun run lintandbun run typecheck(viaconcurrently).bun run astro:check.bun run validate:json.bun run validate:glossary.bun run test:unit:ci.
bun run lint.bun run lint:fix.bun run typecheck.bun run test:unit.bun run format.bun run format:check.bun run test:e2e(requires Playwright browsers).
Install browsers once before running E2E tests:
bunx playwright install --with-deps.
If tests fail in CI-specific environments, see docs/cloudflare-playwright.md.
- Toolchain drift:
- Verify versions with
node -vandbun -v. - Reinstall dependencies:
rm -rf node_modules bun.lock && bun install.
- Verify versions with
- Astro cache issues:
- Remove
.astro/and rerun the failing command.
- Remove
- Worker preview issues:
- Ensure
bun run buildproduceddist/server/entry.mjsanddist/server/wrangler.jsonbeforebun run preview:cf. - If preview serves
[object Object], rerunbun run buildand confirm the output includesPatched Cloudflare worker streaming mode.
- Ensure