This guide is for contributors building O3 Code from source. If you just want to use O3 Code, download the macOS app instead.
| Tool | Install |
|---|---|
| Bun (v1.0+) | curl -fsSL https://bun.sh/install | bash |
| Docker | Docker Desktop or OrbStack |
jq |
brew install jq |
| Caddy | brew install caddy && caddy trust |
Git 2.20+ and gh |
brew install gh |
macOS is the primary supported platform. Windows / Linux are untested.
git clone https://github.com/o3dotdev/o3-code.git
cd o3-code
./.o3/code/setup.local.sh
bun run devThat's it. You do not need a Neon account, Stripe keys, or any other third-party credentials — .env.local.example ships fake placeholders that pass env validation, and setup.local.sh runs everything against a local Docker stack.
- Copies
.env.local.example→.env - Allocates a per-workspace port range so multiple worktrees don't collide
- Brings up Postgres + neon-proxy + Electric via
docker compose(project-scoped to this worktree) - Runs
bun installandbun run db:migrate - Seeds a
Local Admindev account viabun run db:seed-dev - Writes a gitignored
.o3/code/config.local.jsonoverlay so subsequent worktrees automatically use this setup
Re-run the script any time to refresh the workspace. To tear the local DB stack down:
./.o3/code/teardown.local.shAfter bun run dev, open the web app and click the "Sign in as dev" button on the sign-in page (also available in the desktop sign-in screen). Or use the credentials directly:
- Email:
admin@local.test - Password:
o3codedev
The dev sign-in button and email/password auth are gated on NODE_ENV=development — they don't ship in production.
If you need to point at real Neon / third-party services instead of the local Docker stack:
cp .env.example .env # fill in real Neon, Stripe, etc. credentials
cp Caddyfile.example Caddyfile # HTTPS reverse proxy for Electric streams
bun install
bun run devbun run build
open apps/desktop/releasebun dev # Start all dev servers
bun test # Run tests
bun run lint:fix # Fix lint + format
bun run typecheck # Type-check all packages
bun run build # Build all packagesSee AGENTS.md for repo structure, monorepo conventions, and database/migration workflow.
caddy trustprompts for sudo — expected, once per machine. Without it Chromium rejectshttps://localhost:*withERR_CERT_AUTHORITY_INVALID.- Port collision —
setup.local.shallocates a fresh port window per worktree. If you ran the script before this change landed, re-run it to migrate. - DB connection errors after pulling main — re-run
./.o3/code/setup.local.sh; it's idempotent and will apply any new migrations. - Stuck Docker stack —
./.o3/code/teardown.local.shthen re-run setup.
See CONTRIBUTING.md for the PR process and code-of-conduct expectations.