Expand description
ashlar-debug: drive a running ashlar app’s UI from the shell, the way a browser automation CLI
drives a web page: snapshot the UI as an outline with short refs (@e3), act on refs, wait,
read values, take (annotated) screenshots, and run scripts of these as UI tests.
ashlar-debug open ./target/debug/notes # launch with a control port, remember the session
ashlar-debug snapshot -i # - button "Save" [ref=e3] …
ashlar-debug click @e3
ashlar-debug fill @e2 "Groceries" --submit
ashlar-debug wait --text "Saved"
ashlar-debug screenshot --annotate # prints the PNG's path
ashlar-debug batch ui-test.txt # one command per line, plus `assert …` lines
ashlar-debug closeEvery command is one control-protocol call (docs/control-protocol.md) over
ashlar_control::Client. Human output by default, --json for one {"ok":…} line; exit codes
0 (ok), 1 (failed: the app said no, an assertion failed, nothing answers), 2 (usage).
The library is the whole CLI (run) so tests and other tools can embed it; demo is a
deterministic stand-in app that answers the same methods.
Re-exports§
pub use session::Env;pub use snapshot::Outcome as SnapshotOutcome;pub use snapshot::Snapshots;pub use snapshot::Tolerance;pub use transport::Report;pub use transport::ScriptError;pub use transport::Transport;pub use transport::run_script;
Modules§
- demo
- A tiny app without a window that answers the debugger methods (
ui.snapshot,ui.click, …) over a real control port, deterministically:ashlar-debug demo --control <port>. It is what the tests drive, and a way to try the CLI without building an app. - session
- Sessions: which app successive commands talk to, kept in a small file between invocations; the
control-key discovery that lets
connectand--appfind a running app; andopen, which launches one. - snapshot
- Golden snapshots: compare a
ui.screenshotreply with a baseline PNG. - target
- Element targets as written on the command line, and as the control protocol takes them.
- transport
- What a
.uiscript talks to: the TCP control port (Client) or anything else that answers control methods, such as an in-process app driver on a virtual clock. - words
- Words: splitting a script line like a shell does (quotes, escapes, comments) and a small argument parser (flags, options and positionals in any order).
Structs§
- Io
- The streams a command uses (real stdio in
main, buffers in tests).
Enums§
- Exit
- How a command ended.