ローカル開発ルーター — OSS / MIT Local development router — OSS / MIT

Compose のままで、
衝突を消す。
Compose as-is.
Conflicts gone.

Compose as-is. Conflicts gone. Compose のままで、衝突を消す。

複数のモノレポを並列起動すると、webadmin も同じ 3000 番を取り合います。.env を書き換え、ポート番号をチームで共有し直す手間が毎朝発生します。
DevRouter はこの port 衝突を、Traefik と Host ベース URL でアプリ無改造のまま解決します。
Spin up multiple monorepos in parallel and web and admin end up fighting for port 3000. You edit .env, reshuffle ports, and resync the URL with your team — every morning.
DevRouter solves the conflict via Traefik and host-based URLs, without changing a line in your app.

~/myrepo
$ devrouter daemon up
 Global Traefik started

$ devrouter up ./myrepo
 Stack myrepo: 3 services

$ devrouter ls
myrepo-web    https://myrepo-web.localtest.me    healthy
myrepo-api    https://myrepo-api.localtest.me    healthy
myrepo-admin  https://myrepo-admin.localtest.me  healthy

並列起動が増えるほど、ポート管理が増える。 More parallel stacks, more port management.

web が 3000、admin も 3000、api は昨日 8080 に変えたはず。.env を毎回書き換え、Slack に貼った URL がチームで一致しない。並列起動するモノレポが 2-3 個になった時点で、ポート管理が日常作業になってしまいます。

web on 3000, admin also 3000, api moved to 8080 yesterday — or was it? You edit .env repeatedly, and the URL you pasted in Slack disagrees with your teammate's. Once you run two or three monorepos in parallel, port management becomes a daily chore.

PORT 3000 already in use

繰り返される port 衝突Recurring port conflicts

web も admin も 3000 を欲しがる。誰かを 3001 に逃がし、その変更を git に commit するか毎回迷う。Both web and admin demand 3000. You bump one to 3001 and wonder, every time, whether to commit it.

.env: rewriting again

毎朝の .env 書き換えDaily .env rewrites

PORT、HOST、API_URL — 並列起動のたびに書き換え、commit に混ぜず、戻し忘れる。PORT, HOST, API_URL — rewritten for every parallel run, kept out of commits, forgotten when reverted.

URL drift across team

チームで違う localhostTeammates' localhost differs

localhost:5174 は URL ではなく座標。Slack に貼っても、隣の人の環境では別の何かが立っている。localhost:5174 is a coordinate, not a URL. Pasted in Slack, it points somewhere else on a teammate's machine.

ローカル開発に、本番のような秩序を。 Production-like order for localhost.

DevRouter が一貫して守る、三つの方針。 Three principles DevRouter consistently follows.

TENET 01

アプリは触らないDon't Touch the App

Don't Touch the Appアプリは触らない

port、host、proxy の設定はすべて外側のレイヤーで完結。アプリ側のコードは production と同じ状態を保ちます。Ports, hosts, and proxy settings live one layer outside the app. Your app code stays identical to production.

TENET 02

ローカルにも、固定 URL をStable URLs for Localhost

Stable URLs for Localhostローカルにも、固定 URL を

localhost:5174 はチームで一致しません。https://<stack>-<svc>.localtest.me なら、ブックマークでき、共有でき、明日も同じ場所にあります。localhost:5174 never matches across a team. https://<stack>-<svc>.localtest.me is bookmarkable, shareable, and stable across days.

TENET 03

再起動より、まず診断Diagnose Before Restart

Diagnose Before Restart再起動より、まず診断

devrouter doctor で設定の不整合を検出し、原因を特定。再起動は最後の手段です。devrouter doctor identifies misconfiguration and pinpoints the cause. Restart is a last resort.

三つのコマンドで、URL が立つ。 Three commands. Real URLs.

グローバル Traefik が一つ立ち、各 stack はそこにぶら下がる。アプリ側は何も知りません。 A single global Traefik proxy. Each stack joins it. Your apps don't need to know.

STEP 01

管制塔を起動Boot the tower

devrouter daemon up

グローバル Traefik が 80/443 を受けて、stack 共通の devrouter_net を用意します。Global Traefik takes 80/443 and provisions the shared devrouter_net network.

STEP 02

stack を上げるBring up a stack

