Rust CLI

trop

Port reservations for worktrees

A small CLI for stable localhost port numbers per worktree.

RustCLISQLiteWorktrees

Terminal

shell

quick start
$ cargo install trop-cli
$ PORT=$(trop reserve)
$ npm run dev -- --port $PORT

Reservation model

Same key, same port.

Reservations are keyed by directory and optional tag. Repeated calls return the same port.

What trop provides

Small guarantees for boring local ports

Idempotent

Same directory, same port

Run trop reserve again from the same worktree and get the same number.

Learn more

Tagged

Tags split services

Use --tag web, --tag api, or similar names when one worktree needs multiple ports.

Learn more

Concurrent

SQLite coordinates callers

Concurrent invocations share a local SQLite database.

Learn more

Cleanup

Prune deleted worktrees

Remove reservations whose directories no longer exist.

Learn more

Scope

Single-user coordination on one machine.

Non-goals

No system-wide enforcement. No multi-user broker. No container orchestration.

Documentation

Keep detailed guidance in Starlight.

Overview

What trop reserves, why it exists, and where it fits.

Open page

Usage

Basic commands and script patterns for local port reservations.

Open page

Configuration

Port ranges, tags, exclusions, and cleanup behavior.

Open page

Scope

What trop deliberately does and does not attempt to solve.

Open page

Install

Replace the fixed port.

Use trop reserve where a script expects a port.

$ cargo install trop-cli
$ trop --version
$ PORT=$(trop reserve)