Rust CLI

trop

Port reservations for worktrees

trop assigns a port number to a directory and remembers it for the next run. Use it in dev scripts when you run several worktrees at once.

Install and use

Bash / Zsh
cargo install trop-cli

PORT=$(trop reserve) &&
  npm run dev -- --port "$PORT"

For an npm dev script that accepts --port.

How reservations work

A directory and an optional tag identify a reservation. Repeated calls return its stored port; another directory or tag gets a separate reservation. Use --tag web or --tag api when one directory needs several ports.

Reservations live in a local SQLite database and persist when your server stops. Run trop prune to remove records for deleted directories.

One user, one machine

A reservation records a number; it does not hold a socket open. Programs outside trop can still take the port. Reservation limits

Documentation

Overview

How directory and tag pairs identify a reservation.

Usage

Install, reserve ports, and clean up old reservations.

Configuration

YAML settings, port ranges, exclusions, and defaults.

Scope

What a reservation guarantees, and what it cannot enforce.