rebind is the command-line companion to the Rebind app: scaffold a package,
validate and lint it offline, run it against your local Rebind with live logs
and hot reload, then pack, install, and publish it. It also streams logs,
manages loaded script instances, records macros, sends diagnostic reports,
controls the installed service, and updates Rebind. For a
walkthrough of one development loop, see Use the CLI.
On Windows, the standard setup installs the CLI and adds it to your PATH; a
custom setup can leave it out. On macOS, the install script installs it to
/usr/local/bin/rebind, which is already on your PATH.
The CLI owns the package on disk. Everything after publish (review status,
private or public, the listing’s channel, withdrawing a version, and sales)
lives on rebind.gg under Account > Listings, and the payout method on your
account page there. See Publishing scripts.
init, check, lint, pack, preview, publish --dry-run, and
observe --schema work fully offline. service talks to the operating
system’s service manager and works while Rebind is down. Every other command
needs Rebind running. whoami, publish, report, and install of a
marketplace listing also need it signed in.
Commands
rebind, rebind --help, and rebind help print this list.
rebind c is rebind check. Optional
[path] arguments default to the current directory and accept a package
directory or a single .lua/.luau file, unless the section says otherwise.
init
rebind init tools/hello creates a package named hello, and
rebind init "My Tool" one named my-tool).
rebind init in a folder that holds a
main.luau you already wrote adds only the manifest around it. A directory
that already holds a rebind.toml is refused.
The new main.luau uses rb, so the manifest declares min_sdk = "3.9.0".
When an existing main.luau does not use rb, the manifest declares
min_sdk = "3.0.0" instead. The scaffolded rebind.toml carries a
commented-out [marketplace] block and, when init wrote main.luau itself,
permissions = [] under [runtime]: add each permission the script comes to
use to that list. Around an existing main.luau permissions stay undeclared, and .gitignore ignores *.rbp. The
scaffold passes rebind check as written.
check
require graph, Luau
compilation of every reachable module, and a permission audit.
name, version, and min_sdk in its modeline. A
package must declare min_sdk under [package]. A require() with a
non-literal argument is a warning, since it cannot be followed; with drm = true
it is an error. A table other than [package], [runtime], and
[marketplace] is a warning, because publishing refuses it. A modeline or
[runtime] key Rebind does not know is a warning too: Rebind ignores the key.
Permission audit
The audit compares what the code uses with the entry’s declared permissions:rb.netcalls neednet. Anet:<host>entry covers the outbound calls andrb.net.ws_connect, but not the listeners orrb.net.local_ip.rb.system.exec,rb.system.exec_detached,rb.env.setandrb.pipe.openneedexec.rb.aicalls needaior a matchingai:<call>entry.require("@rebind/pro")returnsrb, so the audit treats it as a use ofrb.aiand it needsaitoo.rb.clipboard.getneedsclipboard:readandrb.clipboard.setneedsclipboard:write.- The pixel reads (
rb.screen.pixel_hex,search_color,captureandfind_image),rb.screen.elements, the text reads (read,find_textandwait_text),rb.ai.findandrb.ai.readneedscreenorscreen:target.rb.ai.decideis not audited for it, since it looks only when asked, and neither are calls made throughrequire("@rebind/pro"). rb.observecalls needobserve, even in a script that declares no permissions, andmin_sdk3.15.0 or later. Any use ofrbunder amin_sdkolder than 3.9.0 fails, since older Rebind has norb.rb.aiandrequire("@rebind/pro")need 3.10.0. Scoped entries such asnet:poe.ninjaneedmin_sdk3.8.0 or later.
observe, so
the comparison has nothing else to contradict. A package with a [marketplace]
block is held to more: it must declare its permissions (permissions = [] when
it needs none), and give a reason for exec, net, screen or
screen:target, and observe in permission_reasons. check fails it here rather than at upload:
local n = rb.net; n.get()).
Listing checks
With a[marketplace] block, check also validates the listing: categories,
prices, the shape and caps of everything the block declares, and for
drm = true, no non-literal require, no runtime data files, and the sealed
size cap.
What must merely be present (a summary, a screenshot) is publish’s concern.
The rules and limits live in
Package format.
channel key takes a channel slug, or false, and cannot be combined
with private = true:
Installed and extracted packages
Archives keep the manifest but omit its declared listing media. For an installed or extracted package directory, allow the missing files explicitly:run keeps the option during hot reload. Without it, missing declared media is
an error, so author checks catch missing assets. publish always requires the
declared media files and has no such option.
lint
require graph, with the Rebind standard
library preloaded so rb and the rest of the SDK resolve. Warnings never block
anything; error-severity findings (definite bugs, such as a misspelled global,
a misspelled rb name like rb.hid.prss, or an event name rb.on does not
have) exit with status 1 and block publish. rb is not checked in a module
that binds its own rb.
run
--all-logs streams every Rebind log line,
prefixed with its source.
Edits to .lua, .luau, and .toml files and anything under assets/
trigger a reload. A failing check keeps the previous run alive. If the package
entry changes, restart rebind run. Reload uses the
restart lifecycle, so a failure after the old runtime stops does not
restore it, and run exits with status 1. A .rbp file cannot be run; pass a
package directory or a script.
rebind run scripts/wiggle.luau runs a single script from a package’s
scripts/ directory. It inherits the package’s min_sdk, and its requires
resolve from the package root.
The command owns the instance it started. If something else stops or restarts
it, the kill switch fires, or Rebind restarts, the watcher prints “Script
ownership changed; the development watcher has stopped.” and exits with status
0 instead of starting the script again. A Rebind too old to report ownership
is refused before anything starts.
Ctrl+C stops the instance and exits. Force-killing the CLI can leave the
script loaded; use ps and script stop to find and stop it.
Use logs to watch output without starting a script.
exec and repl
exec
prints what the chunk printed, then its return values separated by tabs.
rebind exec - reads the chunk from stdin. A Luau error exits with status 1.
A chunk that runs the runtime out of Luau heap resets it, and every global,
timer and task it held is gone.
rebind repl is the interactive version: same runtime, TAB completion queried
live from the runtime (your own variables complete, not only SDK names), and
unfinished chunks continue on the next line. Ctrl+D exits.
pack
check, then builds the .rbp registry artifact. What goes in and what
stays out is in Package format.
.rebind-market install marker.
For omitted listing media, see
Installed and extracted packages.
install
<SPEC> is a .rbp file or a
marketplace listing as @handle/name.
A .rbp file lands in a new folder at the top of the scripts folder, named
after the package in the archive’s rebind.toml, with -2, -3 added when
the name is taken. Only a package an earlier version put in
packages/<name>/ is replaced there. A listing gets a folder at the top the
same way the app installs it, so the same rules apply: paid listings need a signed-in account
that owns them, Pro listings need Pro, and
protected scripts have their own
requirements. A private listing is not reachable this way; install it from the
link its author shares. Neither is a channel listing;
members install it from the app.
install first prints what the package asks for, under “It asks for:”, and
installs only with --allow. For a listing, --allow approves exactly the
printed list. If the downloaded version asks for more than its listing showed,
nothing installs and the CLI tells you to install it from the app instead.
--force replaces an existing install of the same listing, or of a package
an earlier version put in packages/. A .rbp installed again otherwise
gets a new folder.
preview
MARKETPLACE.md, or README.md when
there is none, as publish sends it. No sign-in and no running
Rebind are needed. The page lists what publish would flag, such as a missing
summary or an image in the overview. It is not the store UI; run
rebind check for complete validation.
--json prints the listing data instead, with local media embedded.
publish
- a package (
rebind.toml); a bare script has no listing to publish; - a signed-in account with a claimed
@handle(publishing requirements); - a
[marketplace]section withsummaryandcategory; - at least one
.pnginmedia; the first PNG becomes the cover.
drm = true, publish bundles the require graph into one file (it
prints bundled N module(s) into one sealed script) and uploads no .rbp;
see DRM packages. The package’s
MARKETPLACE.md, or its README.md when there is none, is sent as the
listing’s overview, and publish names the file it used. MARKETPLACE.md
needs Rebind 3.21.1 or later; see Overview.
When that file is missing or empty, the product page falls back to summary,
and publish says so.
A successful publish ends with a line naming the listing and version as
submitted for review, and the channel when rebind.toml names one. A version
published into your own active channel can go live at once, and the line then
says published instead of submitted for review;
Place a listing in a channel
lists the cases that still wait for review. A channel key places the listing
when the version is submitted, not when it is approved. The server refuses a
slug that is not one of your active channels.
Publishing scripts covers what happens next.
--dry-run does everything up to the upload locally, then prints the proposed
listing, terms, and artifact size as JSON. It does not sign in, upload, or
submit. The account handle, server version conflicts, the review decision,
and whether a named channel is yours remain unchecked, and the JSON lists them
under unchecked.
ps
--watch redraws as status arrives and needs a terminal. --json prints one
full status object, including its scripts array. Together they print
newline-delimited JSON: one status object per line, starting with the current
snapshot. Updates may be coalesced, so this is a status feed, not a log of
every lifecycle event. When no status arrives for 3 seconds, a stale-status
warning goes to stderr. Ctrl+C or a closed output pipe exits with status 0.
The heap is that runtime’s Luau allocation, not process memory. Tick duration is
an average in microseconds, not a CPU percentage. A missing metric means
unknown, not zero.
script
start <PATH> needs a file in Rebind’s installed scripts folder; use
run for a development file outside it.
stop, restart, and inspect take a selector: the exact runtime ID, an exact
path reported as the instance’s file or source path, or an exact display name.
An ID wins. Prefixes do not match. If more than one instance matches, the
command fails and lists the IDs to choose from. logs --script uses the same
rules.
stopstops the instance without changing its autostart setting.restartstarts a new runtime for the instance. A script loaded from disk is read again and passes the current authorization checks, including those for protected scripts. A script started from source replays the source it was started with, when Rebind kept it. Restart is not transactional: once the old runtime has stopped, a failure to load the replacement leaves an error state.inspectprints the instance row, then its launch origin, incarnation (one runtime lifetime; a restart creates a new one), timer and coroutine counts, retry attempts, and any error or reason restart is unavailable. The row goes to stdout and the details to stderr.--jsonprints the instance object to stdout; use it to capture everything.dataprints the data folder of a script, package, or marketplace listing, loaded or not.<PATH>is a file or folder here, or a path in the scripts folder. The folder appears when the script first uses an@datapath.--jsonprints{"dir", "exists"}.
logs
--level, every level appears; debug also includes trace lines.
--script resolves an instance with the selector rules and keeps
only lines attributed to it. It filters by attribution, not by searching
the text, and an instance without attributed logs is refused.
There is no history: only new lines appear. If Rebind cannot be reached at
startup, the command prints where the earlier log files are. Once connected,
the stream pauses across a Rebind restart and resumes by itself; lines
emitted in between are lost. Ctrl+C stops the stream.
macro record
(0, 0), and checks
both before it accepts the start button. Release any held mouse buttons during
setup. The first run saves the window’s current bounds for that title; later
runs reuse them. --bounds 60,80,1000,700 sets them explicitly. If the window
moves or resizes while waiting, setup runs again.
By default the first new press of the start button starts the take and is
included in it. With --start-on-focus, recording starts as soon as setup
succeeds, including the movement from (0, 0) to your first point. The stop
key finishes the take; its press and release are left out. Pressing it before
recording starts cancels.
Choose a stop key other than the app’s macro recorder hotkey; the command
refuses that key. If the recorder is busy, the helper fails instead of taking
it over.
The command first prints {"state":"created","helper":...}. The helper then
runs as with run, so its check and log lines follow, and its progress
arrives as log lines whose message is a JSON object with state:
waiting_window, waiting_release, positioning, waiting_input,
recording, saving, captured, cancelled, or failed. A saved take ends
with {"state":"completed","path":...}, the saved macro’s path. A failed or
cancelled take ends with Recording ended without a saved take. on stderr and
status 1. If saving fails, it prints where the take was kept. Ctrl+C stops
the helper and discards the take.
observe
-- OBSERVING -- 1:02 8.9 MB keys logged F8 to stop, and
also shows how much the session has written so far; Rebind 3.21.0 to 3.22.4
show it at the top of the display. From 3.22.5 the Rebind icon in the menu bar
(macOS) or tray (Windows) also changes while any session records: a dot beside
the mark on macOS, a red mark on Windows.
The strip is left out of the session’s screenshots. A game in exclusive
full-screen mode on Windows hides it.
In hardware mode, game controller buttons are recorded as down and up with
names such as PadA, and stick and trigger movement as axis lines.
The command prints the session folder as a JSON line when it starts and again
when the session ends. Both lines have state (recording, then
completed), id, dir, file, seconds, elapsed_ms, events, outputs
(Rebind 3.23.0), frames, crops, marks, drops,
bytes, owner (cli), goal, frames_off and reason. The completed
line holds the final counts. --goal is trimmed, and one over 500 characters
is refused.
The session ends at --seconds, at the stop key, on Ctrl+C, when Rebind
quits, or when the command stops running (Rebind ends a session its command no
longer renews within 5 seconds). reason is time_limit, stop_key,
stopped, relay_stopped, client_gone or size_limit (512 MB of log and
images). A session a script started with
rb.observe also ends with
script_stopped when the script stops, reloads or errors. The stop key is a
key name in any case; an unknown name, a mouse button or the macro recorder
hotkey is refused. It is not logged and still reaches the app in front.
Everything is recorded by name, passwords included, and screenshots show
whatever is on screen. Do not type secrets while a session runs.
Session folder (format 3)
Every session, whoever started it (this command, the app, or a script), is written in the same format, version 3 from Rebind 3.23.0. Format 3 addsout
and elements lines, the elements/ folder and the outputs count to
format 2 (Rebind 3.22.5), which added patch files to format 1. Older sessions
read the same way. rebind observe --schema prints it as
a JSON Schema (draft 2020-12) covering metadata.json and every line kind.
Sessions live in the observations folder of the Rebind data folder
(%APPDATA%\Rebind\observations on Windows,
~/Library/Application Support/Rebind/observations on macOS) and stay until
you delete them.
- The folder name is the session id: when it started, plus four hex digits. It
never changes; a name you give the session is stored in
metadata.json. images/holds PNG files named<t>-frame.png(the display),<t>-window.png(the active window, from the same capture job, unless the display screenshot already holds it at the same scale) and<t>-crop-<seq>.png(the mouse button press or release whosedown,uporoutline has thatseq). From format 3 the window image is at the display’s own resolution, not scaled toframe_edge, on a screenshot whosecauseisclick,release,key,inputorsettle, so its text and colors can be read later.<t>is when its pixels were grabbed, in milliseconds since the session started, padded to 9 digits, sols imageslists them in time order. A second capture in the same millisecond adds-2,-3and so on before.png.- Frames, windows and crops are 8-bit RGB. A display screenshot taken within
10 seconds of the last full one is stored as a patch,
<t>-patch-<base>.png: an 8-bit RGBA image the size of the screenshot that holds only the pixels that changed since the screenshot at<base>(a frame or another patch), every other pixel transparent. From format 3 a patch is written only when it is the smaller file; a screenshot that changed nearly everywhere is stored whole. Nothing is lost:rb.observe.frame, the MCPobserve_frametool and the app return a patch as the full screenshot it stands for. Opened on its own, a patch shows only what changed. A full screenshot comes at least every 10 seconds, and after a change of display size. elements/<t>.json(format 3) holds the controls of the front window when the screenshot at<t>was taken:status(null for a whole list, ortruncated) andelements, each withname,role,id,x,y,widthandheightin screen coordinates. One is written only when the controls changed since the last one. Windows and macOS only; games and many web apps name few controls or none.- A
text/folder appears oncerb.observe.readhas read an image: it keeps the words it recognized, so the next read of the same image does not recognize them again. No line names its files. - Image and element fields in the log are paths relative to the session folder.
metadata.jsonexists from the moment the session starts and is replaced whole, never written in place.events.jsonlis only appended to, one JSON object per line, each ending with a newline. A reader skips an unfinished last line and reads it later.- An image is complete on disk before any line names it.
- A session that ended has an
endline last. One without it is still recording, or was cut off when Rebind or the computer stopped. - When a write to
events.jsonlfails, the session ends with areasonthat starts withwrite failed, and its last line may be cut short.
metadata.json
When the session ends, it also gets
ended_at (epoch ms), reason, events
(the user’s input lines), outputs (out lines, format 3), frames,
crops, marks, drops, dropped_marks and bytes (log and images). A session cut off by a crash keeps the start fields only; its counts
are in the log.
events.jsonl
Every line starts withseq, t and kind, in that order. seq counts up
by one from 0, and t is milliseconds since the session started and never
goes back. The first line is start.
out lines keep what Rebind sends apart from what you do: down, up,
move, scroll and the events count hold your input alone. An out line
takes screenshots, crops, px and px_after as your input of the same kind
does, and a crop or frame line then points at its seq. Rebind’s own
press of the stop key ends nothing. A script’s release of every key or button
is an up line for each one Rebind held. Joypad output is not logged. With a
Rebind Link every move is relative, so there are move lines and no
move_to, and a click’s crop is taken where the pointer is 30 ms after the
move.
cursor is in screen coordinates and wcursor is relative to the active
window. drops counts inputs the session could not keep up with, and
dropped_marks marks that could not be queued for the running session.
Screenshots follow what you do, not a clock. A frame line’s cause says why
it was taken:
A burst is a run of key and button presses, scrolls, stick or trigger
movement, and pointer travel. Releases extend a burst but never start one. A
burst ends 400 ms after the last of them and takes a
settle frame; a release
with no burst open gets one too. settle, window and timer screenshots
come at least 250 ms after the one before. The first active window takes no
window frame; the start frame shows it.
A frame line is written when its capture finishes. Its t is the larger of
its shot_t and the previous line’s t, and shot_t is when its pixels
were grabbed (the <t> in its file name): when the capture started, or, for
an action that waited behind another capture, when the action arrived. Its crop and px_after lines take t
the same way. Inputs made during the capture come before it in the file. Join on
fields, not on line order:
preon adownorupline, or on anoutline with thatop, names the latest screenshot written before that input. It is absent before the first one and when there are no screenshots.inputon aframeline is theseqof the mouse button press or release, action key or burst’s first input it was taken for. It is absent forstart,settle,windowandtimerframes, and when mouse movement started the burst.- The first
settleframe whoseshot_tis after an input’stshows what that input led to.
cursor and
window rectangle of that moment; the controls are looked up then too when no
lookup is already running. Their shot_t, and the <t> in their
file names, is when that grab was asked for, so it can be earlier than the
moment the capture before it finished; ms is still how long the capture
took once its turn came. A later click, release or action key that joins the
same waiting frame replaces the grab with one taken then. When a session ends, however it ends, a click, release or action key that is
still waiting for its screenshot is shot before the end line is written. A
screenshot being taken at the end gets 2 seconds to land, and the waiting
action’s then gets 2 seconds of its own, so a stop answers within about 4
seconds at worst. Past that, a missing line names what was lost: the file,
cause and input of the screenshot that did not land, and for an action
that never got its turn, its cause, input and crops, with the reason
session ended before the capture could start. Any other frame that is
waiting when the session ends (input, settle, window, timer, or a
start not yet taken) is dropped with no line, so stop a session a second
after the last action when its px_after matters.
Mouse button presses and releases made while a screenshot waits to be taken
share it, up to 8, so a quick click’s press and release can share one click
frame. Every mouse button release has a screenshot from after it; keyboard
keys and controller buttons take no frame on release. Each press and release a
frame answers gets its own crop line: region is the 160 by 160 square
around the pointer in screen coordinates, cut from the display under the
pointer, which can be another display than the frame’s, and px is the hex
color (rrggbb) under the pointer. A drag has a crop where it started and one
where it ended. When the burst settles, a px_after line gives the color
under each of its presses (up to 8) in the settle frame. Releases have no
px_after, and presses other than clicks have no color.
Two fields are named scale and measure different things. On a start
line’s displays and on a display line, scale is the operating system’s
scale factor for that display (1.5 at 150%).
On a frame line’s display and on a crop line, scale is image pixels per
screen unit. Rebind uses physical pixels as screen units on Windows, so that
one is 1 there whatever the scale setting; on a Mac with a Retina display both
are 2.
An image whose pixels equal one of the last four of its kind (display,
window or click crop) writes no file. Its line has dup set to true
(win_dup for the window), and file or win names the earlier file that
holds those pixels. frames and crops count the files written.
dev names the device only in hardware mode. In software mode the operating
system does not say which device sent an input, so dev is absent and
devices is empty. On macOS, screenshots need Screen capture on in Settings
and the Screen Recording permission. Without them the session still records
input and windows, and frames_off says why there are no screenshots.
Reading a session with jq
Run these in a session folder. The first four read a finished session. While one records, read each line withjq -cR 'fromjson? | ...', as the last two
do, so an unfinished last line is skipped instead of stopping jq.
report
service
status reports whether Rebind’s ports answer, and the service manager’s view
of the service. It exits with status 1 when the ports do not answer.
start, stop, and restart act only on the installed service. They refuse
when an environment variable points the CLI at another copy of Rebind, and
name the variable; unset it first. They also refuse when Rebind’s
ports are taken by a copy the service manager does not hold, so stop that copy
where it runs. Nothing is changed when a command refuses.
stop does not turn off starting at login or boot. On macOS, Rebind starts
again at your next login. rebind service start
brings it back sooner. An install set to
start on demand
stays stopped until rebind service start, or until you open the app.
update
- On macOS, the password prompt opens on the Mac’s screen. Until someone at the Mac answers it, nothing is installed.
- On Windows, Rebind downloads the installer first, which can take a few minutes. If the installer fails, its error box opens on that PC’s screen.
whoami
- your
@handleand email; tier:free,pro, ordeveloper;mcid: the Rebind Link connected now, as the short ID the app shows, marked(attached)or(not on this account). With none connected, it lists the Links registered to the account as(not attached), or(none paired);transport:hardwarewhen your Rebind Link drives output,softwareotherwise.
ui
--url defaults to http://127.0.0.1:19480.