Rebind

Developer platform

HTTP request in. Hardware mouse movement out.

A Luau runtime with 26 SDK namespaces and hardware-isolated HID output. Drive a real keyboard and mouse from HTTP, TypeScript, Python, or Rust, on Windows, macOS, and Linux.

Any program can drive physical input.

Start an HTTP server inside a script. Anything that can make a request — a web app, a Python process, an AI model — moves the mouse and presses keys. Permission-gated by the modeline.

-- rebind: min_sdk=3.0.0
-- rebind: name=HTTP Bridge
-- rebind: permission=net

Net.Listen(8080, function(req)
  local cmd = JSON.Parse(req.body)
  HID.Move(cmd.dx, cmd.dy)
  if cmd.click then HID.Press("Mouse1", 20) end
  return { status = 200, body = "ok" }
end)

Twenty-six namespaces. A real runtime, not a macro recorder.

NamespaceWhat it does
HIDKeyboard and mouse output — Down, Up, Press, Type, relative Move, Scroll, MoveTo
InputLive state — IsDown, GetDuration, GetActiveKeys, GetModifiers, GetMousePos
MacroRecord, Play, Finish, StopAll — record and replay with hardware-accurate timing
ScreenGetPixelColor(x, y) — sample any coordinate; SearchForColor — region scan
WindowFind, move, resize, focus, set transparency, and kill windows — 17 methods
NetHTTP and WebSocket, client and server — Listen, WSListen, WSConnect, all HTTP verbs
AudioPlay, Beep, SetMasterVolume — WAV, MP3, OGG, and FLAC playback
ClipboardSet and Get clipboard contents
FileSandboxed I/O — ReadJSON, WriteJSON, Append, Exists, MkDir, Copy
HashMD5, SHA1, SHA256, SHA512, CRC32, HMAC
CodecBase64, Hex — encode and decode
RegexIsMatch, Find, FindAll, Replace, ReplaceAll, Split
PipeShared-memory IPC — Open(name).Read() for a Python or Node sidecar
DialogMessage, Confirm, OpenFile, SaveFile, OpenDir
TimerAfter and Every — schedule and repeat callbacks
MathRandom, Gaussian, Scale, Spline, Resample, Interpolate
UIDeclarative config panels — Schema, Toggle, Slider, Keybind, Select, Notify
SystemTime, Mouse, Screen, Window, Exec — environment and shell
EnvRead environment variables; OS known-folder paths
RegistryWindows registry read and write (Windows only)
ConfigReadTOML and WriteTOML for persistent settings
BindDeclarative key binding — Bind(key, fn), Bind.Remap(from, to), Bind.Toggle
ScriptExit, Reload — script self-management
LogStructured logging from inside scripts
ProcessExists, List, Kill — OS process management
JSONParse and Stringify

Hooks, modelines, and concurrency.

Scripts respond to lifecycle and input hooks: OnStart(), OnStop(), OnFocus(window), OnBlur(window), OnTick(delta), OnDown(key), OnUp(key, duration), OnMove(dx, dy), OnScroll(delta), OnScrollH(delta).

Return false from a hook to swallow the event — the PC never sees it. Return true to pass through. Mouse-movement suppression requires hardware mode (mouse_block=true modeline).

Modelines declare script metadata: -- rebind: name=My Script, -- rebind: process=Photoshop.exe, -- rebind: window=Figma, -- rebind: tick_rate=8000, -- rebind: z_index=100, -- rebind: permission=net.

Concurrency is built in. Run(fn) launches a coroutine. Sleep(ms) pauses it. After(ms, fn) schedules a one-shot. Async(fn) wraps a Bind callback so it can Sleep. Task handles expose :Cancel(), :IsRunning(), and :Wait(). HID.Press and HID.Type run inside Run() or Async().

Drive Rebind from TypeScript.

A JSON-RPC WebSocket served at ws://127.0.0.1:19561. RPC p50 ~1 ms, p99 ~2 ms, ~10,000 req/s sustained.

// npm install @rebind.gg/client-ts
import { RebindRemote } from "@rebind.gg/client-ts";

const r = new RebindRemote("ws://127.0.0.1:19561");
await r.connect();

r.hidMove(30, -5);
r.hidPress("Mouse1", 20);
r.hidType("hello");

const { x, y } = await r.systemMouse();
const px = await r.screenPixel(x, y);
r.close();

Or Python.

# pip install git+https://github.com/usinput/rebind-client-py.git
from rebind import RebindRemote

with RebindRemote("ws://127.0.0.1:19561") as r:
    r.hid_move(30, -5)
    r.hid_press("Mouse1", hold_ms=20)
    r.hid_type("hello")
    x, y = r.system_mouse()
    px = r.screen_pixel(x, y)

Or Rust.

use rebind_client::RebindClient;

let client = RebindClient::connect("ws://127.0.0.1:19561").await?;
client.hid_move(30, -5);
client.hid_press("Mouse1", 20);

Published, typed clients

  • TypeScriptnpm install @rebind.gg/client-ts
  • Pythonpip install git+https://github.com/usinput/rebind-client-py.git
  • Rustcargo add rebind-client

What developers build

  • Home and desk automation — bridge physical input to your smart-home or scripts over HTTP.
  • AI-vision sidecars — a local model decides; the script moves real hardware via shared-memory Pipe IPC.
  • Robotics and control rigs — deterministic, scriptable HID output from a dedicated device.
  • Automated testing — drive physical HID from your test suite for hardware-in-the-loop QA.

Run your first script in five minutes.