tailboard

command module
v0.0.0-...-1d34aeb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

tailboard

A terminal dashboard for any log stream: JSONL files on disk, pi agent sessions, or an Axiom dataset.

Stats

Last commit Top language Repo size

Stat Value
Lines of code 13,186
Top languages Go (12,949), JSONL (200), Makefile (37)
Source files 51
Test files 0
Commits 128
First commit 2026-04-22
Last commit 2026-10-13

Updated 2026-11-05 by readme_stats.py

One screen shows the live stream, counts by level, throughput, the error trend, the noisiest messages and, for agent sessions, a per-agent table of spend, context size and failures. Everything runs locally. Nothing leaves the machine unless you configure an Axiom source.

 client health (15m):   ● acme 2/1    range: 1h
┌────────────────────────────────────────────────┐┌─────────────────────────────────┐┌─────────────────────────────────┐
│ JSONL Live [fake] ● tailing                    ││Last 1h ●  120 events  (~2.0/min)││Cost (1h)                        │
│17:09:22 INFO  acme hello route=/x              ││INFO    ██████░░     100   83.3% ││$  19.40 acme                    │
│                                                ││WARN    █░░░░░░░      15   12.5% ││                                 │
│                                                ││ERROR   █░░░░░░░       5    4.2% ││$  19.40 total                   │
│                                                ││durationMs  avg 12ms   p95 40ms  ││                                 │
│                                                │└─────────────────────────────────┘└─────────────────────────────────┘
│                                                │┌────────────────────────────────────────────────────────────────────┐
│                                                ││ Throughput                                                         │
│                                                ││3│                    ⢀⡠⢄                          ⢀⡠⢄              │
│                                                ││ │                ⢀⡠⠔⠊⠁ ⠈⢢                     ⢀⡠⠔⠊⠁ ⠈⢢             │
│                                                ││2│            ⢀⡠⠔⠊⠁       ⠱⡀               ⢀⡠⠔⠊⠁       ⠱⡀           │
│                                                ││ │        ⢀⡠⠔⠊⠁            ⠘⢄          ⢀⡠⠔⠊⠁            ⠘⢄          │
│                                                ││1│    ⣀⠤⠒⠉⠁                 ⠈⢢     ⣀⠤⠒⠉⠁                 ⠈⢢     ⣀⠤⠒⠉│
│                                                ││ │⣀⠤⠒⠉                        ⠱⣀⠤⠒⠉                        ⠱⣀⠤⠒⠉    │
│                                                ││0└──────────────────────────────────────────────────────────────────│
│                                                ││ 16:09:22    16:19:11    16:29:00    16:38:49    16:48:38           │
│                                                ││━━ acme  ━━ beta                                                    │
│                                                │└────────────────────────────────────────────────────────────────────┘
│                                                │┌────────────────────────────────────────────────────────────────────┐
│                                                ││ Errors & Warns (6h)                                                │
│                                                ││3│                  ⢀⣀⠤⠔⠢⡀                       ⢀⣀⠤⠔⠢⡀             │
│                                                ││ │            ⣀⣀⠤⠔⠒⠉⠁    ⠈⠢⡀               ⣀⣀⠤⠔⠒⠉⠁    ⠈⠢⡀           │
│                                                ││2│     ⢀⣀⠤⠔⠒⠊⠉             ⠈⠢⡀      ⢀⣀⠤⠔⠒⠊⠉             ⠈⠢⡀      ⢀⣀⠤│
│                                                ││ │⣀⠤⠔⠒⠉⠁                     ⠈⠢⣀⠤⠔⠒⠉⠁                     ⠈⠢⣀⠤⠔⠒⠉⠁  │
│                                                ││0└──────────────────────────────────────────────────────────────────│
│                                                ││ 11:09:22    12:08:16    13:07:11    14:06:05    15:05:00           │
│                                                ││━━ Errors  ━━ Warns                                                 │
└────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────┐┌──────────────────────────────────────┐┌──────────────────────────────────────┐
│ Top Errors & Warns (1h)              ││ Recent Issues                        ││ Top Routes (1h)                      │
│   7  ERROR  boom                     ││17:09:22 WARN  slow                   ││    3  GET /health                    │
│                                      ││                                      ││                                      │
│                                      ││                                      ││                                      │
│                                      ││                                      ││                                      │
│                                      ││                                      ││                                      │
└──────────────────────────────────────┘└──────────────────────────────────────┘└──────────────────────────────────────┘
? help  space pause  / search  T range  D source  esc reset  tab focus  enter expand  q quit
                                                          ▂▅ █  ▂▅█  ▂  errs  focus: logs  source: fake  refresh: 0s ago

