b.roll

A flight recorder for your terminal. Record sessions, search output, annotate findings, extract commands.

$ cargo install broll
Recording a session
$ broll start --name "api-debug" --group "deploy-v2"
broll: recording started (session a3f2b1c0 "api-debug")
broll: exit the shell or run `broll stop` to end recording
$ curl http://localhost:3000/health
{"status":"ok","uptime":"3h 22m"}
$ docker logs api-server --tail 5
2026-03-10T10:23:01Z INFO request method=GET path=/health status=200
2026-03-10T10:23:14Z ERROR connection refused: postgres:5432
2026-03-10T10:23:14Z WARN retrying database connection in 5s
$ exit
broll: session a3f2b1c0 ended
Searching across sessions
$ broll search "connection refused"
+------------------------------------------+-----------------------------------+
| Results for 'connection refused' (3) | Preview |
+------------------------------------------+-----------------------------------+
| | |
| [api-debug] 2026-03-10 10:23 | Session: a3f2b1c0 |
| [7e91d4f3] 2026-03-09 15:41 | Name: api-debug |
| [c0ff3310] 2026-03-08 09:12 | Group: deploy-v2 |
| | ─────────────────────────────── |
| | ERROR connection refused: |
| | postgres:5432 |
| | |
+------------------------------------------+-----------------------------------+
Tab switch | j/k navigate | Enter view | q quit
Viewing with syntax highlighting
$ broll view api-debug
┌ broll view — api-debug (a3f2b1c0) ──────────────────────────────┐
[10:23:01] curl http://localhost:3000/health
[10:23:01] {"status":"ok","uptime":"3h 22m"}
[10:23:14] docker logs api-server --tail 5
[10:23:14] INFO request method=GET path=/health status=200
[10:23:14] ERROR connection refused: postgres:5432
[10:23:14] WARN retrying database connection in 5s
[10:23:15] DEBUG config loaded from config/app.yaml:12
└ / search | ↑/↓ scroll | q quit ─────────────────────────────────┘

Built for power users

Everything you need to never lose terminal output again.

🔍

Full-text search

SQLite FTS5-powered search across all your sessions. Live search mode updates results as you type with 150ms debounce.

🔒

Secret filtering

Automatically redacts passwords, tokens, AWS keys, JWTs, and database URLs before they hit disk. On by default.

📄

Command extraction

Pull out just the commands from any session and save them as a runnable shell script. Turn debugging into documentation.

🔗

Session groups

Correlate multiple terminals working on the same task. Tag sessions, group them, search across the whole context.

🎨

Syntax highlighting

JSON keys, strings, and values get distinct colors. Log levels (ERROR, WARN, INFO, DEBUG) stand out. URLs and file:line references are highlighted.

💻

TUI interface

Keyboard-driven TUI with mouse support, vim-style navigation, visual line mode for yanking, and in-session search.

🏷

Session management

Name sessions, add notes with annotate, rename, delete. No more remembering hex IDs — prefix matching works everywhere.

📦

Export & import

Share sessions as portable JSON files. Versioned format with duplicate detection on import.

📊

Statistics

See session counts, total storage size, and date ranges at a glance with broll stats.

How it works

1

Start recording

broll start spawns your shell inside a PTY (pseudo-terminal). Everything flows through broll transparently.

2

Shell hooks capture commands

Preexec/precmd hooks emit OSC markers so broll knows which lines are commands vs output. Tab completion, readline, and arrow keys all work normally.

3

Output is rendered and stored

A vt100 virtual terminal renders captured bytes to preserve column layout. Each chunk is timestamped and stored in SQLite with FTS5 indexing.

4

Secrets are redacted

Before anything hits disk, regex patterns strip out env vars with secret-like names, bearer tokens, AWS keys, JWTs, DB connection strings, and private key blocks.

5

Exit to finalize

Exit the shell or run broll stop. The session is indexed and searchable immediately.

Data location

macOS: ~/Library/Application Support/broll/broll.db

Linux: ~/.local/share/broll/broll.db

Installation

From crates.io

$ cargo install broll

From source

$ git clone https://github.com/rodbove/broll.git $ cd broll $ cargo build --release $ cp target/release/broll ~/.local/bin/
Requirements

Rust 1.85+ (edition 2024). Works with zsh and bash.

Quick start

Three commands to get going.

Quick start
# 1. Start recording
$ broll start --name "my-session"
broll: recording started (session d4e5f6a7 "my-session")
# 2. Work normally — everything is captured
$ echo "hello world"
hello world
$ exit
# 3. Search or view later
$ broll search "hello"
$ broll view my-session
Prompt indicator

When recording, the terminal tab title shows broll recording - <name> and BROLL_SESSION is set. Add it to your prompt:

# Add to ~/.zshrc or ~/.bashrc PS1="${BROLL_SESSION:+[rec: $BROLL_SESSION] }$PS1"

Session groups

Correlate multiple terminals working on the same task.

Working with groups
# Terminal 1: API server
$ broll start --group "debug-auth" --tag "server"
# Terminal 2: curl testing
$ broll start --group "debug-auth" --tag "client"
# Later: search across both terminals
$ broll search "401" --group debug-auth
# List only sessions in a group
$ broll list --group debug-auth

Command reference

Every command with all options and examples.

broll start Recording

Start recording a new session. Spawns a sub-shell inside a PTY in the current directory. Shell hooks capture commands in real-time.

Usage

broll start [OPTIONS]

Options

FlagDescription
-n, --name <NAME>Give the session a name for easy identification and lookup
-t, --tag <TAG>Tag the session for organization
-g, --group <GROUP>Group ID to correlate multiple terminal sessions
-d, --dir <PATH>Working directory for the session (defaults to current directory)
--no-filterDisable sensitive content filtering

Examples

$ broll start $ broll start --name "api-debug" $ broll start --name "fix-auth" --tag "server" --group "debug-auth" $ broll start --dir /var/log $ broll start --no-filter
broll stop Recording

Stop the current recording session. You can also just exit the shell.

Usage

broll stop
broll list Browse

List all recorded sessions with their IDs, names, timestamps, and group info.

Usage

broll list [OPTIONS]

Options

FlagDescription
-g, --group <GROUP>Filter sessions by group

Examples

$ broll list $ broll list --group deploy-v2
broll view Browse

View a recorded session in a scrollable TUI with timestamped output, syntax highlighting for JSON/log levels/URLs, in-session search, and vim-style yank. Sessions can be referenced by ID, ID prefix, or name.

Usage

broll view <ID>

Examples

$ broll view a3f2 # by ID prefix $ broll view api-debug # by name
broll extract Export

Extract just the commands from a session as a runnable shell script. Outputs to stdout by default.

Usage

broll extract <ID> [OPTIONS]

Options

FlagDescription
-o, --output <FILE>Write to a file instead of stdout

Examples

$ broll extract a3f2 # print to stdout $ broll extract api-debug --output repro.sh # save as script
broll annotate Manage

Add a note to a recorded session. Notes are displayed at the top of the view TUI in a distinct colored section.

Usage

broll annotate <ID> <NOTE>

Examples

$ broll annotate a3f2 "root cause: postgres wasn't running" $ broll annotate fix-auth "resolved by rotating JWT signing key"
broll rename Manage

Rename a recorded session.

Usage

broll rename <ID> <NEW_NAME>

Examples

$ broll rename a3f2 "deploy-postmortem"
broll delete Manage

Delete one or more recorded sessions and all their data. Prompts for confirmation by default.

Usage

broll delete <IDS...> [OPTIONS]

Options

FlagDescription
-f, --forceSkip confirmation prompt

Examples

$ broll delete a3f2 # single session, confirms $ broll delete a3f2 7e91 c0ff # multiple at once $ broll delete old-session --force # skip confirmation
broll export Export

Export a session as a portable JSON file. Uses a versioned format (SessionExport) for compatibility.

Usage

broll export <ID> [OPTIONS]

Options

FlagDescription
-o, --output <FILE>Write to a file instead of stdout

Examples

$ broll export api-debug --output session.json $ broll export a3f2 > backup.json
broll import Export

Import a session from a JSON file. Duplicate sessions are detected and skipped.

Usage

broll import <FILE>

Examples

$ broll import session.json
broll stats Info

Show storage statistics: session count, total size, and date range.

Usage

broll stats

Keybindings

Keyboard and mouse controls for the TUI.

View TUI

j / DownMove cursor down
k / UpMove cursor up
Ctrl-d / PgDnPage down
Ctrl-u / PgUpPage up
g / HomeGo to top
G / EndGo to bottom
/Search within session
nNext search match
NPrevious search match
yyYank current line
YSame as yy
3yyYank 3 lines from cursor
VVisual line mode (select, then y)
Mouse scrollScroll up/down
Mouse clickPosition cursor
q / EscQuit or go back to search

Search TUI

/ / iEdit search query
TabSwitch focus (results / preview)
j / DownNavigate or scroll
k / UpNavigate or scroll
EnterOpen session at match
yyYank first line of result
YYank full chunk
Mouse scrollScroll results or preview
Mouse clickSelect result
q / EscQuit or dismiss input

Sensitive content filtering

Filtering is on by default. Use --no-filter when you need to capture everything.

PatternExample
Secret env varsexport API_KEY=sk-abc123
Bearer tokensAuthorization: Bearer eyJ...
AWS access keysAKIAIOSFODNN7EXAMPLE
Long secret valuestoken: aGVsbG8gd29ybGQ...
Database URLspostgres://user:pass@host/db
JWTseyJhbG...eyJzdW...signature
Private key blocks-----BEGIN PRIVATE KEY-----

Tech stack

Rust

Edition 2024, requires 1.85+

ratatui + crossterm

Terminal UI framework

portable-pty

PTY sub-shell management

vt100

Virtual terminal rendering

rusqlite + FTS5

Bundled SQLite with full-text search

signal-hook

Terminal resize handling

Esc