eguidev is an automation library for egui apps. It is like Playwright, but it runs inside your app process and reads real widget state instead of screen pixels. You tag each widget with a string id. Luau scripts then use that id to inspect the widget, click, type, wait, and take screenshots. Each action runs in step with the event loop of the app.
Write these scripts as a checked-in smoketest suite, or run one script at a time during development. You can also give the same surface to an AI agent through MCP.
Join the Discord server for discussion and release updates.
A script refers to each widget by the id you gave it. Each action waits until the widget is ready for input, and then settles the UI before it returns. Scripts therefore need no sleeps. This example is part of a checked-in smoketest for the demo app:
eguidev.fixture("basic.empty")
eguidev.widget("basic.name"):type_text("Luau", { clear = true })
eguidev.widget("basic.enabled"):set_value(true)
eguidev.widget("basic.intensity"):set_value(73.25)
eguidev.widget("basic.submit"):click()
local status = eguidev.widget("basic.status")
:expect({ value_text_contains = "Saved Luau" })
assert(status ~= nil, "submit should update status")Scripts are strict Luau. eguidev checks each script before it runs. The sandbox
has no filesystem or network access and can import only the named modules that
the caller supplies. eguidev adds one global, eguidev. You can run the same
script in three ways:
edev eval script.luauruns one script and prints its structured result.edev smokeruns your full suite against one live app.script_evalover MCP lets an agent drive the app with its own scripts.
- Widget state -- the role, label, value, geometry, and hierarchy of each tagged widget, captured at every frame boundary.
- Real input -- clicks, typing, drags along a path, and scrolls, injected into the event loop of the app.
- Waits -- typed conditions and predicates over live state, plus
settle()for queued work. A bad wait is the main cause of flaky UI automation, so eguidev supplies one shared condition model. - Assertions --
Widget:expect(...)checks state, relative geometry, hierarchy, text fit, and painter output. eguidev records each call. - Screenshots and pixels -- capture one viewport or one widget. Sample exact pixels when a visual claim needs proof.
- Tree dumps -- canonical widget-tree text for one viewport, also available
from the CLI as
edev dump. - Layout diagnostics -- overlap and clipping defects, text measurement, and the identity warnings of egui.
- Frame timings -- the pass time and interval of each captured frame, so a suite can hold a UI budget.
- Fixtures -- named states that your app registers. Each script starts from
a declared baseline.
edev fixtureslists them, andedev fixture NAMElaunches the app into one and stays up for manual work.
edev smoke runs a directory of independent .luau scripts against one managed
app process. These scripts are regression tests, and they are also executable
documentation of your UI:
$ edev smoke
[PASS] 10_basic_form.luau (412ms)
[PASS] 20_menu_and_scroll.luau (508ms)
[FAIL] 30_input_and_events.luau (1203ms): Widget(basic.status) expectation failedEach script sets its own start state with a fixture, and asserts visible
behavior instead of app internals. No script depends on another script.
edev smoke ignores return values: assertions decide pass or fail, and
eguidev.log(...) adds evidence to the result.
Set [smoke] module_dir when smoke and eval scripts share checked Luau source.
Every .luau file below that directory becomes a named module. Its path below
the directory is the require name, with or without the .luau suffix. Both
commands use the same setting, so a script can run alone through edev eval:
[smoke]
suite_dir = "smoketest/specs"
module_dir = "smoketest/modules"local layout = require("layout")
layout.assert_strict("project sheet")Edev checks the root and all reachable modules before execution. Type errors and runtime backtraces name the module file. Failure bundles retain the root script and the complete module tree used for the failed evaluation.
Use these flags while you write a suite:
--list [--json]shows the selected scripts and does not launch the app.--only GLOBnarrows the run.--fail-faststops at the first failure.--module-dir DIRoverrides the shared Luau module directory.--repeat Nand--until-fail Nfind intermittent failures across rounds.--bundlewrites a failure bundle for each failure. A bundle holds the tree dump, diagnostics, screenshots, and script logs. The app output of the run sits once beside the bundles, and a run removes the bundles of the run before it.
Each script result includes the egui id_clash and rect_changed_id warnings
that no script dismissed. edev smoke fails on these warnings by default, so an
intermittent identity bug cannot pass unnoticed. To keep the warnings without a
failure, set [smoke] fail_on_egui_diagnostics = false. A script that causes a
warning on purpose can consume it with Viewport:egui_diagnostics().
egui paints these warnings only when Options::warn_on_id_clash is on, and it
defaults to the debug build. Eguidev turns the option on with the automation
plugin, so a release build reports the warnings too. Each batch carries
warnings_enabled, so a script can tell a viewport with no warning from a
viewport that paints none.
egui warns about an ID of its own only for a widget that takes input. A widget
can share an ID without taking input. Two combo boxes of one Ui that salt
their IDs with one label take one ID, and with it one open list. Neither list
then appears. layout_issues() reports such a pair as a shared_id issue. It
compares the egui IDs of the instrumented widgets directly, so it holds in
every build and needs no painted warning.
edev exits with 0 when a command succeeds. Each failure has its own exit
code, so that a caller can tell a failed script from a failed run:
- 1: a smoke suite, a script evaluation, or a fixture failed.
- 2: the arguments or the
.edev.tomlfile are invalid. - 3: the run failed outside the scripts. The app did not start, or its shutdown was forced, or MCP, I/O, the instance registry, or the recording failed.
edev record OUT.mov runs the same suite and records the app window. This
command works only on macOS. It uses ScreenCaptureKit directly, not an external
recorder program, and writes H.264 video at the native pixel resolution of the
window. The process that runs edev must have Screen Recording permission. The
title of the root viewport selects the window. Use --window-title to select a
different window.
Synthetic input does not move the pointer of the system, so a recording paints
a cursor into the app: the pointer of the script, a ripple at each press, and
the name of each action. Screenshots and pixel samples leave the cursor out, so
a suite passes or fails as it does under edev smoke. Use --no-cursor to
leave it out of a recording. --pace-ms N glides the cursor to each target for
N milliseconds before the action, for a video that people watch at normal
speed. Set the defaults in the [record] table of .edev.toml. A script can
also turn the cursor on with eguidev.configure({ cursor = true }).
edev gallery captures the screens of an app and publishes a static gallery: a
page of screenshots, grouped and captioned, that a reviewer opens in a browser.
A reviewer can thus check a UI change without running the app.
The gallery uses the same fixtures as the smoke tests. A page is a fixture,
the actions that put the app into the state to show, and the metadata that the
viewer groups it by. A gallery script declares its pages with the built-in
edev/gallery module, and returns them:
local gallery = require("edev/gallery")
return gallery.pages({
{
id = "settings-empty",
group = "Settings",
title = "No accounts",
caption = "A first run offers to add an account.",
tags = { "empty" },
fixture = "app.settings",
params = { accounts = 0 },
marker = "settings.add_account",
prepare = function(viewport, size)
eguidev.widget("settings.tab.accounts"):click()
end,
},
})Each page captures at each window size of the config. Optional fields select a
named viewport or a widget as the target (target = { viewport = "hud" }), keep
the window at its own size (resize = false), walk a scroll area in frames
(scroll), assert more before the capture (check), and limit the sizes
(sizes).
Each page asserts what it captures: its marker must be present, and its check
must pass. Thus a page is also a test. edev smoke offers the module in check
mode, so gallery scripts in the smoke suite run with their assertions and no
capture. edev gallery --check does the same for the gallery scripts alone.
Configure the gallery in .edev.toml:
[gallery]
suite_dir = "smoketest/gallery"
out_dir = "gallery"
title = "My App"
index_size = "small"
sizes = [
{ name = "small", width = 900, height = 640 },
{ name = "large", width = 1440, height = 900 },
]
# A shot that the run also writes as PNG to a fixed path, such as a README image.
[[gallery.export]]
page = "settings-empty"
size = "large"
path = "docs/images/settings.png"A run captures each script in its own app session. It publishes only when each step passes, so a failed run keeps the last good gallery. A page that fails is listed in a banner of the viewer, and the run exits with status 1. The run compares each image with the last gallery and marks each page as new, changed, or unchanged. The viewer can show only the changed pages, which is what the reviewer of a change needs.
A gallery image must be the same on each run. Animated content, such as a
spinner, shows as changed on each run, so a fixture should freeze it. An app
with an animation that the gallery must show gives its fixtures params for the
seed and the time, and steps the animation to that time on a fixed clock.
Content that grows over time can wait in prepare for a condition on a
diagnostic:
prepare = function()
eguidev.wait(function()
return eguidev.diagnostic("render").complete == true
end, { timeout_ms = 30000 })
end,The published directory belongs to the run. Keep its images out of Git, for
example with gallery/*.jpg in .gitignore. The manifest gallery.json and the
viewer index.html can stay in Git, so that a diff shows which pages changed.
| Option | Behavior |
|---|---|
--only TEXT |
Capture the scripts whose file name contains TEXT, and publish beside the full gallery. |
--check |
Run each page with its assertions, and capture nothing. |
--append |
Add the pages of this run to the published gallery. A page replaces the page of the same id. |
--open |
Open the viewer when the run ends. |
--render-only |
Write the viewer again from the published manifest. |
jpegoptim, when installed, rewrites each image losslessly as a progressive
JPEG without metadata.
Register the edev launcher as an MCP server. For example, with Claude Code:
claude mcp add eguidev -- edev mcpThe launcher supplies four tools: start, stop, restart, and status. A
successful lifecycle result includes the direct endpoint of the app: a Unix
domain socket that only its owner can reach. The app serves script_api and
script_eval at that endpoint. The agent surface is a
complete script, not fine-grained RPC, so one call can set up, interact, assert,
and report in one round trip.
This repository also includes an agent skill at
skills/SKILL.md that teaches agents this workflow.
eguidev has three crates, and you add them in this order:
eguidevis the instrumentation library that your app depends on. It compiles for native andwasm32targets.eguidev_runtimeis the native-only embedded runtime. It supplies script evaluation, screenshots, and the in-process MCP server.edevis the CLI and lifecycle launcher. It runs scripts, suites, and fixtures against a managed app process.
1. Instrument your app. Put a DevMcp handle in your app state. Wrap each
viewport frame with frame_scope. Tag each widget with a dev_* helper.
eguidev::frame_scope(&self.devmcp, ui, "root", |ui| {
ui.dev_text_edit("app.name", &mut self.name);
if ui.dev_button("app.submit", "Submit").clicked() { /* ... */ }
});TextEditOptions.password masks the field in the UI only. Scripts, dumps, and
failure bundles still see the cleartext value. Set TextEditOptions.omit_value
as well for a field that takes a secret: the field then records no value, and a
script can still type into it. A custom text edit gets the same rules from
TextEditOptions::role and TextEditOptions::recorded_value.
2. Attach the runtime in one bootstrap location.
[dependencies]
eguidev_runtime = "0.1"let devmcp = eguidev_runtime::attach(devmcp);attach returns the inert handle unless Edev supplies EGUIDEV_MCP_ADDR. A
usual cargo run therefore starts a usual app, with no server and no change to
presentation.
3. Keep the focus where the developer put it, before the event loop starts.
eguidev_runtime::enable_background_launch_guard();On macOS an app takes the focus when it opens its first window. The guard hands
each activation that no mouse click caused back to the application that was
frontmost, so an automated run does not interrupt the developer. Call it in
main, before run_native: the guard must watch every activation from the
start, and attach can run later, inside the app builder. The guard applies
only to a run that Edev started, and only while the session presentation is
background.
4. Configure the launcher. Install the CLI with cargo install edev. Then
put a .edev.toml file in your project root:
[app]
command = ["cargo", "run", "--locked", "-p", "myapp"]
[smoke]
suite_dir = "smoketest"On macOS, the default background presentation continues to render covered
windows. It adds no Dock item, and with the guard from step 3 it keeps the
focus where it was. Set presentation = "foreground" for manual sessions. See
examples/edev.toml for a commented reference of every
option.
Run edev with no arguments to see the full command list.
- Luau scripting: the API reference is
eguidev.d.luau, whichedev docsprints without change. Thescript_apiMCP tool serves the same declaration by query: an overview, a path list, or one source or symbol. For the language itself, see luau.org. - Worked example: the
eguidev_demoapp and its suite insmoketest/. Seedocs/examples/README.md.
MIT