Skip to content

CLI guide: the reyin command

The binary is named reyin (crate reyin-cli). It is a scriptable tool for discovery, printing, jobs, settings and a foreground IPP server. This guide reflects the implemented WP63 slice 1; the commands below are what actually exists.

--json machine output (one JSON document per command)
--data-dir DIR manager data directory
--sim use the built-in simulator provider
-h, --help help
-V, --version version

The simulator provider is the only zero-hardware provider; without —sim, discovery uses the enabled transports (USB, Bluetooth, TCP) and may find nothing on a host with no printers.

reyin discover [--timeout DURATION]

Lists discovered printers. —timeout accepts a duration such as 10s.

reyin status [PRINTER]

Shows status for one printer, or all printers when no printer id is given.

reyin print FILES... [--printer ID] [--copies N] [--media 4x6]
[--darkness PCT] [--speed IPS] [--wait] [--timeout DURATION]

Print one or more documents. —media WIDTHxLENGTH inches is required when the input has no intrinsic media. —raw sends printer commands: the driver checks them against an allow-list of print-content commands and refuses the whole file, with the error “raw payload refused: at byte ”, when anything is not on it (copies, stored formats and files, settings, network and status requests are not). —wait blocks until the job completes or pauses. When more than one printer matches and no —printer is given, the command exits 2 instead of choosing the first device. Deferred options include label-mode, dither, scaling and CSV data merge.

reyin jobs [--printer ID] [--all]
reyin job show JOB_ID
reyin job cancel JOB_ID
reyin job resume JOB_ID
reyin job hold JOB_ID
reyin job release JOB_ID

jobs lists non-terminal jobs by default; —all includes completed/cancelled jobs.

reyin settings PRINTER [--darkness PCT] [--speed IPS] [--tear-offset DOTS]

With no setter flags it prints the current settings; with flags it applies them. Tracking mode (gap/mark/continuous) is deferred.

reyin calibrate PRINTER
reyin identify PRINTER

calibrate measures and sets the tear offset; identify makes the device flash/beep where the driver supports it.

reyin serve [--bind ADDR]

Runs a foreground IPP server using the current manager. —hub is deferred.

reyin automation pause | resume | status
reyin hooks status
reyin hooks check-secret NAME
reyin hooks deliveries NAME [--topic T] [--state S] [--limit N] [--cursor C]
reyin hooks purge [NAME] [--before UNIX] [--yes]
reyin hooks poll NAME TOPIC
reyin hooks quarantine NAME
reyin hooks release NAME
reyin hooks connections [NAME]

These talk to reyind over its control socket (--data-dir picks the daemon) and need [automation] enabled = true there. They create nothing in the data directory.

pause and quarantine stop things and ask nothing. resume and release start things again, so they are meant for a person: run them at a terminal and type the word they ask for (RESUME, RELEASE NAME). They have no --yes; in a pipe, a cron job or a script that has no terminal they refuse (exit 1). The check is a guard against unattended use, not authentication: a program that opens a pseudo-terminal (for example script) can answer the prompt, as with reyin batch run. purge tells you how many pending deliveries will be dropped and will not print, and asks you to type PURGE NAME (or PURGE ALL); a script passes --yes. Add --idempotency-key KEY to retry a change safely: the same key acts once (a change that ends with an unknown outcome prints its key). hooks deliveries shows when, what and how big, never the body or the headers. Exit 5 with the daemon down, 2 for an unknown connection, 1 when automation is not enabled or the typed answer was wrong.

reyin flow list | get ID | validate FILE | put FILE | export ID [-o FILE] | history ID
reyin flow import FILE --bind connection:ALIAS=NAME --bind printer:ALIAS=ID --bind template:ALIAS=ID
reyin flow approve ID --bind ...
reyin flow enable ID | disable ID | delete ID
reyin flow run ID [--dry | --live] [--payload FILE]
reyin flow status RUN [--since-seq N] | cancel RUN
reyin flow confirm-run RUN | resolve RUN retry|skip

These talk to reyind like automation and hooks and create nothing in the data directory. Flow and payload files are read here (at most 32 KiB and 16 KiB; a larger file is refused before anything is sent) and sent inline.

import only holds the flow and says so: nothing is stored and nothing runs until approve; enable is a separate step and refuses a flow that was never approved. A put of anything that is not the same document as the approved stored revision (apart from its revision number and notes) is held, and the approved revision keeps running until you approve the new one: the output says it is not active and names approve. approve shows what the held flow can do with your bindings applied (what starts it, the printers, templates and connections, the order fields that leave the machine, the copies and notify texts, any renamed connection, the steps in order, and then the whole document) and asks you to type the flow id; only then is it approved, and only that document. If the flow changed while you read, nothing is approved. confirm-run (a run over a print cap) and resolve (an interrupted run; retry can print a label twice) ask you to type the run id. None of these has a --yes, and in a pipe or script without a terminal on input, output and error they refuse (exit 1). delete asks for the flow id, or takes --yes. A flow you imported before approval was recorded is disabled by the upgrade: export it, raise its revision by one, import it and approve it. The daemon’s token is still the boundary: a program that holds it can approve through a pseudo-terminal or a direct call. run is a dry run unless you add --live. history shows states and times, not what an order contained. See flows for the first-run guide.

render, qr, profile, template, daemon and sim are documented in the spec (docs/crates/reyin-cli.md) but are not implemented in this slice. Do not rely on them yet.

—json prints one JSON object per command result. Errors are a JSON object with error.code and error.message. Streaming commands emit JSON Lines where relevant.

0 success
1 usage error
2 printer/job not found or ambiguous selection
3 job failed or cancelled while waiting
4 job paused (for example media empty) while waiting
5 transport or permission error
6 QR does not fit or verification failed
10 internal error
reyin --sim discover --json
reyin --sim status --json
reyin --sim print --wait --media 4x6 tests/fixtures/inputs/gradient_400x300.png
reyin --sim jobs --all
reyin --sim serve --bind 127.0.0.1:8631

See docs/crates/reyin-cli.md for the spec, open risks and the deferred option list.


Source: docs/guides/cli.md at fe2ada6890.