Skip to content

Command reference

Every verb is ros2 fairy <verb>. ros2 fairy on its own lists them.

Common behaviour

  • --debug (every verb): verbose logging to stderr, and full tracebacks instead of the friendly error message.
  • --json (where listed): machine-readable output on stdout. Errors are {"status": "error", "error": "<message>"}.
  • Mission identifiers. Verbs that take a mission accept, in order of precedence: an archive folder path, a number (1 = newest, 2 = the one before), or a mission ID such as m-20261002-082109-1a2b.
  • Exit codes.
Code Meaning
0 Success, including "you declined, nothing changed".
1 The command refused or failed.
2 It needed to ask a question but there was no terminal (use --yes where available).
130 Cancelled with Ctrl-C. Nothing was changed.
Verb Summary
setup One-time robot setup: identity file, directories, watchdog service
doctor Check that this robot is ready to capture a mission
mission_start Answer five quick questions to describe the mission
mission_record Record mission data (wraps ros2 bag record)
mission_status Show what the recording assistant is doing right now
mission_close Review the finished mission and save or discard it
mission_abort Abandon the open mission without saving
drop Take one recording out of the open mission (the opposite of adopt)
edit Change a saved mission's briefing
delete Permanently delete saved missions
prune Free disk space: delete the recordings of exported missions, keep the rest
list List the missions saved on this robot
diff Compare two missions and show what changed
verify Check that a saved archive is complete and unmodified
export Package missions into portable, checksummed files
upload Copy exported missions to cloud storage, with rclone
repair Make unplayable (bad-clock) recordings playable
adopt Attach a bag recorded outside mission_record
reindex Rebuild the mission list from the archives on disk
add_operator Let more accounts record missions
move_data Move the recordings and saved missions to another folder or disk

setup

ros2 fairy setup [--operator USER]... [--var-dir DIR] [--ros-setup PATH]
                 [--debug]
ros2 fairy setup --refresh-env [--from-container NAME] [--ros-setup PATH]
                 [--debug]
ros2 fairy setup --show
ros2 fairy setup [--robot-name NAME] [--platform TEXT] [--serial TEXT]
                 [--organization TEXT] [--contact-email EMAIL]
                 [--license URL_OR_SPDX] [--add-sensor SPEC]...
                 [--set-sensor ID SPEC]... [--remove-sensor ID]...
                 [--record-topics TOPICS] [--storage NAME] [--yes]

ros2 fairy setup: the wizard's answers for robot scout-02, two sensors and operators ben and cleo, then the configuration review and the Write question

The interactive robot setup described in Set up the robot. Run it as your normal user: only the final step uses sudo, and the answers are passed to it on stdin.

