GitHub 1
Skip to content

Command line

Every fleetrc command and flag, the exit codes, the JSON output, the environment variables, and the functions the package exports.

Run fleetrc <command> to sync skills, edit the manifest, and manage the machines in your fleet. fleetrc with no command runs sync. fleetrc <command> --help prints that command's flags.

CommandWhat it does
fleetrc sync [source]Fetch the sources, or only source, and link their skills. The default command.
fleetrc init [manifest]Point this machine at a manifest, migrate its skill folders, sync, and install the launcher and session hooks.
fleetrc statusShow the last run, held and pending updates, edited skills, and sessions to restart.
fleetrc listList the linked skills, files, and config entries, and where each comes from.
fleetrc agentsList every agent id, which are installed here, and where each reads skills.
fleetrc doctorCheck Node.js, git access, the sync trigger, and duplicate skills. See Doctor.
fleetrc add <source>Add a source to the manifest, then sync.
fleetrc remove <source|skill>Remove a source, or exclude one skill from its source.
fleetrc adopt <path>Move a hand-made skill folder into your personal repository.
fleetrc fork <skill>Move a vendored skill into your personal repository, to edit it.
fleetrc diff [skill|mcp/<agent>/<server>]Show updates held for review, or one skill's or MCP server's local edits.
fleetrc merge <skill>Merge an upstream update into an edited skill or a fork.
fleetrc update <source>Apply the updates a review-mode source is holding.
fleetrc timer install|remove|statusInstall, remove, or show the timer that syncs on the manifest's schedule.
fleetrc fleet sync|status|upgrade|init|add|runRun on the manifest's machines over SSH, or add machines to it.
fleetrc hook install|remove [agent]Add or remove the session hooks of Claude Code and Codex.
fleetrc self-installCopy this fleetrc into the state folder. init and fleet upgrade run it.

status, list, agents, doctor, and diff are read-only. They reject --dry-run, since they change no skills, links, or manifest.

These flags work on most commands. A command that does not take a flag exits 2 with <command> does not take --<flag>.

FlagMeaning
--dry-runPrint what would change and change nothing.
--jsonPrint one JSON document on stdout. Messages go to stderr.
--offlineUse what is already fetched, with no network.
--copy, --no-copyCopy skill folders, or link them again. fleetrc remembers the choice.
--manifest <m>Use this manifest instead of the configured one.
-v, --versionPrint the version.
-h, --helpShow help.

--copy and --no-copy together exit 2. A dry run does not save the choice. See Syncing.

These flags belong to one or a few commands:

