Local Development
This guide covers how to run Omni projects locally using our polyrepo-based development workflow.
Prerequisites
Metarepo Pattern
Omni projects use a metarepo (or polyrepo) pattern rather than a monorepo approach:
- Services are separate git repositories
- A metarepo orchestrates development without containing service code
- Services are cloned into a
services/directory (git-ignored) - Each service, being its own individual repo, maintains its own dependencies and deployment lifecycle
Exmaples:
Structure
project/
├── Tiltfile # main orchestration
├── services.yaml # service definitions
├── services/ # cloned repos (git-ignored at the root)
│ ├── api/
│ └── app/
└── .gitignoreGetting Started
-
Clone the metarepo:
git clone $METAREPO_URL cd $PROJECT -
Copy the services template:
cp services.yaml.template services.yaml -
Start Tilt:
tilt upTilt will automatically clone any missing services defined in
services.yaml. -
Open the Tilt UI at http://localhost:10350 to monitor all services.
Configuration
services.yaml
Define which services to include:
services:
- project-api:
repo: https://github.com/org/project-api#master
- project-app:
repo: https://github.com/org/project-app#master
# optional: custom path
path: ../project-appFields:
repo(required): Git URL with branch referencepath(optional): Custom local path (defaults toservices/$SERVICE)env(optional): Environment variables to set
Environment Variables
Check the individual service's README.md for environment variable requirements.
Commonly, services load environment variables from .env.local. Copy the template:
cd services/api
cp .env.local.template .env.localCommon Commands
| Command | Description |
|---|---|
tilt up | Start all services |
tilt down | Stop all services |
See more in the Tilt documentation.
Troubleshooting
Service not starting
- Important prerequisite: check the service's
README.mdfor setup instructions - Check Tilt UI for error logs
- Verify
.env.localexists with required variables - Run
bun iin the service directory
Port conflicts
- Another process may be using the port: check with
lsof -i :$PORT.
Bonus: Custom Tilt Extensions
Omni maintains a collection of Tilt extensions at Omni tilt-extensions (GitHub).