🚀 ai-igniter
Stop fighting port conflicts across git worktrees. Start coding.
Lightning-fast, standalone workspace & service orchestrator for AI worktrees and parallel development.

💡 Why ai-igniter?
When using AI coding agents (Cursor Agent, Claude Code, Aider) or working across multiple Git worktrees in parallel, your local development quickly breaks:
- 💥 Port Conflicts: Multiple branches try to bind to
3000,5432, or9000simultaneously. - 🤯 Dirty
.envFiles: Manual updates of database URLs and credentials per worktree are fragile and tedious. - 🐌 Heavy Orchestration Scripts: Fragile bash or Node glue-scripts to manage Docker containers, healthchecks, and migrations.
ai-igniter solves this completely. It replaces complex scripts with a single, standalone Rust binary that orchestrates isolated services, resolves dynamic ports, runs migrations & seeds, and injects clean environment variables automatically.
🏛️ The Three Pillars
1. 🚦 Automatic Port Resolution & Isolation
- Dynamic Port Mapping: Every worktree gets its own isolated port space (deterministic base port for stable URLs/cookies + dynamic OS allocation if ports are squatted).
- Safe Port Reclaiming: Ports held by inactive
ai-ignitercontainers are automatically freed without losing your volumes. Containers from external tools are left untouched. - Git-Native Resolution: Strict git worktree resolution guarantees commands never accidentally target another project's worktree.
2. 🧱 Zero-Config "À la Carte" Services
Enable only what your project needs via ai-igniter.toml:
- PostgreSQL: Instant container with TCP health checks, optional secondary (E2E) database, automatic migration runners, and one-time initial seeders.
- Garage S3: Self-contained S3-compatible storage with automatic bucket creation, access keys, permissions, CORS, and website hosting endpoints.
- Custom Docker Services: Any Docker image (e.g. Mailpit, Redis, Meilisearch) configured with custom ports and volumes in seconds.
3. 📝 Atomic Environment Management
- Injects evaluated service URLs, credentials, and ports into a dedicated section of your target environment file (e.g.,
.envor.env.local). - Preserves all your existing custom variables outside the managed section.
- One-time seed copying (
copy_files) from your main repository checkout when creating new worktrees.
📖 Deep Dive: Want to understand the resolution hierarchy, deterministic port hashing, and anti-hijacking system? Check out the Workspace Resolution & Port Allocation Guide. For details on the dual-engine auto-updater and non-blocking background notifications, read the Update & Release Architecture Guide.
📦 Installation
Via Cargo (Recommended)
Install the latest release directly from crates.io:
Pre-built Binaries
Pre-compiled standalone binaries for macOS, Linux, and Windows are also available on each release:
-
Download the archive for your platform from the GitHub Releases page:
- macOS (Apple Silicon / M-series):
ai-igniter-aarch64-apple-darwin.tar.gz - macOS (Intel):
ai-igniter-x86_64-apple-darwin.tar.gz - Linux (Static / musl):
ai-igniter-x86_64-unknown-linux-musl.tar.gz - Linux (glibc):
ai-igniter-x86_64-unknown-linux-gnu.tar.gz - Windows:
ai-igniter-x86_64-pc-windows-msvc.zip
- macOS (Apple Silicon / M-series):
-
Extract and move the binary to your
PATH:
# macOS / Linux example
Note: For bleeding-edge/unreleased builds, you can also download binary artifacts directly from the GitHub Actions CI runs.
From Source (Development)
To build and install ai-igniter locally from source:
# Clone the repository
# Install locally with Cargo
Or build the release binary manually:
⚡ Quick Start
1. Initialize your project
Run the interactive wizard in your repository root:
This guides you through configuring services (PostgreSQL, S3), and creates an ai-igniter.toml configuration file.
2. Start developing
Spin up all workspace services, run migrations/seeds, update .env, and start your dev server in one step:
Tip: When you press
Ctrl+C,ai-ignitergracefully stops all associated Docker containers and child processes.
3. Or bootstrap without starting services
If you want to create your .env, seed files, compose file, and Docker volumes/containers ahead of time without running the services:
# or alias
4. Teardown when finished
When you delete or archive a worktree, clean up all associated containers, networks, and volumes cleanly:
⚙️ Configuration (ai-igniter.toml)
Minimal Example
Here is all you need for a full Next.js / Node app with PostgreSQL:
= "my-awesome-app"
= ".env"
= []
= "bun run dev"
[]
= true
= 1
= "app_db"
= "app_user"
= "app_password"
= "bun run db:migrate"
[]
= "{{services.postgres.url}}"
= "http://localhost:{{ports.base}}"
= "my-project"
= ".env" # Target file receiving managed env vars
= [] # Files to seed from root checkout on first use
= "bun run dev" # Command executed after services are healthy
# base_port = 3000 # Optional fixed base port
# compose_file = "docker-compose.dev.yml" # Optional: use custom compose file
# Built-in PostgreSQL
[]
= true
= 1
= "postgres:16"
= "my-project"
= "my-project"
= "my-project"
= "my-project_e2e"
= "bun run db:migrate"
= "bun run db:seed"
# seed_check_sql = "SELECT count(*) FROM users"
# Built-in Garage S3
[]
= true
= 3
= 4
= "dxflrs/garage:v2.4.1"
= "my-project-local-access-key"
= "my-project-local-secret-key-change-me"
= ["my-project-assets"]
= ["my-project-assets"]
= ".web.localhost"
# Custom Services (e.g. Mailpit)
[]
= "axllent/mailpit"
= 8
= 8025
= { = "500" }
= ["--smtp-auth-accept-any"]
= ["./.mailpit:/data", "mailpit-cache:/cache"]
# Dynamic environment template
[]
= "{{services.postgres.url}}"
= "{{services.postgres.url}}"
= "{{services.postgres.e2e_url}}"
= "{{services.garage.endpoint}}"
= "{{services.garage.access_key}}"
= "{{services.garage.secret_key}}"
= "{{services.garage.region}}"
= "my-project-assets"
= "http://my-project-assets{{services.garage.website_root_domain}}:{{services.garage.web_port}}"
= "http://localhost:{{services.mailpit.port}}"
= "http://localhost:{{ports.base}}"
Available Template Placeholders
| Placeholder | Description |
|---|---|
{{ports.base}} |
Primary workspace application port |
{{ports.<name>}} / {{ports.base + N}} |
Allocated port for a service, or base + arithmetic offset |
{{services.postgres.url}} / e2e_url |
Full PostgreSQL connection URLs with URL-encoded credentials |
{{services.postgres.port}} / host / user / password / database |
Granular PostgreSQL connection details |
{{services.garage.endpoint}} / access_key / secret_key / web_port |
Garage S3 connection & web endpoints |
{{services.<name>.port}} |
Host port for custom service declared in [services.custom.<name>] |
{{workspace.slug}} / {{workspace.hash}} / {{workspace.path}} |
Current workspace identity metadata |
🤖 Orchestrator Integrations
Paseo (paseo.json)
Conductor / Cursor Worktrees / Standalone CLI
Add ai-igniter dev to your worktree initialization hook or launch task, and ai-igniter teardown on worktree deletion.
🛠️ CLI Command Reference
| Command | Description |
|---|---|
ai-igniter init |
Interactive wizard to initialize ai-igniter.toml. |
ai-igniter bootstrap (alias: setup) |
Write .env, copy seed files, generate compose, and create Docker volumes & containers without starting. |
ai-igniter dev (alias: up) |
Start services, run migrations/seeds, write .env, and launch dev command. |
ai-igniter dev --reset |
Reset database/storage volumes to fresh state, re-seed, and start. |
ai-igniter dev --no-command |
Run and supervise background Docker services without launching dev_command. |
ai-igniter dev -- <cmd> |
Override the default dev_command (e.g. ai-igniter dev -- cargo run). |
ai-igniter teardown (alias: down) |
Stop and remove this workspace's containers, networks, and volumes. |
ai-igniter status |
Inspect allocated ports and container health for the current workspace. |
ai-igniter env |
Print or update (--write) evaluated environment variables. |
ai-igniter update (alias: upgrade) |
Check for and install updates via GitHub Releases (or --cargo). |
🏗️ Architecture & Extensibility
ai-igniter is built in Rust with modularity in mind:
src/
├── cli.rs # Clap definitions & CLI arguments
├── commands/ # init, dev, teardown, status, env, update
├── config.rs # TOML parsing, validation & defaults
├── context.rs # Workspace & port resolution engine
├── docker/ # Dynamic Compose generator & port reclaimer
├── env_writer.rs # Atomic .env delimiter engine
├── services/ # Built-in providers (PostgreSQL, Garage S3, Custom)
└── supervisor.rs # Process supervisor & signal trap (SIGINT/SIGTERM)
Adding a new built-in service
- Create
src/services/<service_name>.rsimplementing theServiceProvidertrait. - Register it in
BUILTIN_SERVICESinsrc/services/mod.rs. - All commands (
init,dev,status, etc.) will automatically support your new service!
📄 License
MIT © ScreamZ