Option
--operator USER Another account that will record missions; repeatable. Skips the question about other operators. An account that doesn't exist stops setup before any question.
--refresh-env Only re-capture the ROS environment from this shell and restart the watchdog; no questions. See Changing the robot's configuration later.
--from-container NAME Take the DDS discovery settings from this running container instead of this shell, for a robot whose ROS runs in Docker; with or without --refresh-env. See Robots whose ROS runs in Docker.
--var-dir DIR Where to keep recordings and saved missions (default /var/ros-fairy); skips that question. Only while there are no missions yet: to move existing ones, use move_data. It also replaces a paths.yaml that can't be used. The wizard refuses to run while ROS_FAIRY_VAR_DIR is set in the shell, unless this is given.
--ros-setup PATH Only when running setup directly as root (sudo ros-fairy-setup): the ROS 2 setup.bash to source. Auto-detected when there is exactly one /opt/ros/*/setup.bash.

It refuses (exit 1) if ROS isn't sourced, no ROS nodes are visible, or the service (which runs as root) couldn't load the fairy package, e.g. when it is only installed in a home directory. It also fails if sudo isn't available, or the service fails or keeps restarting in its first 10 s (then check journalctl -u ros-fairy-watchdog). Declining the review writes nothing and exits 0; three wrong answers to one question also write nothing, but exit 1.

ros-fairy-setup is the same command as a standalone script.

Changing one part of the configuration

ros2 fairy setup --show
ros2 fairy setup --set-sensor gps0 topic=/gps/fix
ros2 fairy setup --remove-sensor lidar0 \
    --add-sensor id=lidar1,type=lidar,model="Ouster OS2",topic=/points

These flags change only what they name in robot_identity.yaml, without the wizard and without needing ROS. Every flag that takes a sensor can be repeated, and they combine in one call: one diff, one write.

Option
--show Print the configuration as the recording assistant reads it, or the mistake in it.
--robot-name, --platform, --serial The robot. The name is 40 characters at most.
--organization, --contact-email The owner.
--license URL_OR_SPDX The missions' default license: a URL, or an SPDX identifier such as CC-BY-4.0 (saved as its https://spdx.org/licenses/ URL). "" removes it.
--add-sensor SPEC id=ID,type=TYPE,model=MAKE_MODEL,topic=TOPIC, optionally ,frame=FRAME and ,calibration=FILE. TYPE is gps, lidar, camera, imu, sonar or other. Quote a value that has a comma: model="Foo, Inc. X1".
--set-sensor ID SPEC Change a sensor with the same KEY=VALUE pairs: id= renames it (and its calibration entry, unless another sensor shares it), an empty frame= or calibration= removes that.
--remove-sensor ID Remove a sensor, and its calibration entry if no other sensor uses it.
--record-topics TOPICS What mission_record records: /fix,/scan, or all.
--storage NAME mission_record's storage (mcap, sqlite3), or default for rosbag2's.
--upload-to DEST Where export --upload and upload copy bundles: an rclone destination such as lab-nas:fairy/heron, or none. In a terminal it offers to install rclone, and to set up a remote it doesn't know with rclone config. A remote still unknown is refused (unless rclone isn't installed).
--yes, -y Write without asking.

The result is checked with the same rules the recording assistant uses before anything is written. A mistake is refused with what's wrong, and nothing changes. Otherwise the change is shown as a diff of the file and confirmed. Then it is written through sudo, keeping the previous file as robot_identity.yaml.bak. A calibration file must exist; it is saved by its absolute path. When the robot's ROS graph is visible, a sensor topic nobody publishes gets a warning, not a refusal (the sensor may be off).

Nothing needs restarting: the configuration is read again at every recording. Saved missions are unaffected: each keeps the configuration it was recorded with, and verify checks it against that. A sensor added later doesn't make an older mission look incomplete. diff between a mission from before and one from after shows the change.

The edit flags can't be combined with the wizard's flags (--operator, --var-dir) or --refresh-env. A configuration with a mistake (edited by hand) can be fixed with them: doctor names the mistake. A section left empty (sensors: with nothing after it) counts as empty; one of the wrong kind (robot: Jo) is refused, to be fixed by hand or with the wizard.

doctor

ros2 fairy doctor [--json] [--debug]

ros2 fairy doctor reporting the robot READY (with warnings): the only warning is the missing optional harvest tools, with the command that installs them

Read-only checks, each reported as ok, warning, failure or skipped:

Check Fails / warns when
Robot identity robot_identity.yaml is missing ("Robot is not set up") or has a mistake ("The robot configuration has a mistake", with what's wrong; fix it with setup's flags)
Data folder says where missions are kept; fails if paths.yaml can't be used, warns if this shell's ROS_FAIRY_VAR_DIR points elsewhere than the service, or missions were left behind in /var/ros-fairy
Recording assistant the watchdog isn't installed yet ("Recording assistant is not installed": run setup; the service checks below are left out until then), isn't running, or has been recording with no heartbeat for 5 minutes
Service interpreter the installed service's interpreter can't load the fairy package (only installed in a home directory), or the service starts an old module (ros_fairy, from before the package was renamed; setup --refresh-env updates it)
Watchdog code the running watchdog's code differs from the installed code (restart it)
ROS graph ros2 isn't on PATH, ROS isn't reachable, or no nodes are running
ROS environment ROS_DISTRO isn't set in this shell
Service environment watchdog.env is missing, or differs from this shell's ROS environment (distro, DDS discovery settings, DDS profile, root-owned overlays); the hint is ros2 fairy setup --refresh-env. When a running ROS container matches the service, it is this shell that's off, and the hint is the export that fixes it
ROS containers a running ROS container has other DDS discovery settings than the service (hint: --refresh-env --from-container NAME), its nodes disagree with each other (summed up per setting when there are more than three combinations), or it is on its own Docker network. The settings are what its ROS processes run with when the watchdog has seen them (start-up scripts included), otherwise its configuration (details). Without Docker access, the watchdog's findings are compared without names; skipped when there are none either
Last harvest the last ROS capture failed
Clock the system clock isn't NTP-synchronised
MCAP support the mcap Python package is missing
Harvest tools an optional tool the harvest uses is missing (lsusb, lspci, v4l2-ctl, udevadm, setpriv, dmesg, or the rocrate package); the hint gives the install commands
Disk space less than 1 GiB free for the spool
Docker (skipped when Docker isn't used)
Upload destination The remote saved with setup --upload-to is unknown to this account's rclone, or rclone isn't installed (a warning: another account may have it). Skipped when none is saved.
Saved missions an interrupted save is waiting to be finished

Result: READY, READY (with warnings) or NOT READY. Exit code 1 only on NOT READY. --json prints {"result": ..., "checks": [{status, title, detail, hint}]}.

mission_start

ros2 fairy mission_start [--operator NAME] [--goal TEXT] [--location PLACE]
                         [--environment TEXT] [--notes TEXT] [--yes] [--json]
                         [--debug]

ros2 fairy mission_start: the five briefing questions answered, then Mission briefing saved

Asks the five briefing questions and saves them to the spool. It also records the shell's DDS settings for the watchdog (session.env).

Option
--operator, --goal, --location The required answers. Each one given skips its question.
--environment, --notes The optional answers.
--yes, -y Replace an unfinished mission that has no recordings without asking.
--json Print {"mission_id": ..., "operator": ..., "goal": ..., "location": ...}; everything else goes to stderr. Needs the three required answers and implies --yes.

With no answer options it asks all five questions. With some, it asks only the required ones still missing, on a terminal. With no terminal to ask on (a script, a launch file) it exits 2 and names the missing options. An empty --goal "" counts as missing. The goal can be at most 280 characters and the operator's name 80: a longer one given as an option exits 2, and a longer answer is asked again.

It refuses (exit 1) while a recording is running, or while the spool holds recordings that haven't been saved or discarded (--yes doesn't change that). It asks before replacing an unfinished mission that has no recordings; without a terminal and without --yes that exits 2 and keeps the old mission. Recordings made while no mission was open are not taken into the new one with --yes: they stay on disk, and adopt attaches them.

mission_record

ros2 fairy mission_record [--yes] [--debug] [<ros2 bag record options>]

Runs:

ros2 bag record <topics…|--all> [--storage <format>] --output <spool>/bags/<mission_id>_<YYYYmmdd-HHMMSS> [<your options>]

Topics and storage come from recording: in robot_identity.yaml. Without a mission open, the folder prefix is unbriefed.

Option
--yes, -y Record without asking about low disk space, a missing briefing, an unsynchronised clock or a recording already running.
any ros2 bag record option Passed on as typed, e.g. --max-bag-size 1000000000, --compression-mode file --compression-format zstd, --qos-profile-overrides-path qos.yaml, or topics. ros2 fairy mission_record -h lists them, and Tab completes them.

mission_record takes ros2 bag record's options directly: they come from the installed rosbag2, so a typo or an option this rosbag2 doesn't have stops it at once with the usual usage message (exit 2), before any question or check. Then:

  • -o/--output is refused: recordings go to the spool, where the watchdog finds them.
  • A topic selection of your own (topics, --topics, --services, --topic-types, -a/--all, --all-topics, --all-services, -e/--regex) replaces the one from robot_identity.yaml, and it says so. Exclusions (--exclude-…) are added to it.
  • --storage of your own replaces the configured one. A configured storage this rosbag2 doesn't have stops it before recording (exit 1), and says how to change it.
  • Everything else is passed as written.

A recording compressed as whole files (--compression-mode file) is saved like any other, but its timing can't be checked: see recording health.

Before recording it checks that the robot is set up and this account may record (exit 1 if not), that ros2 exists (exit 1 if not), free disk space (at least 1 GiB, otherwise it asks), that a briefing exists, that no other recording is running (asks; default no), that the watchdog is running (warning only) and clock sync (asks).

Ctrl-C forwards one SIGINT so rosbag2 finishes the file cleanly. Two further presses force it to stop. SIGTERM and SIGHUP are handled the same way. Exit 1 if the recorder exits with an error; the data captured so far is kept.

mission_status

ros2 fairy mission_status [--json] [--debug]

ros2 fairy mission_status during a recording: the assistant recording, the briefing, and the recording just started, with nothing written to disk yet

Shows:

Row Content
Assistant not installed (before setup) · not running · not responding · recording (since when) · wrapping up · watching
Briefing operator and goal, or "not started yet"
Recording the active bag and its size so far
Recordings waiting recordings to close, with total size, then one line each: its number (#1, #2, … for drop), start time, length, size, and where it is if it wasn't made in the spool
Context captured per harvest module: ✓ captured, ⚠ partial, – not used on this robot, ✗ will keep trying

--json keys: assistant, watchdog_state, mission_context, spool_bags, recordings, recording_ids (path → number), recording_now. Always exits 0.

mission_close

ros2 fairy mission_close [--note TEXT] [--yes] [--debug]

ros2 fairy mission_close: the notes question, then the mission summary with its sensors and a warning, and the Save this mission question

Option
--note TEXT Post-mission notes; skips the notes question.
--yes, -y Save without asking; the notes stay as they are (set them with --note). Also finishes an interrupted save. The briefing must already exist.

In order:

  1. Offers to finish any save that was interrupted.
  2. Refuses (exit 1) while a recording is in progress. Waits up to 245 s for the watchdog to finish a capture.
  3. Picks up spool recordings the watchdog hadn't processed.
  4. Asks missing briefing answers and notes.
  5. Builds the mission record, grades its quality, checks for duplicates, and shows the review.
  6. Save (default yes, or no when the quality is poor). If you don't save, it asks whether to discard (delete the spool recordings and capture) or keep (change nothing). If a recording was started in another terminal while it asked, nothing is discarded (exit 1): run it again once that recording has finished.

Exit 1 when there is nothing recorded, the briefing is missing and there is no terminal to ask in, or the save fails. When a save fails before completing, your data is left exactly as it was.

mission_abort

ros2 fairy mission_abort [--yes] [--debug]

ros2 fairy mission_abort asking to confirm, listing the recording it would delete, then asking Delete 1 recording and abort

Abandons the open mission. It asks to confirm, and again before deleting spool recordings. Recordings made outside ROS F.A.I.R.y are never deleted. --yes skips both questions. It refuses (exit 1) while a recording is in progress, while mission_close runs, or while an interrupted save is unfinished (run mission_close to finish it first). If a recording was started in another terminal while it asked, nothing is deleted (exit 1). To take out only one recording and keep the mission, use drop.

drop

ros2 fairy drop [RECORDING] [--yes] [--debug]

Takes one recording out of the open mission; the briefing and the other recordings stay. It is the opposite of adopt.

Option
RECORDING Its number as mission_status shows it (3 or #3), or its path. Without it, the recordings are listed and it asks which; with no terminal it lists them and exits 2.
--yes, -y Don't ask before deleting or detaching it.

The numbers. Each recording gets a number (#1, #2, …) when the watchdog takes it into the mission: one made with mission_record or noticed on its own once it has been processed, one attached with adopt at once. A number never changes and is never given to another recording of the same mission, so after drop 2 the others keep theirs, and a new recording gets the next unused one. A recording still being processed has no number yet (– in the list): use its path. The numbers only name recordings while the mission is open; mission_record.json doesn't keep them (the raw harvest/harvest.json copy in the crate still shows them).

A recording in the spool (made with mission_record) is deleted, after a confirmation (default no). One made elsewhere and only referenced (noticed by the watchdog, or attached with adopt) is detached: it stays on disk, and ros2 fairy adopt <path> attaches it again (with a new number).

It refuses (exit 1) while a recording is in progress or still being processed, while mission_close runs, or while an interrupted save is unfinished (run mission_close to finish it first). Exit 1 also for a number or path that isn't in the mission.

edit

ros2 fairy edit [MISSION] [--operator NAME] [--goal TEXT]
                [--location PLACE] [--environment TEXT] [--notes TEXT]
                [--redact --by NAME] [--yes] [--debug]

Called mission_edit before 0.2.0; the old name still works, with a note, until 1.0.

Changes a saved mission's briefing: the operator, goal, place, environment and notes. MISSION is a number (1 = newest, the default), an archive folder or a mission ID.

Option
--operator, --goal, --location New values (they can't be empty; the goal is 280 characters at most, the operator's name 80).
--environment, --notes New values; "" clears them.
--redact Also remove the old values (see below). Needs --by and your sudo password.
--by NAME With --redact: your full name, recorded with it (asked on a terminal if missing).
--yes, -y Don't ask before saving the changes.

Without options it asks the five questions with the saved answers as defaults: Enter keeps one, - clears an optional one. With no terminal and no options it exits 2. It shows each change (now → will be) and asks before saving.

The briefing is in four files of the crate, rewritten together: mission_record.json (the new values, and the change in provenance.edits), README.md (rendered again, keeping the warnings it was saved with), ro-crate-metadata.json (only the values that depend on the briefing, plus dateModified) and checksums.sha256 (those three files' lines). The mission list is updated. The recordings, the other files and the folder's name don't change, so paths to the mission still work.

  • The archive must be as it was saved. If checksums.sha256 doesn't match a file, it refuses (exit 1) rather than re-hash a change made by hand: verify shows what changed.
  • Exports go stale. A bundle exported before no longer matches. Its export record is dropped, so export --all exports the mission again, and the message gives the export … --force command that replaces the old bundle.
  • Crash-safe. The new files are written next to the old ones and swapped in once all are complete. If it's interrupted, verify says so and the next edit of that mission finishes the swap (or throws away a half-written edit, leaving the mission as it was).
  • Newer records (saved by a newer ROS F.A.I.R.y, with fields this version doesn't know) are refused: rewriting them would lose those fields.

Redacting. A normal edit keeps the old values in the mission's history (provenance.edits). When the old text shouldn't be there at all (a person's name or a phone number in the notes), --redact removes it:

ros2 fairy edit 1 --notes "weather fine" --redact --by "Ana Rossi"
  • The changed fields' old values aren't kept, and earlier history entries of those fields are blanked (marked redacted). The entry still records the time, your account, your name (by) and which fields changed. Fields not being changed keep their history.
  • If the place or the operator is redacted, the archive folder (whose name is built from them) is renamed, and the mission list follows.
  • The mission list (index.db) is compacted, so no old page of it keeps the text.
  • The write runs as root through sudo, which asks for your password: the system's auth log keeps the exact command next to your account. A wrong password changes nothing. It asks before saving (default no), and with no terminal it needs --by.
  • Copies made before are out of its reach: bundles exported earlier (the message names the last one) and backups still hold the old values. Delete or replace them.

delete

ros2 fairy delete (MISSION_ID... | --today | --yesterday | --all) [--debug]

Called mission_delete before 0.2.0; the old name still works, with a note, until 1.0.

Form
MISSION_ID... One or more missions, by exact ID only (not a number or a path). If one isn't found, nothing is deleted. Several use sudo.
--today Every mission recorded today. Uses sudo.
--yesterday Every mission recorded yesterday. Uses sudo.
--all Every saved mission. Uses sudo.

Needs an interactive terminal. It shows what will and won't be deleted, asks to confirm, then prompts you to type a confirmation phrase exactly. It only ever deletes folders directly inside the archive directory. A mission saved by another account can be deleted with sudo after asking. That question comes before anything is deleted, so declining leaves the mission whole. There is no --yes.

prune

ros2 fairy prune (MISSION... | --older-than DAYS) [--dry-run] [--by NAME]
                 [--yes] [--json] [--debug]

Deletes the recordings' data files (.mcap, .db3, .zstd…) of missions that were exported. Everything else stays: the mission record, README, RO-Crate, harvest, calibrations, and each recording's metadata.yaml. Every command that doesn't need the recordings themselves keeps working.

Option
MISSION... One or more missions: number, ID or archive folder.
--older-than DAYS Every mission saved at least DAYS days ago.
--dry-run, -n Show what would be pruned; change nothing.
--by NAME Your full name, recorded in each mission. Asked when not given; required without a terminal and with --json.
--yes, -y Don't ask before deleting. Implied by --json.

A mission is pruned once it was exported: list --exported shows which, list --not-exported the ones it would skip. The bundle isn't looked for or read, since exported missions are usually uploaded elsewhere and the bundle deleted. Make sure that copy is kept: once pruned, it's the only one. A edit forgets the export, so an edited mission has to be exported again first. Never pruned: a mission never exported, an archive changed by hand (see verify), or recordings saved before 1.0 without checksums.

It lists the missions with the export each was pruned on, says what is skipped and why, asks your name and then to confirm (default no). The files are deleted through sudo, so the system's auth log keeps the command next to your account; an operator without sudo rights can't prune. The mission record is written first (provenance.bags_pruned: when, who, and the export: when, which bundle, its sha256, where it was uploaded), then the files go. If it stops in between, verify says so and pruning the mission again finishes the job.

A pruned mission shows pruned under Size in list; verify passes, noting when, by whom, the bundle it was exported as and where it was uploaded. export and repair refuse it: there's no complete mission left to export, and a bundle without recordings could later pass for a full copy. The recordings' checksums stay in the record, so the uploaded bundle can still be checked against them.

list

ros2 fairy list [--operator NAME] [--location PLACE] [--since YYYY-MM-DD]
                [--until YYYY-MM-DD] [--quality {ok,degraded,poor}]
                [--search WORDS] [--exported | --not-exported]
                [--pruned | --not-pruned] [--uploaded | --not-uploaded]
                [--limit N | --all] [--reverse] [--path] [--json] [--debug]

ros2 fairy list showing five saved missions by Ana, Cleo and Ben, newest last; under Exp, a ✓ on the oldest (exported) and ✓↑ on the next two (exported and uploaded)

Option
--operator, --location Case-insensitive substring match.
--since, --until Local dates (YYYY-MM-DD), both inclusive. A date that doesn't exist, or --since after --until, is refused.
--quality Only missions with this verdict.
--search WORDS Only missions whose goal or notes contain every word, in any order. Case and accents are ignored (citta finds "Città"); quote a phrase to keep it together: --search '"north pier" sonar'.
--exported, --not-exported Only missions exported at least once, or never (what export --all would export).
--pruned, --not-pruned Only missions whose recordings were pruned, or those that still have them.
--uploaded, --not-uploaded Only missions whose export was uploaded (or marked uploaded), or those not. --exported --not-uploaded: exported, waiting to be uploaded.
--limit N Show the latest N (default 20; at least 1).
--all Show every mission.
--reverse, -r The oldest missions instead of the latest, printed newest first, so the oldest is last, right above the prompt. With --json, oldest first.
--path Add the archive folder column.

Columns: date, mission ID, goal, location, operator, duration, size, warnings, data quality, and under Exp a ✓ once the mission has been exported, ✓↑ once that export was also uploaded (or marked uploaded). The newest mission is last (with --reverse, the oldest). Filters combine: every one must match. --json prints {"missions": [...], "total": N, "shown": M}; each mission carries the index columns, notes included, and export: null, or the last export's exported_at, bundle_path, format, sha256, and uploaded_at, uploaded_to and uploaded_how (rclone, or marked for upload --mark-only; all null until it's uploaded).

An export stays marked after the bundle is moved or deleted (sending it somewhere is the point). It is forgotten when the bundle no longer matches the mission, after edit.

diff

ros2 fairy diff [OLDER NEWER] [--json] [--debug]

ros2 fairy diff comparing two north pier surveys: a new goal, the Xsens IMU added, its node and topic in the ROS graph, and the base controller's max_speed lowered from 1.0 to 0.6

With no arguments, compares the two most recent missions (2 and 1). Give both or neither.

It only shows sections that differ: mission context, software (packages, the Python packages of ROS F.A.I.R.y's interpreter and of each container, containers), sensors (added, removed, or with another model, type, topic, frame or calibration), ROS graph, parameters, robot description (URDF), /tf_static, USB and udev, and recordings. tf2's randomly-named internal nodes are ignored. If a mission was saved by a newer ROS F.A.I.R.y, it says what it couldn't compare.

verify

ros2 fairy verify [MISSION] [--json] [--debug]

ros2 fairy verify passing on the newest mission, with a note that the rocrate package would allow full JSON-LD validation

MISSION is a number (1 = newest, the default), a mission ID, an archive folder, or an exported bundle. Read-only. Checks that:

  • mission_record.json loads and validates;
  • ro-crate-metadata.json is valid JSON. It is fully loaded as JSON-LD when the rocrate package is installed; otherwise a warning suggests installing it;
  • README.md and harvest/harvest.json are present;
  • every bag file matches the sha256 recorded at save time (older archives without checksums get a structural check against metadata.yaml);
  • every calibration file matches its sha256;
  • every other file matches checksums.sha256, and none were added;
  • every file the RO-Crate lists exists;
  • the mission is in the index, at this path (not for a bundle);
  • no edit was left half-done. Edits made after saving are listed (how many, the last one's time and account, which fields).

Result: PASS, PASS (with notes) or FAIL. Exit 1 on FAIL. --json prints {"archive": ..., "bundle": true|false, "result": ..., "checks": [...]}.

An exported bundle

ros2 fairy verify ~/Downloads/2026-10-16_07-28-24_lab_ana.tar.zst

A .zip, .tar, .tar.gz or .tar.zst from export is checked without unpacking it. It is recognised by its content, so a renamed bundle works too. It is read once, start to end, with no temporary copy, and checked against:

  • its .sha256 file, if there is one next to it. A mismatch fails: the bundle changed, or wasn't copied completely. The other checks still run and say which files are affected;
  • everything a folder is checked for, except the index: a bundle is a copy, often on another computer. Any account can verify one, also one outside the ros-fairy group.

A bundle cut short, or one whose compressed data is damaged, fails with "can't be read". In a damaged zip only the damaged files are lost; the rest are still checked.

export

ros2 fairy export [MISSION... | --all | --today | --yesterday]
                  [--exclude ID]... [-o PATH]
                  [--format {zip,tar,tar.gz,tar.zst}] [--compress] [--force]
                  [--upload | --upload-to DEST] [--delete-local]
                  [--yes] [--json] [--debug]
Option
MISSION... One or more missions, exported in the order given (one named twice is exported once). If one can't be found, nothing is exported. Default: the newest.
--all Every mission not yet exported successfully.
--today Every mission recorded today.
--yesterday Every mission recorded yesterday (local time).
--exclude, -e ID Skip this mission (repeatable; only with --all/--today/--yesterday).
--output, -o A file name (one mission) or a directory. It must be a directory when exporting more than one mission. Default: the current directory.
--format zip, tar, or a compressed tar: tar.gz or tar.zst. Default: what the -o file name ends in, else zip. A file name that says another format than the bundle would have (-o m.zip --format tar) is refused.
--compress, -z Compress the bundle (see below).
--force Overwrite existing files.
--upload Copy each bundle to cloud storage as soon as it's written, to the destination saved with setup --upload-to. See upload.
--upload-to DEST The same, to this rclone destination.
--delete-local With --upload: delete each local bundle once the uploaded copy is checked. Then a batch export needs room for the largest bundle only.
--yes, -y Don't ask before --all/--today/--yesterday exports. Missions named one by one aren't asked about, unless the disk looks too small. Implied by --json.

Each bundle holds the mission folder under one top-level folder, next to a sha256sum-compatible <bundle>.sha256. It is uncompressed unless asked:

  • --compress with a zip deflates each file that shrinks, so the zip still opens everywhere. Files already compressed are stored as they are: those compressed whole (.mcap.zstd, .db3.zstd, images) and MCAPs with compressed chunks. Each file is judged by compressing a sample of it.
  • --compress with a tar makes a .tar.zst. For a recipient without zstd, name --format tar.gz instead (slower, a little larger).

Bags recorded with rosbag2's defaults aren't compressed, and often shrink by half or more. On five real recordings (5 MB to 2.8 GB: navigation, lidar, point-cloud maps, sqlite3), zstd left 13–65% of the size and deflate 14–67%; zstd ran at 1–2.5 GB/s on all cores, deflate at 45–180 MB/s on one. So a deflated zip of a big mission takes minutes where a .tar.zst takes seconds. To open a .tar.zst: tar --zstd -xf <file> (needs the zstd package).

The bundle is written to a .part file and renamed when complete. Missions that fail verify are exported with a warning. Pruned missions are refused, and left out of --all, --today and --yesterday. The archive is never modified. Exit 1 if any export failed. The recipient can check the bundle as it is, with verify.

With --upload, the destination is checked before anything is exported (rclone installed, the remote known); an upload that fails leaves the bundle where it was written, still exported, and makes the exit 1.

upload

ros2 fairy upload [MISSION... | --all] [--to DEST]
                  [--delete-local | --mark-only] [--yes] [--json] [--debug]

Copies exported bundles to cloud storage with rclone, which supports S3 and S3-compatible storage, Google Drive, OneDrive, Dropbox, Nextcloud and other WebDAV servers, SFTP, and many more. fairy holds no credentials: the storage is an rclone remote (say lab-nas), set up once by the account that exports. One command does it all:

ros2 fairy setup --upload-to lab-nas:fairy/heron
ros2 fairy export --today -o ~/exports/ --upload --delete-local

ros2 fairy export of two missions with --upload --delete-local: each is exported, then uploaded to lab-nas:scout-02, its local bundle deleted after the copy was checked by hash

When rclone isn't installed, setup --upload-to offers to install it (sudo apt install rclone). When it has no remote by that name, it offers to run rclone config, which asks its own questions: choose n (new remote), give the name, pick the storage, then q to come back and save the destination. Run setup without sudo: the remote belongs to the account that runs rclone config. Storage that logs in through a web browser (Google Drive, OneDrive, Dropbox) on a robot without one: answer n to "Use web browser" and follow rclone's instructions, which run rclone authorize on a computer that has a browser. With --yes or no terminal nothing is offered; give the destination with --to on each command instead, if you prefer not to save one.

Option
MISSION... Exported missions to upload: number, ID or archive folder. If one wasn't exported, or its bundle isn't there any more, nothing is uploaded. Default: the newest.
--all Every exported mission not uploaded yet whose bundle is still here.
--to DEST An rclone destination: remote:, remote:folder, or a local folder (a mounted disk). Default: the one saved with setup --upload-to.
--delete-local Delete each local bundle once rclone has compared it with the uploaded copy.
--mark-only Record the missions as uploaded without copying anything (see below).
--yes, -y Don't ask before --all. Implied by --json.

Each bundle goes into the destination with its .sha256 file, under the same name. A bundle is read first and refused if it isn't the one that was exported (its sha256 differs). rclone checks every file it copies: the size, and a hash when the storage keeps one. With --delete-local, rclone check compares the two copies again before the local files are deleted; the output says whether it compared hashes or, for storage that keeps none rclone can use, only sizes.

The upload is recorded with the export (list --json shows uploaded_to), and prune records it in the mission. Exporting the mission again forgets it: the new bundle hasn't been uploaded. doctor checks that rclone is installed and knows the saved destination's remote, for the account that runs it. Exit 1 if any upload failed.

Missions uploaded some other way

ros2 fairy upload 12 11 10 --mark-only --to "onedrive:Missions"
ros2 fairy upload --all --mark-only --to "lab NAS, copied by hand"

--mark-only records exported missions as uploaded without copying or checking anything, for bundles uploaded by hand (for example, before fairy could). --to is then any text saying where; without it, the destination saved with setup --upload-to. The bundle doesn't have to be here any more. A mission never exported is refused: there's no bundle to have uploaded. With --all, every exported mission not uploaded yet is marked, after a confirmation. Marked missions show ✓↑ in list, upload --all leaves them alone, and a later prune records the place, followed by "(marked by hand)".

repair

ros2 fairy repair [MISSION | BAG_DIR] [-o DIR] [--all] [--duration SECONDS]
                  [--force] [--json] [--debug]
Option
MISSION / BAG_DIR A mission (default: newest) or a single bag folder.
--output, -o Where to write. Default: ./<name>_repaired. Must be empty unless --force. A folder where a repaired copy would land on (or inside) its original is refused, even with --force.
--all Re-stamp every recording, not only those with a broken clock.
--duration Playback length in seconds for each repaired recording.

Writes new bags with evenly spaced synthetic timestamps and a regenerated metadata.yaml, so they play without ros2 bag reindex. Message order, types and bytes are unchanged. Originals are never modified. MCAP recordings come out as one .mcap file; sqlite3 recordings keep their .db3 files, splits included. Bags in another storage format, or compressed as whole files (.mcap.zstd, .db3.zstd), are reported as unsupported. A recording too damaged to read to the end (cut off by a power cut, a corrupt .db3) is skipped with a message, and the others are still repaired.

tools/restamp_bag.py <in> <out> [--duration S] does the same for one bag without needing the CLI.

adopt

ros2 fairy adopt BAGDIR [--json] [--debug]

Attaches a rosbag2 folder (metadata.yaml plus a .mcap/.db3 file) to the current mission, where it is. If the watchdog hasn't captured anything yet, it runs a capture now. The bag is copied into the archive at mission_close.

It says which number the recording got in the mission (--json: recording_id); drop with that number takes it out again.

Refuses while the watchdog is busy recording. Adopting the same bag twice is a no-op.

reindex

ros2 fairy reindex [--json] [--debug]

Rebuilds index.db from every archive/*/mission_record.json. Unreadable folders are reported and skipped. If the same mission was saved twice, the most recent save is listed and you are told about the other. Export history is kept.