devrouter up ./myrepo

既存の docker-compose を読み、Traefik ラベルを足して起動。アプリは無改造のまま。Reads your existing docker-compose, attaches Traefik labels, and starts. Apps are untouched.

STEP 03

URL でアクセスOpen the URL

https://<stack>-<svc>.localtest.me

Host ベースで自動振り分け。チームでブックマークできる、固定の URL。Routed by host header. A stable URL the whole team can bookmark.

ローカルにも、ちゃんと URL を。 Real URLs for localhost.

必要なものだけ。決して多くない。 Only what you need. Nothing more.

Zero App Changes

アプリの設定は変更しません。port、host、proxy はすべて外側で。No edits inside your app. Ports, hosts, and proxies live one layer up.

Host-based URLs

https://<stack>-<svc>.localtest.me でチームに貼れる固定 URL。https://<stack>-<svc>.localtest.me — a URL you can share with the team.

Automatic Routing

Traefik が Docker ラベルから経路を組み立てます。設定は最小限。Traefik composes routes from Docker labels. Minimal config required.

HTTPS (mkcert)

ローカルでも本物の HTTPS。Service Worker や Secure cookie もそのまま。Real HTTPS on localhost. Service Workers and Secure cookies just work.

Web UI 同梱Web UI Included

ログ・依存・リソース・ヘルスを一画面で。devrouter ui で起動。Logs, deps, resources, health — one screen. Run devrouter ui.

AI-Assisted Configuration

同梱プロンプトを Claude や ChatGPT に渡せば、devrouter.yaml を初期生成できます。Hand the bundled prompt to Claude or ChatGPT and get a first-pass devrouter.yaml.

リアルタイムでログ・依存・リソースを見る。 Live logs, deps, and resources — at a glance.

ヘルス、ログ、再起動 — 必要な情報が一画面に揃います。 Health, logs, restart — everything you need on a single screen.

Roxy はルーター、DevRouter は管制塔。 Roxy is a router. DevRouter is a control tower.

領域が重なるツールはあります。立ち位置は違います。 Adjacent tools exist. The stance differs.

特徴Capability DevRouter Tilt Caddy Roxy
言語非依存Language-agnostic
Compose 互換Compose compatible部分partial
モノレポ stack 抽象Monorepo stack abstraction
Web UI 同梱Web UI included
OSS
macOS / Linux 両対応macOS & LinuxmacOSmacOS only

Roxy はルーター、DevRouter は管制塔。 Roxy is a router. DevRouter is a control tower.

3 コマンドで、立ち上がる。 Three commands to get running.

macOS / Linux で動作確認。Docker が必要です。 Verified on macOS and Linux. Docker required.

インストールinstall
# macOS (Apple Silicon) / Linux (amd64) — see Releases for other arches
$ curl -L https://github.com/simota/devrouter/releases/latest/download/devrouter_darwin_arm64.tar.gz | tar xz
$ sudo mv devrouter /usr/local/bin/
01

グローバル Traefik を起動Boot the global Traefik

$ devrouter daemon up
02

monorepo を立ち上げるBring up your monorepo

$ devrouter up ./myrepo
03

URL を確認するList the URLs

$ devrouter ls

設定はもう、AI に書いてもらう。 Let the AI write your config.

同梱の prompt を Claude / ChatGPT に渡すだけ。プロジェクトを読み、設定 2 ファイルを生成します。 Hand the bundled prompt to Claude or ChatGPT. It reads your project and emits two config files.

DevRouter は prompts/generate-config.md に設定生成プロンプトを同梱しています。AI が devrouter.yamldocker-compose.devrouter.yml の初期版を出力します。DevRouter ships prompts/generate-config.md. The AI produces a first draft of devrouter.yaml and docker-compose.devrouter.yml.

You are an expert at generating DevRouter configuration files. Analyze the codebase in the specified directory and generate devrouter.yaml and docker-compose.devrouter.yml You are an expert at generating DevRouter configuration files. Analyze the codebase in the specified directory and generate devrouter.yaml and docker-compose.devrouter.yml
プロンプト全文を見るRead the full prompt

port 衝突を、今日から無くす。 Stop port conflicts today.

OSS / MIT。Docker があれば動きます。 OSS / MIT. Works wherever Docker does.