Lamia Debugger¶
Lamia includes a built-in debugger for .lm files:
This page covers both interactive terminal debugging and IDE integration.
CLI Usage¶
Basic command¶
Options¶
--break,-b <line>: Set one or more breakpoints before execution starts.--stop-on-entry: Pause on the first executable line.--json: Machine-readable mode used by IDE integrations.
Examples:
# Run until line 51
lamia debug orchestrator.lm --break 51
# Pause immediately, then step manually
lamia debug orchestrator.lm --stop-on-entry
# Multiple breakpoints
lamia debug orchestrator.lm --break 51 --break 87
Interactive Commands¶
When running lamia debug in terminal mode, use:
continue/c: Resume executionnext/n: Step overstep/s: Step intostepout/out: Step outbreak <line>/b <line>: Add a breakpointbreak: List breakpointsprint <expr>/p <expr>: Evaluate expressionlocals/l: Show local variablesbacktrace/bt: Show call stackquit/q: Stop debugginghelp/h: Show help
Config Discovery¶
If --config is not provided, Lamia automatically searches for config.yaml or config.yml by walking up parent directories from the target file path.
This means debugging works from nested folders without manually changing directories.
If no config file is found, Lamia shows an error with the search starting point and how to fix it.
Variable Inspection¶
The debugger supports structured variable inspection for:
- lists / tuples / sets
- dictionaries
- Pydantic models (via
model_dump()when available) - regular Python objects (
vars(...))
In IDE debug views, expandable values appear as tree nodes so nested items can be inspected individually.
IDE Integration Notes¶
The IDE integration uses:
lamia debug <file> --jsonas the debug runtime process- a JSON-lines protocol for debugger commands/events
- source-map aware line mapping from transformed Python back to original
.lmlines
Breakpoints can be passed at process start and are also synchronized after initialization for robust startup behavior.