troll 0.3.2

The port manager that guards the bridge: permanent claims, expiring leases, and a live view of who listens where.
troll-0.3.2 is not a library.

troll port manager banner

troll

The port manager for one machine: permanent claims, expiring leases, and a live view of who listens where. One Rust binary providing the CLI, local HTTP API, embedded three-screen web console, and MCP stdio server across Linux, macOS, and Windows.

Install

cargo install troll --locked

Prebuilt archives (x86_64-linux, aarch64-macos, x86_64-macos, x86_64-windows + SHA256SUMS.txt) are also published on GitHub Releases.

Quick start

troll init
troll check 8123
troll claim 8123 --project demo --service web
troll lease --project demo --purpose preview --json
troll with --project demo -- sh -c 'printf "Leased port %s\n" "$PORT"'
troll explain 8123
troll list
troll doctor
troll serve

Four surfaces, one locked registry

  • Command line (troll ...): manage claims, leases, named [pools], apps, red zones, 30-day removal history (with atomic restore), drift inspection, explain, and doctor. Add --json for machine output or --llm-guide for agent instructions.
  • Web console (troll serve): local loopback HTTP API and embedded three-screen browser console (Console, Apps, History) with six themes, passive service detection, and one-click copy/restore actions.
  • MCP server (troll mcp): Model Context Protocol server over stdio for coding agents (troll setup claude / troll setup codex).
  • Background service (troll setup service): writes a systemd user unit on Linux, a launchd user agent plist on macOS, or a Task Scheduler XML definition on Windows.

troll web console screenshot

Guarantees

  • Never kills arbitrary processes: sweeps remove only reclaimable leases from registry.toml and leave running processes alone (the sole documented signal exception is troll with forwarding a received stop signal unchanged to its own child).
  • Safe locked writes: file-locked atomic updates with a backup copy on every change.
  • Loopback only: troll serve binds 127.0.0.1, enforces an exact Host allowlist, and requires a session token and matching Origin for mutations.
  • Zero unsafe code across the workspace.

Workspace crates

This binary crate is built on two companion library crates:

  • troll (this crate) — CLI, troll serve HTTP API + embedded web console, troll mcp stdio server, setup wizard, and OS service installers.
  • troll-core — platform-free registry model, file-locked atomic store, claims, leases, pools, red zones, 30-day history, drift, and sweep engine.
  • troll-probe — read-only OS listener, ephemeral/excluded range, process liveness, and owner-classification probe for Linux, macOS, and Windows.

Documentation

Licence

MIT — see LICENSE.