FlagCommandsMeaning
--timerinit, fleet initInstall the timer too, for a machine where no agent runs.
--no-hooksinit, fleet initDo not install the session hooks.
--forceinit, fleet initGo ahead even when skill names would be lost.
--timeout <s>fleetSeconds to wait for each host. Default 30, or 120 for fleet init.
--id <id>addThe source's id. Default: the repository, host, or package name.
--skills <glob>addSkill folders inside the source, such as skills/*.
--include <name>addOnly this skill. Repeat for more.
--exclude <name>addNever this skill. Repeat for more.
--reviewaddHold the source's updates for review: sets "update": "review".

diff takes --manifest only. status and list take --json only.

Exit codeMeaning
0The command did what you asked.
1The command ran and failed: a sync reported errors, a doctor check failed, merge left conflicts, timer status found no timer, or a host in fleet failed. Errors fleetrc expects, such as a bad manifest or an unreadable repository, also exit 1.
2The command line is wrong: an unknown command or flag, a missing argument, or flags that contradict each other.

Errors go to stderr as one line, fleetrc: <message>. An error fleetrc did not expect says so and names FLEETRC_DEBUG. Under --json, a failure is also a document on stdout:

{ "ok": false, "error": "no manifest yet: run `fleetrc init <manifest>` first" }
json

A Node.js older than 22.12 exits 1 before any command runs.

With --json, a command prints one document on stdout and its messages on stderr.

CommandThe document
sync, updateThe sync report, with a fleetrc field for the version. See Syncing.
init{ plan, applied, sync, installed, hooks?, timer? }. With --dry-run, the plan with launcher, hooks, and timer.
statusmanifest, lastRun, lastChange, files, entries, forks, staleSessions, trigger, timer, and timerSchedule when the schedule drifted.
listversion, lastChange, skills, files, and entries.
agentsAn array of { id, name, dir?, detected, linkedInto?, kinds? }.
doctorAn array of { name, ok, detail, skipped?, warn? }.
add, remove, adopt, forkWhat changed, with file, push, dryRun, and the sync report under sync when a sync ran.
merge{ merged, conflicts, into, dryRun }, and resolved, markers, and manifest when they apply.
fleet sync, status, upgrade, initAn array with one result per host.
fleet run[{ host, reachable, exitCode, stdout, error }].
timer, hookThe timer's spec or status, or the hook changes.

diff and self-install take no --json.

list --json reads only this machine's state, with no manifest and no network. A later version only adds fields, and bumps version for any other change. A skill's dir may lack a readable SKILL.md, so check before you read it.

{
  "version": 1,
  "lastChange": "2026-12-04T09:12:41.208Z",
  "skills": [
    {
      "name": "nuxt",
      "source": "nuxt",
      "dir": "/home/me/.local/state/fleetrc/store/nuxt/live/nuxt",
      "changedAt": "2026-12-04T09:12:41.208Z"
    }
  ],
  "files": [],
  "entries": []
}
json
VariableEffect
XDG_CONFIG_HOMEPuts config.json in $XDG_CONFIG_HOME/fleetrc. A relative value is ignored.
XDG_STATE_HOMEPuts the state folder in $XDG_STATE_HOME/fleetrc. A relative value is ignored.
APPDATA, LOCALAPPDATAOn Windows, the config folder %APPDATA%\fleetrc and the state folder %LOCALAPPDATA%\fleetrc, when the XDG variables are unset.
FLEETRC_PACKAGEThe package fleet init and fleet upgrade run on hosts with npx, instead of fleetrc@<version>: a tarball, a URL, or a preview build. It also skips the check that this version is on npm.
FLEETRC_DEBUGPrint the stack of an unexpected error.
NPM_TOKENSent as a bearer token to the registry of an npm source. Not sent for a source only an extended manifest names.
npm_config_registryThe registry for npm sources without a registry, and for the release check in fleet.

fleetrc sets some variables itself. The timer and the syncs a session hook starts set FLEETRC_TIMER: the report's first line then starts with its time, and a sync that finds another running exits 0 and logs that it skipped. A manifest hooks command gets FLEETRC_HOOK and FLEETRC_CHANGED. fleetrc sets DO_NOT_TRACK=1 unless you set it.

sync [source] fetches every source, links the skills, and prints a report. With a source id, it fetches only that source and links the others from what is on disk. It exits 1 when the report has errors. See Syncing for what a sync does.

fleetrc sync --offline
fleetrc: linked 12 skills into 2 folders (offline)
txt

update <source> is sync <source> that also applies the updates the source holds for review.

init [manifest] sets up this machine. The manifest is a repository (owner/repo, github:owner/repo, gitlab:group/repo, or a .git URL), read for .fleetrc/manifest.json; <repo>//<file>; or a file or folder on this machine. Without one, init uses the configured manifest again, and on a new machine asks your tailnet policy. init tailscale: switches a machine to the policy's manifest.

init plans the migration of your skill folders, syncs, installs the launcher, adds the session hooks to Claude Code and Codex where they exist, and keeps the timer on a machine that had one. Preview it first:

fleetrc init my-team/agents --dry-run

init exits 1 and changes nothing when it would lose skill names. Add a source for them, or pass --force.

status prints the manifest, the last run, forks and merge conflicts that need you, what starts syncs here, the timer, and Codex sessions that began before the last skill change. list prints one line per skill, file, and config entry: name, source, and path. agents prints each agent id, whether it is installed, and the folder it reads. None needs the network.

add <source> accepts owner/repo, a git URL, a GitHub or GitLab page, an index URL, npm:<package>, or a local path.

fleetrc add onmax/nuxt-skills --include nuxt --include nuxt-ui --review

remove <source|skill> removes a source from sources. For a source from an extended manifest, it adds the id to excludeSources. For a skill, it adds the name to exclude.

adopt <path> moves a skill folder with a SKILL.md into the personal repository: the first source marked "adopt": true, else the first git source with a path. fork <skill> copies a vendored git skill there, records it under forks with the commit it started from, and excludes it from its source.

Each command edits the manifest and then syncs. A manifest fetched from a repository is not edited in place. fleetrc edits a working clone of it (a source with a path) and tells you to commit and push, or stops and says what to change.

diff with no argument prints every update a source holds for review. diff <skill> prints a skill's local edits against upstream, or its pending update against what is installed. diff mcp/<agent>/<server> compares an MCP server in the agent's config with what the manifest gives it. It prints no differences or no updates are waiting for review when there is nothing.

merge <skill> brings an upstream update into an edited skill or a fork. It exits 1 when conflicts remain: resolve the markers by hand, then run merge again. merge --dry-run shows what would merge.

timer install installs a user timer that runs sync on the manifest's timer.cron: systemd on Linux, launchd on macOS, Task Scheduler on Windows. timer remove removes it. timer status shows it and exits 1 when none is installed. timer status takes no --dry-run. See Timer.

fleet runs on the machines in the manifest's fleet, over SSH. Name hosts or tag:<name> after the action to use fewer machines.

ActionWhat it does
fleet sync [host...]Run sync on each host and report.
fleet status [host...]Show each host's version and last run.
fleet upgrade [host...]Install this version on each host with npx.
fleet init <host...>Run init on each new host with this machine's manifest, then add it to fleet. The manifest must be in a repository.
fleet add [host...]Add hosts to the manifest. With none, suggest machines and tags on your tailnet.
fleet run [host...] -- <command>Run the command here and on each host, and print each host's output after its name.

fleet init passes --copy, --no-copy, --timer, --no-hooks, and --force to each host. fleet status, upgrade, and run reject --dry-run. All actions but add exit 1 when a host is unreachable or fails. See Fleet.

hook install [agent] adds the session hooks, and hook remove [agent] takes them out. The agent is claude-code or codex. Without one, the command acts on each agent whose folder exists. When a session starts, the hook starts a background sync if none was tried in the last 15 minutes and none is running. See Hooks and MCP.

self-install copies this fleetrc into the state folder, where the launcher, the hooks, and the timer run it.

The package exports run, runOnFleet, and the RunResult type.

import { run, runOnFleet, type RunResult } from "fleetrc";

// The command on every host in this machine's fleet, never on this machine.
// undefined when fleetrc has no config here or the fleet is empty.
const results: RunResult[] | undefined = await runOnFleet(["uname", "-a"], { timeoutMs: 30_000 });

// The whole CLI, with help and error text naming the command the user typed.
await run(process.argv.slice(3), "mytool fleet");
ts

runOnFleet(argv, { timeoutMs }) reads the fleet from the manifest's last fetched copy and returns one result per host: host, reachable, exitCode, stdout, stderr, and error when there is no exit code. It throws when config.json or the manifest does not read.

run(argv, name) runs the CLI on argv, the arguments after the program name. It writes to stdout and stderr and sets process.exitCode. A command line it can't run exits the process with 2, so call it once per process.