A 120x40 frame rendered from the view tests' fake source, ANSI stripped; it is the golden in internal/ui/testdata/view/frame-120x40.golden. With the pi source the bottom row is Top Errors beside an Agents panel, one row per agent.

Quickstart

Requires Go 1.26.0 or later.

go install github.com/brgmry/tailboard@latest

The go install path resolves once the repository rename to tailboard lands. Until then, or to build from a checkout:

git clone https://github.com/brgmry/tailboard.git
cd tailboard
make install                      # builds and copies to ~/.local/bin/tailboard

For a file-only binary, build with -tags noaxiom (make build-noaxiom). It leaves out the Axiom backend, the axiom-go SDK and OpenTelemetry, and is about half the size. In such a binary --dataset fails with an error saying it was built without the axiom backend, and so does loading a config that defines an axiom source, since every configured source is checked at load.

No config is needed for files or for pi sessions:

tailboard app.jsonl               # follow one JSONL file
tailboard /var/log/svc/ ~/logs/*.jsonl   # directories (recursive, *.jsonl) and globs
tailboard --source pi             # pi agent sessions in ~/.pi/agent/sessions
tailboard --source pi --check     # headless: print a JSON summary and exit

Press ? for the key map, T to widen the time range, / to search, enter to expand a row, q to quit.

Other flags:

tailboard                         # the only configured source, else pi when its directory exists
tailboard --source NAME           # a source from config (or a path)
tailboard --dataset NAME          # an Axiom dataset
tailboard --interval 5            # refresh the panels every 5 s
tailboard --config FILE           # config path
tailboard --env FILE              # load KEY=value pairs from FILE (nothing is loaded otherwise)

Source resolution order: --dataset, --source, positional paths, default_source, default_dataset, $AXIOM_DATASET, the only configured source, then the built-in pi source when ~/.pi/agent/sessions exists.

Sources

Files

A jsonl source follows files, directories and globs. Directories are walked recursively for *.jsonl, globs are re-evaluated every 5 s, plain files are followed as is. Appends, truncation, rotation (a new file at the same path) and partial trailing lines are handled; lines longer than max_line_bytes are skipped and counted.

Events are kept in memory as compact records, about 380 bytes per stored event, so the default max_events = 500000 is a budget of about 190 MB per source. Lower max_events to cap it; the oldest events are dropped first. The full line is re-read from disk only when you expand or copy an event. A 100 MB file loads in well under a second.

Field names are mapped in config (see below). With no mapping, timestamp/ts/time, level/severity/lvl and message/msg are tried, which covers pino, zap, slog and most structured loggers.

pi agent sessions

tailboard --source pi reads every session file under ~/.pi/agent/sessions, one event per line, and adds an Agents panel:

column meaning
agent basename of the session's cwd; several sessions in one cwd roll up
$today spend since local midnight
$/h spend in the trailing 60 minutes
ctx usage.totalTokens of the newest assistant turn in the newest session
cmp compactions in the active window
err tool results with isError in the window
orphan tool calls older than orphan_after with no result
model the model with the highest cost in the window
fallback router tier changes that were fallbacks, over all tier changes
last time since the agent's newest event

The Cost panel shows today's spend and the hourly rate, plus the split by model. The stream shows assistant turns, tool results, compactions (as warns), router state changes (fallbacks as warns) and the rest as debug, hidden by default (d shows them). p filters by model, o by tool, t pins the session of the focused row.

Event time is the entry's write time (timestamp), so an assistant turn's cost lands when the response finished.

Known limits:

  • A tool call still running for longer than orphan_after (default 120 s) counts as orphaned until its result lands. Long bash results above that exist.
  • No pane status column yet: whether an agent is busy, idle or dead is not shown.
  • om.* custom entries carry personal content. They are stored as debug events with only customType retained; expand and copy show the full line, which is local-only behaviour.
  • The cwd basename is the agent key, so two projects with the same directory name roll up together.
Axiom

An Axiom dataset is a source of type axiom. See Axiom below for auth and the legacy config form.

Configuration

Config lives at ~/.config/tailboard/config.toml. The legacy ~/.config/axiom-tui/config.toml is still read when the new one does not exist, and a legacy [datasets.<name>] table still works. Presets are saved to ~/.config/tailboard/presets.toml. A complete starting point is in example.config.toml.

# root (all existing keys unchanged)
default_source  = "pi"      # new; wins over default_dataset when both set
default_dataset = "name"    # legacy, still honoured
refresh_seconds = 15
stream_poll_ms  = 2000
log_buffer_size = 2000

[sources.<name>]
type           = "axiom" | "jsonl" | "pi"   # required
dataset        = "<name>"                   # axiom only; defaults to the source name
paths          = ["~/logs/*.jsonl", "/var/log/app/"]  # jsonl: required. pi: default ["~/.pi/agent/sessions"]
backfill       = "48h"                      # jsonl and pi: skip files whose mtime is older; default 48h
max_events     = 500000                     # jsonl and pi: store cap, oldest dropped; default 500000
max_line_bytes = 16777216                   # jsonl and pi: longer lines are skipped and counted; default 16 MiB
orphan_after   = "120s"                     # pi: age before a tool call with no result counts as orphaned; default 120s
route_prefixes = ["GET", "POST"]            # all types; default GET/POST/PUT/DELETE/PATCH for axiom, none otherwise
hide_levels    = ["debug"]                  # all types; stream filter at startup; default [] (pi: ["debug"])

[sources.<name>.fields]                     # jsonl and axiom; ignored for pi
time           = ["timestamp", "ts", "_time", "time"]  # first present wins
time_format    = ""                         # Go layout; empty = RFC3339Nano, RFC3339, epoch s, epoch ms auto
level          = ["level", "severity", "lvl"]
level_map      = { "WARNING" = "warn", "50" = "error" }  # applied after the built-in table
message        = ["message", "msg"]
group          = "fields.clientName"
cost           = "fields.costDollars"
cost_group     = ""                         # defaults to group
duration       = ["fields.durationMs"]
duration_unit  = "ms"                       # ms | s | us | ns; default ms
provider       = "fields.provider"
operation      = "fields.operation"
trace          = "fields.requestId"
interesting    = ["fields.userId", "fields.route"]
display_prefix = ""                         # stripped for display; default "fields." for axiom

Every key documented as a list also accepts a single string (time = "ts"). Durations are Go duration strings. ~ is expanded in paths.

Dot paths: a.b.c is tried first as a literal top-level key (Axiom flattens to fields.x), then as nested object navigation. Array indices are not supported.

Built-in level table, applied before level_map, case-insensitive: error, err, fatal, critical, crit, panic, emerg, alert, 50, 60 to error; warn, warning, 40 to warn; info, notice, 30 to info; debug, trace, verbose, 10, 20 to debug. Anything else is kept lowercased.

Time parsing without time_format: RFC3339Nano, RFC3339, then a number (integer or float): >= 1e12 is epoch milliseconds, else epoch seconds. A missing or unparseable time uses ingestion time and increments the source's untimed counter, shown in the footer as untimed N when non-zero.

Capabilities follow the mapping: a group field unlocks the segmented throughput chart, the health bar and the c filter; cost unlocks the Cost panel; duration the avg/p95/max rows; route_prefixes the Top Routes panel. Panels for unmapped dimensions are not drawn.

The built-in pi source needs no config entry. A [sources.pi] entry replaces it and only needs type = "pi" plus the keys you change.

Axiom

An Axiom source queries the dataset with APL. The legacy form still works unchanged and produces the same queries as before the rename:

default_dataset = "my-dataset"

[datasets.my-dataset]
# Fields surfaced inline on each log line (dotted keys, Axiom flattens structured logs).
interesting_fields = [
  "fields.userId",
  "fields.route",
  "fields.requestId",
]

# Optional: field used to colour-code logs and segment the throughput chart (top 5 values).
group_by_field = "fields.userId"

# Optional: enables avg/p95/max latency in the stats panel.
duration_field = "fields.durationMs"

# Optional: prefixes that count as HTTP routes for the Top Routes panel.
route_prefixes = ["GET", "POST", "PUT", "DELETE", "PATCH"]

The same dataset as a source, with the field mapping under fields:

[sources.prod]
type    = "axiom"
dataset = "prod-logs"

[sources.prod.fields]
interesting = ["fields.userId", "fields.route", "fields.requestId"]
group       = "fields.userId"
duration    = ["fields.latencyMs"]

An axiom source with no fields keys gets the defaults the tool always had: time _time, level level, message message then msg, cost fields.costDollars by fields.clientName, provider fields.provider, operation fields.operation, trace fields.requestId, display prefix fields..

Auth

Set one of these in your env:

Env var Token type Needs org ID?
AXIOM_PAT Personal token (xapt-…) Yes
AXIOM_TOKEN API token (xaat-…) No
export AXIOM_PAT="xapt-…"
export AXIOM_ORG_ID="your-org-id"

PATs are preferred, they carry full user permissions. API tokens work but must explicitly grant the Query permission on your dataset.

To keep tokens in a file, pass --env FILE: its KEY=value lines are loaded on startup without overwriting variables already set. No env file is read unless you pass one.

--check

Opens the source, waits for the first full backfill pass (file sources) or runs one stats query (Axiom), prints one JSON object and exits 0. This is the output of go run . internal/source/testdata/generic/sample.jsonl --check from a checkout; only elapsed_ms varies. The sample's timestamps are old, so only its one untimed event falls inside stats_24h:

{"source":"internal/source/testdata/generic/sample.jsonl","kind":"jsonl","files":1,"events":199,"skipped_lines":0,"untimed":1,"parse_errors":1,"unreadable_files":0,"elapsed_ms":21,"stats_24h":{"total":1,"info":0,"warn":1,"error":0}}

A pi source adds cost and agents, for example:

"cost":{"today":19.4,"trailing_hour":1.12,"total_24h":21.3},
"agents":[{"name":"pi-os","context_tokens":68224,"compactions":2,"tool_calls":120,"tool_errors":3,"orphan_calls":0,"spend_today":12.1,"top_model":"claude-opus-5-5"}]

agents is present, possibly empty, exactly when the source is an agent source; cost only when a cost field is mapped. Keys are stable.

Keybindings

key action
? help overlay
space pause / resume the live stream
j / k / ↓↑ scroll logs
pgdn / pgup page down / up
ctrl+d / ctrl+u page down / up
g / home jump to the oldest page
G / end jump to the tail and resume the stream
h / l / ←→ focus the previous / next panel
tab cycle focus forward
e / w / i / d toggle errors / warns / infos / debug visibility
/ search messages (substring, case-insensitive)
c filter by group (client, agent)
p / o provider / operation substring filter (pi: model, tool)
t pin the trace field of the focused row
R / C reset filters
esc close a modal; otherwise reset filters and resume tail
T cycle the time range (15m / 1h / 6h / 24h)
D source switcher
s / 1-9 save the filter as a preset / load a preset
enter expand log as JSON (on top errors: drill-in)
y copy the selected or expanded event as JSON
r force refresh all queries
q / ctrl+c quit

The mouse works too: click a panel to focus it, click a top error to filter the stream by it, right-click a stream row to copy it.

Adding a source

The UI depends on one interface, Source in internal/source/source.go. A backend implements it and registers itself in the source registry under its type name:

  1. Implement source.Source: Info() describes the source (kind, capabilities, group label, filter fields, hidden levels), the query methods return the aggregates for a lookback window, Stream pages the live events with an opaque Cursor, Hydrate returns the full raw object for expand and copy, Close releases resources. Methods for a capability the source lacks return their zero value and a nil error; set only the Caps bits the source supports and the layout follows them.
  2. Optionally implement AgentSource (adds the Agents panel) and ProgressSource (the loading footer and the --check counters).
  3. Register the type from an init(): source.Register("mytype", source.Type{Open: ..., Defaults: ..., Validate: ...}). Open builds the source and applies the defaults itself, since ad hoc sources from the command line skip config loading. Defaults fills every key the config left unset; a file backend calls applyFileDefaults there, as jsonl and pi do. Validate checks the type's own rules without I/O. The registered names are the valid values of type.
  4. Put it where its dependencies belong. A backend that reuses the tailer and store sits in internal/source beside jsonl.go and pi.go. One with its own dependencies gets its own package, as internal/source/axiom does, and the root package imports it for its init(); axiom.go at the root does that behind a build tag.
  5. Add tests: a fixture under the package's testdata/, the source's queries against it, and a --check run.
  6. Document the type here: a section under Sources and its keys in Configuration.

internal/source/jsonl.go is the smallest complete example: it wires the tailer, the store and the field map. pi.go shows a source that reuses the file machinery with its own line handler and side table. Nothing in internal/ui needs to change for a new type.

Code layout

Path Package Holds
main.go main flags, --env, source resolution, --check, starting the program
axiom.go, noaxiom.go main link the Axiom backend, or, under -tags noaxiom, mark it as left out
internal/source source the Source contract and registry, config, the tailer and store, the jsonl and pi backends
internal/source/axiom axiom the Axiom backend, registered from init()
internal/ui ui the Bubble Tea model, views, charts, keys, presets
internal/gen main synthetic JSONL for fixtures and benchmarks

ui and main reach every backend through source; only the root axiom.go imports internal/source/axiom.

Development

make check runs gofmt, vet, staticcheck and race tests, then the same for a -tags noaxiom build along with a check that it links neither the axiom-go SDK nor OpenTelemetry: the same gate as CI. make test and make lint run the race tests and staticcheck on their own.

Why

Logs are cheap. Reading them is expensive. Most teams end up in a web UI (good for exploration, slow for monitoring) or shell-tailing JSON (fast, no structure). tailboard is the middle: a single dense view of what is happening right now, with enough interactivity to investigate without leaving the terminal, and the same screen whether the stream comes from a file, an agent or a hosted dataset.

Licence

MIT, see LICENSE.

Documentation

Overview

Command tailboard is a terminal dashboard for log streams.

Renders a live log stream with filtering, aggregate panels (stats, throughput, error trend), and interactive drill-in, all keyboard driven. Sources are JSONL files or folders, pi agent sessions, or Axiom datasets, configured per source via ~/.config/tailboard/config.toml.

Usage:

tailboard [--source NAME | --dataset NAME | PATH...] [--config PATH] [--interval N] [--env FILE] [--check]

Env (Axiom sources only):

AXIOM_TOKEN (or AXIOM_PAT / AXIOM_API_TOKEN), required
AXIOM_ORG_ID, for personal tokens

Directories

Path Synopsis
internal
gen command
Command gen writes synthetic generic JSONL to stdout for fixtures and benchmarks: about 250-byte lines, a fixed seed, timestamps spread over the last 24 hours.
Command gen writes synthetic generic JSONL to stdout for fixtures and benchmarks: about 250-byte lines, a fixed seed, timestamps spread over the last 24 hours.
source
Package source is the contract between tailboard's UI and its log backends: the Source interface and the types it returns, the registry backends add themselves to, the config that names and tunes each source, and the file backends (jsonl and pi) with the tailer and in-memory store they share.
Package source is the contract between tailboard's UI and its log backends: the Source interface and the types it returns, the registry backends add themselves to, the config that names and tunes each source, and the file backends (jsonl and pi) with the tailer and in-memory store they share.
source/axiom
Package axiom is the Axiom backend: it answers every Source query with APL against one dataset through the axiom-go SDK.
Package axiom is the Axiom backend: it answers every Source query with APL against one dataset through the axiom-go SDK.
ui
Package ui is tailboard's terminal dashboard: a Bubble Tea model over one source.Source, with the stream, the aggregate panels, filters, presets, key bindings and the views that draw them.
Package ui is tailboard's terminal dashboard: a Bubble Tea model over one source.Source, with the stream, the aggregate panels, filters, presets, key bindings and the views that draw them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址