--json prints {"missions": N, "archive_dir": ..., "skipped": [...], "duplicates": {...}}.

add_operator

ros2 fairy add_operator USER [USER...] [--debug]

Lets more accounts record and save missions, by adding them to the ros-fairy group (which owns the spool, the archive and the index). It asks for your password through sudo when it isn't run as root. Accounts already in the group are left alone.

Membership applies from each account's next login. In a terminal that's already open, newgrp ros-fairy starts a shell that has it.

Exit 1 if the robot isn't set up yet, an account doesn't exist, or usermod failed for one of them; the others are still added.

The verbs that record or save (mission_start, mission_record, mission_close, mission_abort, adopt) check this access before asking anything. An account outside the group is told to ask for ros2 fairy add_operator <its name>; one added after its terminal was opened is told to log in again or run newgrp ros-fairy.

move_data

ros2 fairy move_data DIR [--yes] [--debug]

Moves the data folder (recordings, saved missions, the mission list, the watchdog's state and logs) to DIR, a new or empty folder, e.g. on a bigger disk. It asks first (--yes skips the question), then, through sudo:

  1. stops the watchdog;
  2. on the same disk, renames the folder (instant); on another disk, copies it into a hidden folder next to DIR (inside it, when DIR already exists, e.g. an empty mount point), compares every file's size with the original, moves the copy into place, and only then removes the original;
  3. records DIR in /etc/ros-fairy/paths.yaml (removes the file when DIR is /var/ros-fairy);
  4. rebuilds the mission list (reindex) and starts the watchdog again.

Every shell, and the watchdog, uses the new place at once. If anything fails before step 3, the missions stay where they were (a same-disk rename is undone). The watchdog is started again whatever happens; an original that can't be removed after a copy is only a warning, to remove by hand.

It refuses (exit 1) while a mission is open (save it with mission_close or abandon it with mission_abort first), a save is unfinished, a recording is being processed, ROS_FAIRY_VAR_DIR is set in the shell, or DIR isn't empty, is inside the current folder (or the other way round), or is on a disk without room for the missions plus 1 GiB.