Commit 8e62733
committed
feat(repl): add an interactive command-line debugger
Debug Robot Framework runs straight from the terminal — pause a run, see
where you are, inspect and change state, run keywords in the live context,
and step through execution, no editor required. It's the scriptable,
terminal-native counterpart to the VS Code extension's graphical debugger.
- **Two ways in.** `robotcode robot-debug <paths>` (alias `run-debug`) runs a
real suite through the normal runner with the debugger attached — same
output, options and arguments as `robotcode robot`, and the run keeps
streaming as you step, continue or detach. `robotcode repl` (alias `shell`)
now has the debugger built in too, so breakpoints fire while you try
keywords at the prompt.
- **Pause where you want.** Line and keyword breakpoints (`--break
login.robot:42`, `--break "Open Browser"`), an embedded `Breakpoint` step in
a `.robot` file, `--stop-on-entry`, and breaking on failures (uncaught
failures by default, plus `--break-on-all-exceptions`, `--break-on-failed-test`
and `--break-on-failed-suite`). Every stop shows why, which keyword, and where.
- **Step through it.** `.step`/`.next`/`.return`/`.continue`/`.until`, plus
`.detach` (stop debugging but let the run finish) and `.abort` (end it now).
- **Inspect and change state.** Walk the call stack (`.where`/`.up`/`.down`/
`.frame`), list variables by scope (`.vars`), evaluate in the selected frame
(`.print`/`.pprint`/`.whatis`), auto-show expressions at every stop
(`.display`), set variables (`.set`), and run any keyword right at the prompt
in the paused context.
- **Manage breakpoints live.** List them and add conditional, one-shot,
logpoint or command-list breakpoints; set conditions, ignore N hits, delete,
and disable/enable by number (`.breakpoints`/`.condition`/`.ignore`/`.delete`/
`.disable`/`.enable`/`.commands`/`.tbreak`). Arm exception breakpoints on the
fly with `.catch`.
- **Read source and docs in place.** `.list` shows the source at the stop,
`.source <kw>` a named keyword's definition; the full shell command set
(`.kw`, `.doc`, `.imports`, `.save`, …) works at the debug prompt too. On the
rich prompt these open in a scrollable full-screen viewer with search and
links; on the plain prompt they print inline.
- **Built for humans and agents alike.** Context-aware completion, syntax
highlighting, persistent history and multi-line editing on the rich prompt;
`--plain` (or `--backend` / `ROBOTCODE_REPL_*`) gives a bare prompt that reads
commands from stdin, and the rich prompt falls back to plain automatically on
piped input — so the debugger drives cleanly from scripts, CI or AI agents.
- Long commands accept any unambiguous prefix; one-letter aliases mirror pdb.1 parent 1edfe13 commit 8e62733
25 files changed
Lines changed: 5462 additions & 311 deletions
File tree
- docs/03_reference
- packages/repl/src/robotcode/repl
- Repl
- _debug
- _pt
- tests/robotcode/repl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
12 | 31 | | |
13 | 32 | | |
14 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments