Skip to content

CLI Command Reference

The CLI is an alternative interface to the same tooling that agents access via MCP. Every debug_* and chrome_* MCP tool has a corresponding CLI command. Many agent setups prefer CLI tools for their transparency, composability, and ease of scripting. The CLI is also useful for CI pipelines and convenience operations like doctor.

All commands output the viewport to stdout as structured plain text. Exit codes: 0 for success, 1 for errors, 2 for timeouts.

Command Structure

The CLI uses namespaced subcommands:

krometrail debug <command>     # Debug session commands
krometrail chrome <command>   # Browser recording commands
krometrail doctor              # Check installed debuggers
krometrail commands            # List all commands (machine-readable)
krometrail completions <shell> # Generate shell completions (bash, zsh, fish)

Global Flags

These flags are available on all debug and browser commands:

FlagDescription
--session <id>, -sTarget a specific debug session (required when multiple sessions are active)
--jsonOutput structured JSON instead of plain text
--quietSuppress banners and hints; output viewport only
--versionShow version

Session Lifecycle

debug launch

bash
krometrail debug launch "python app.py" --break order.py:147
krometrail debug launch "python -m pytest tests/ -x" --break "order.py:147 when discount < 0"
krometrail debug launch "node index.js" --break src/api.js:30 --language javascript
krometrail debug launch "go test ./..." --break service/order.go:147
FlagTypeRequiredDescription
<command>positionalNoCommand to debug, e.g. 'python app.py' or 'pytest tests/'
--break, -bstringNoSet breakpoint(s), e.g. 'order.py:147' or 'order.py:147 when discount < 0'
--languagestringNoOverride language detection. Supported: python, node/javascript/typescript/js/ts, go, rust, java, cpp, ruby, csharp, swift, kotlin
--frameworkstringNoOverride framework auto-detection. Known: pytest, django, flask, jest, mocha, gotest, pytest, django, flask, jest, mocha, gotest. Use 'none' to disable.
--stop-on-entrybooleanNoPause on first executable line
--configstringNoPath to launch.json file (default: .vscode/launch.json)
--config-name, -CstringNoName of the configuration to use from launch.json
--cwdstringNoWorking directory for the debug target
--envstringNoEnvironment variables as KEY=VAL pairs (comma-separated, e.g. DEBUG=1,LOG=verbose)
--source-linesstringNoLines of source context above/below current line (default: 15)
--stack-depthstringNoMax call stack frames to show (default: 5)
--locals-depthstringNoObject expansion depth for locals (default: 1)
--token-budgetstringNoApproximate token budget for viewport output (default: 8000)
--diff-modebooleanNoShow only changed variables vs previous stop

debug attach

bash
krometrail debug attach --port 5678 --language python
krometrail debug attach --pid 12345 --language go
FlagTypeRequiredDescription
--languagestringYesLanguage. Supported: python, node/javascript/typescript/js/ts, go, rust, java, cpp, ruby, csharp, swift, kotlin
--pidstringNoProcess ID
--portstringNoDebug server port
--hoststringNoDebug server host
--break, -bstringNoSet breakpoint(s), e.g. 'app.py:10'
--cwdstringNoWorking directory for the debug target
--source-linesstringNoLines of source context above/below current line (default: 15)
--stack-depthstringNoMax call stack frames to show (default: 5)
--locals-depthstringNoObject expansion depth for locals (default: 1)
--token-budgetstringNoApproximate token budget for viewport output (default: 8000)
--diff-modebooleanNoShow only changed variables vs previous stop

debug status

bash
krometrail debug status

debug stop

bash
krometrail debug stop
krometrail debug stop --session abc123

Execution Control

debug continue

bash
krometrail debug continue
krometrail debug continue --timeout 10000
FlagTypeRequiredDescription
--timeoutstringNoMax wait time in ms
--threadstringNoThread ID to continue (for multi-threaded debugging)

debug step

bash
krometrail debug step over
krometrail debug step into
krometrail debug step out
krometrail debug step over --count 5
FlagTypeRequiredDescription
<direction>positionalYesStep direction: over, into, or out
--countstringNoNumber of steps
--threadstringNoThread ID to step (for multi-threaded debugging)

debug run-to

bash
krometrail debug run-to order.py:155
FlagTypeRequiredDescription
<location>positionalYesTarget location, e.g. 'order.py:150'
--timeoutstringNoMax wait time in ms

Breakpoints

debug break

bash
# Set breakpoints (replaces existing in that file)
krometrail debug break order.py:147
krometrail debug break order.py:147,150,155

# Conditional
krometrail debug break "order.py:147 when discount < 0"

# Hit count
krometrail debug break "order.py:147 hit >=100"

# Logpoint
krometrail debug break "order.py:147 log 'discount={discount}'"

# Exception breakpoints
krometrail debug break --exceptions uncaught
krometrail debug break --exceptions raised
krometrail debug break --exceptions all

# Clear all breakpoints in a file
krometrail debug break --clear order.py
FlagTypeRequiredDescription
--breakpointstringNoBreakpoint spec: 'file:line[,line] [when cond] [hit cond] [log msg]'
--exceptionsstringNoSet exception breakpoint filter (e.g. 'uncaught', 'raised')
--clearstringNoClear all breakpoints in a file

