Local Development & Pitchfork
Relevant source files
The following files were used as context for generating this wiki page:
Local development in the Speakeasy project relies on a coordinated stack of services managed by Pitchfork and orchestrated by Mise. The environment provides a full-stack experience including the Go backend, React dashboard, Temporal workers, and a local identity provider (dev-idp), all running within a containerized infrastructure.
The setup process uses the ./zero script to automate dependency installation, database migrations, and service initialization. Developers can run multiple independent stacks side-by-side using git worktrees, with Pitchfork managing the lifecycle of each stack's daemons.
Sources: CONTRIBUTING.md:3-10, GEMINI.md:10-15, AGENTS.md:10-15
Pitchfork Process Manager
Pitchfork is the local process manager that runs all application services in a single terminal with a tabbed UI. It handles the execution of the server, worker, dashboard, and identity provider.
Service Management
You interact with Pitchfork using the CLI to control specific daemons or the entire stack.
| Command | Action |
|---|---|
pitchfork list | Lists all managed daemons |
pitchfork status | Shows the current state of services |
pitchfork logs <daemon> | Streams logs for a specific service |
pitchfork start <daemon> | Starts a specific service |
pitchfork stop <daemon> | Stops a specific service |
pitchfork restart <daemon> | Restarts a specific service |
Sources: GEMINI.md:45-50, AGENTS.md:45-50, CLAUDE.md:45-50
Pitchfork Architecture
The following diagram illustrates how Pitchfork orchestrates the various components of the local development environment.
Pitchfork manages the application-level daemons while Docker provides the underlying data stores and workflow engines.
Sources: CONTRIBUTING.md:100-110, GEMINI.md:45-55, CLAUDE.md:45-55
Local Identity Provider (dev-idp)
The dev-idp is a lightweight Go server that replaces external identity services (like WorkOS) during local development. It runs as a Pitchfork daemon and uses a local SQLite database.
Authentication Backends
The behavior of dev-idp is controlled by the GRAM_DEVIDP_BACKEND environment variable:
- local (default): Uses your git committer email for non-interactive login. It emulates WorkOS API calls for roles and permissions.
- workos: Proxies REST calls to the real WorkOS API while maintaining non-interactive login by mapping your git email to a real WorkOS user.
Sources: CONTRIBUTING.md:100-135
dev-idp Protocol Handlers
The dev-idp service mounts two distinct surfaces on a single port.
| Prefix | Purpose | Details |
|---|---|---|
/oauth2-1 | Login & MCP Auth | OAuth 2.1 authorization server supporting PKCE. |
/workos | Management | Emulated or proxied WorkOS REST surface for orgs and roles. |
Sources: CONTRIBUTING.md:155-165
Development Workflow & Tooling
The project uses Mise to manage environment variables and tasks. Configuration is split between mise.toml (defaults) and mise.local.toml (local overrides).
The ./zero Script
The ./zero script is the primary entry point for environment setup. It performs the following actions:
- Validates dependencies (Mise, Docker).
- Generates TLS certificates via
mkcert. - Configures Tailscale for remote development (optional).
- Runs database migrations.
- Starts infrastructure containers.
Sources: CONTRIBUTING.md:3-10, CONTRIBUTING.md:21-35
Core Mise Tasks
Common tasks used during local development.
# Start the full stack (infra + services)
mise run start
# Start containers and apply migrations (infra only)
mise run wake
# Stop daemons and containers (data is preserved)
mise run pause
# Seed the database with sample data
mise seed
Sources: GEMINI.md:75-85, CONTRIBUTING.md:85-90
Parallel Worktrees
The environment supports running multiple full stacks side-by-side using git worktrees managed by worktrunk. Each worktree is assigned unique ports and a dedicated Docker Compose project name to avoid collisions.
Worktree Lifecycle
The pre-start hook ensures port isolation, while post-start initializes the environment asynchronously.
Sources: CONTRIBUTING.md:175-200
Assistant Discovery & Local Relay
For testing AI assistants within Docker, the assistant-relay Pitchfork daemon facilitates communication between the Docker bridge gateway and the local server.
- Relay Logic: It forwards TCP traffic to
GRAM_SERVER_ADDRESSwhen runtime containers targethost.docker.internal. - TLS Support: HTTPS is the default; TLS passes through unchanged, maintaining existing certificate and CA trust.
- Bypass: The relay is bypassed if the API already listens on the gateway address or if an explicit IP is provided via
GRAM_ASSISTANT_RELAY_HOST.
Sources: CONTRIBUTING.md:55-80
Summary
Local development in Speakeasy is characterized by high automation and environment parity. Pitchfork serves as the central command for service execution, while the dev-idp enables seamless authentication testing without external dependencies. By leveraging Mise and Worktrunk, developers can maintain multiple isolated environments, ensuring that infrastructure management remains transparent to the product development process.