pnpm
pnpm add fleethostsnpm
npm install fleethostsyarn
yarn add fleethostsbun
bun add fleethostsRequires Node 22.20 or later, and ssh on PATH. Tags also need the Tailscale CLI.
First run
Section titled "First run"Name your program
Section titled "Name your program"import { standardPlaces } from "fleethosts"; const places = standardPlaces("mytool");Check the entries
Section titled "Check the entries"import { fleetEntryProblem } from "fleethosts"; const entries = ["vps", "tag:servers"]; const problems = entries.map(fleetEntryProblem).filter(Boolean);Run a command
Section titled "Run a command"import { resolveHosts, runOnHosts } from "fleethosts"; const runs = await runOnHosts(places, async (remoteCommand) => (await resolveHosts(places, entries, { remoteCommand })).targets, ["uname", "-a"], );ssh runs in batch mode, so a host that asks for a password is unreachable. Load your key into an agent first.