debug breakpoints

bash
krometrail debug breakpoints

State Inspection

debug eval

bash
krometrail debug eval "<expression>"
krometrail debug eval "cart.items[0].__dict__" --depth 3
krometrail debug eval "request.headers" --frame 2
FlagTypeRequiredDescription
<expression>positionalYesExpression to evaluate, e.g. 'cart.items[0].dict'
--framestringNoStack frame index (0 = current)
--depthstringNoObject expansion depth

debug vars

bash
krometrail debug vars
krometrail debug vars --scope global
krometrail debug vars --scope closure
krometrail debug vars --scope all
krometrail debug vars --filter "^user"
krometrail debug vars --frame 2
FlagTypeRequiredDescription
--scopestringNoVariable scope: local, global, closure, or all
--filterstringNoRegex filter on variable names
--framestringNoStack frame index (0 = current)

debug stack

bash
krometrail debug stack
krometrail debug stack --frames 20
krometrail debug stack --source
FlagTypeRequiredDescription
--framesstringNoMaximum frames to show
--sourcebooleanNoInclude source context per frame

debug source

bash
krometrail debug source order.py
krometrail debug source order.py:140-160
FlagTypeRequiredDescription
<target>positionalYesFile path, optionally with line range: 'file.py:15-30'

Session Intelligence

debug watch

bash
krometrail debug watch "len(cart.items)" "user.tier" "total > 0"
FlagTypeRequiredDescription
<expressions>positionalYesExpression(s) to watch

debug unwatch

bash
krometrail debug unwatch "user.tier"
FlagTypeRequiredDescription
<expressions>positionalYesExpression(s) to stop watching

debug log

bash
krometrail debug log
krometrail debug log --detailed
FlagTypeRequiredDescription
--detailedbooleanNoShow detailed log with timestamps

debug output

bash
krometrail debug output
krometrail debug output --stderr
krometrail debug output --since-action 5
FlagTypeRequiredDescription
--stderrbooleanNoShow only stderr
--stdoutbooleanNoShow only stdout
--since-actionstringNoOnly show output since action N

debug threads

bash
krometrail debug threads

Browser Recording

browser start

bash
krometrail chrome start --url http://localhost:3000
krometrail chrome start --url http://localhost:3000 --framework-state auto
krometrail chrome start --url http://localhost:3000 --framework-state react
krometrail chrome start --attach                    # Attach to already-running Chrome
krometrail chrome start --profile myproject          # Use isolated Chrome profile
krometrail chrome start --all-tabs                   # Record all tabs

browser status

bash
krometrail chrome status

browser mark

bash
krometrail chrome mark "user submitted form"

browser stop

bash
krometrail chrome stop
krometrail chrome stop --close-browser

browser export

bash
krometrail chrome export <session-id> --format har --output file.har

Browser Session Investigation

browser sessions

bash
krometrail chrome sessions
krometrail chrome sessions --has-errors
krometrail chrome sessions --url-contains "localhost:3000"

browser overview

bash
krometrail chrome overview <session-id>
krometrail chrome overview <session-id> --around-marker <marker-id>
krometrail chrome overview <session-id> --include timeline,markers,errors
bash
krometrail chrome search <session-id> --query "payment failed"
krometrail chrome search <session-id> --event-types network_response --status-codes 500
krometrail chrome search <session-id> --framework react --pattern stale_closure

browser inspect

bash
krometrail chrome inspect <session-id> --event <event-id>
krometrail chrome inspect <session-id> --marker <marker-id>
krometrail chrome inspect <session-id> --timestamp "2025-01-15T10:30:00Z"

browser diff

bash
krometrail chrome diff <session-id> --from <timestamp-or-event-id> --to <timestamp-or-event-id>

browser replay-context

bash
krometrail chrome replay-context <session-id>
krometrail chrome replay-context <session-id> --format test_scaffold --framework playwright
krometrail chrome replay-context <session-id> --format test_scaffold --framework cypress

Utility

doctor

bash
krometrail doctor
krometrail doctor --json

commands

bash
krometrail commands
krometrail commands --group debug
krometrail commands --group browser
FlagTypeRequiredDescription
--groupstringNoFilter by command group: debug, chrome, or all

completions

bash
krometrail completions bash
krometrail completions zsh
krometrail completions fish

See Shell Completions below for installation instructions.


Shell Completions

Generate shell completion scripts for tab-completion of commands, subcommands, and flags:

bash
# Bash
krometrail completions bash > ~/.local/share/bash-completion/completions/krometrail
# Or add to ~/.bashrc:
source <(krometrail completions bash)

# Zsh
krometrail completions zsh > "${fpath[1]}/_krometrail"
# Or add to ~/.zshrc:
source <(krometrail completions zsh)

# Fish
krometrail completions fish > ~/.config/fish/completions/krometrail.fish

JSON Output

Every command supports --json for structured output:

bash
krometrail debug continue --json
json
{
	"status": "stopped",
	"reason": "breakpoint",
	"location": { "file": "order.py", "line": 147, "function": "process_order" },
	"stack": [...],
	"locals": { "discount": { "type": "float", "value": "-149.97" }, ... },
	"source": { "file": "order.py", "start_line": 140, "lines": [...] }
}