Skip to main content
A reference for working in the codebase: layout, commands, tests, builds, migrations, and operational checks. Artifacts is a Bun and Turborepo monorepo with web, API, CLI, and shared domain packages.

Repository Layout

Common Commands

Type Checking

Run the whole repo:
Run one workspace:

Tests

Run all tests:
Run package tests directly:
Optional browser smoke tests live in apps/web/e2e. Start dev servers first, install Playwright browsers once, then run:

Database Workflow

Schema lives in packages/db. Migration files live in packages/db/drizzle. After changing schema:

CLI Development

Build:
Run without installing:
Run from TypeScript source:
The CLI command registry lives in apps/cli/src/commands.

API Development

The API is a Hono service. Route registration starts in apps/api/src/routes/index.ts. Important route modules:
  • artifacts.ts
  • projects.ts
  • profile.ts
  • workspaces.ts
  • workspace-invitations.ts
  • api-keys.ts
  • billing.ts
  • share-links.ts
Domain services are built in apps/api/src/deps.ts and mostly live under packages/.

MCP Development

MCP tool definitions live in packages/mcp/src/index.ts. Each tool has:
  • description
  • Zod schema
  • handler
The exported listMcpTools() function converts the registry to JSON Schema for discovery.

Operational Checks

Health endpoint:
Recommended monitors:

Logging

The API logs request ID, method, path, status, duration, user or principal attribution, user agent, and optional trusted proxy IP. Audit events are mirrored to logs without metadata. The web app reports Web Vitals and client/runtime failures when Better Stack browser tokens are configured.