npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tail-logs

v2.0.1

Published

Fast split-pane CLI log tailer for local files and Docker containers

Readme

tail-logs

A fast, single-binary split-pane CLI log tailer for local files and Docker containers — built for both humans (interactive new-tab TUI) and AI coding agents (bounded JSON queries + built-in MCP server).

tail-logs split-pane grid view


Why tail-logs?

When debugging multi-service or Dockerized apps (like Laravel microservices + workers + nginx), you usually end up opening 5 terminal tabs and manually typing docker exec ... tail -f ... over and over.

With tail-logs, you define your project's log sources once in .tail-log.json (or walk through the 10-second interactive setup wizard), run tail-logs, and get:

  • Automatic new terminal tab in Ghostty, iTerm2, Terminal.app, WezTerm, Kitty, tmux, Windows Terminal, GNOME Terminal, and Konsole (with automatic inline fallback in Warp, Alacritty, Cursor/VS Code, etc.) that closes itself cleanly when you quit (q).
  • Split-pane live tailing (vertical, horizontal, or auto-grid) with a global search bar that filters every pane at once.
  • Pane-scoped character selection & double-click UUID copy — drag across a wrapped correlation ID or double-click it to copy only that exact string without bleeding into neighboring panes.
  • Headless CLI & stdio MCP server so AI agents (Cursor, Claude Code, etc.) can triage errors, trace correlation IDs across containers, and capture bounded live logs without hanging.

Installation

tail-logs is a single native binary (written in Rust) with no runtime dependencies. Prebuilt binaries are available for macOS (Apple Silicon & Intel), Linux (x64 & arm64, statically linked), and Windows (x64).

Homebrew (macOS & Linux):

brew install gwdhost/tap/tail-logs

Shell installer (macOS & Linux, installs to ~/.local/bin):

curl -fsSL https://github.com/gwdhost/tail-logs/releases/latest/download/tail-logs-installer.sh | sh

PowerShell installer (Windows):

irm https://github.com/gwdhost/tail-logs/releases/latest/download/tail-logs-installer.ps1 | iex

Set TAIL_LOGS_INSTALL_DIR to change the install directory, or TAIL_LOGS_VERSION=1.3.0 to pin a version.

npm / npx (downloads the matching native binary as an optional dependency; Node.js is only used to launch it):

npm install -g tail-logs
npx tail-logs

Cargo (build from source):

cargo install tail-logs --locked
# or the latest main branch:
cargo install --git https://github.com/gwdhost/tail-logs --locked

Archives and checksums for every platform are also attached to each GitHub Release.

Verify installation:

tail-logs --version

Upgrade to the latest version anytime:

tail-logs update          # or: tail-logs upgrade
tail-logs update --check  # check if a newer version is available without installing

tail-logs update detects how it was installed (Homebrew, the shell/PowerShell installer, npm/pnpm/yarn/bun, Cargo, or a git checkout) and runs the matching upgrade command.


Quick Start

Navigate to any project directory and run:

tail-logs
  • If .tail-log.json exists: opens a new terminal tab with a split pane for every configured log source.
  • If .tail-log.json does not exist: automatically launches the interactive setup wizard:
    • Auto-detects common local log files (./storage/logs/*.log, ./logs/*.log, etc.).
    • Lists all Docker containers (running first, fuzzy-filterable) and lets you browse the container's folder tree starting from its WORKDIR (e.g. /var/www/html) with type-to-filter, Enter to descend/select, ←/Backspace to go up, and / to jump to a path.
    • Supports Docker container stdout/stderr (docker logs -f) with no file path needed.

Configuration File (.tail-log.json)

[
  {
    "type": "file",
    "path": "./storage/logs/laravel.log"
  },
  {
    "type": "docker",
    "container": "auth-api",
    "path": "/var/www/html/storage/logs/laravel.log"
  },
  {
    "type": "docker-logs",
    "container": "nginx",
    "name": "nginx (stdout)"
  }
]

Optional fields on any entry:

  • "name": custom display label for the pane header.
  • "tailLines": initial number of lines to load on startup (default: 200).

Live Config Reload: .tail-log.json is watched while the viewer is running. Adding or removing sources in another terminal (e.g. tail-logs add) updates the open viewer automatically without losing existing buffers.


Interactive TUI Features

Inspector Modal (Pretty JSON + Stack Traces)

Multi-line stack traces (PHP/Laravel #0 ..., Node at ..., etc.) are automatically grouped with their parent log entry and shown with a compact [+N lines] badge. Press Enter on any line to open the Inspector Modal with pretty-printed JSON and the full scrollable stack trace, or press → in wrap mode on a multi-line entry to expand it into a full-tab entry view (← or Esc to return):

tail-logs inspector modal

Precision Copy & Selection

  • Double-click any UUID / correlation ID / token — automatically highlights and copies the entire token (even if it wraps across two lines inside a narrow pane).
  • Click & drag inside a pane — character-level selection clamped strictly to that pane (never bleeds into adjacent panes). Wrapped rows of the same log entry are joined without inserting bogus newlines, and releasing the mouse copies straight to your clipboard.
  • y or click Copy in the pane header (or Cmd+C when CSI u is enabled in iTerm2) — copies the active character selection, or the full selected/bottom log entry.

Full-Tab Focus, Merged Timeline & Request Markers

  • Full-Tab Mode (f / z or click Full) — expands the active session to fill the entire tab; press Esc (or click Esc: Split) to return to split view.
  • Merged Chronological Timeline (M) — interleaves all log sources in time order with color-coded [source] tags so you can trace a single request across containers.
  • Request Marker (m) — drops a bright ────────── MARK HH:MM:SS ────────── divider across every pane right before you trigger an HTTP request or job (markers stay visible even with active filters).
  • Auto-Reconnect & Log Rotation — follows local files natively (including rotation and truncation, on every OS) and automatically reconnects with exponential backoff when a Docker container restarts, showing live ● LIVE, ⏸ PAUSED +N, ↻ RECONNECT, or ✕ STOPPED badges.
  • Persistent Preferences — line wrap (W) and macOS desktop error notifications (o) are remembered across sessions in ~/.config/tail-logs/prefs.json.

Keyboard & Mouse Shortcuts

| Action | Shortcut / Mouse | | ------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | Search & filter all panes (!term excludes) | / (type to filter, Ctrl+R regex, Ctrl+U clear, Esc done/clear) | | Filter by log level | e (Errors), w (Warn+), i (Info+), a (All) | | Switch active pane | Tab / Shift+Tab, 1–9, or click any pane | | Scroll vertically | ↑/↓, j/k, PgUp/PgDn, Ctrl+U/Ctrl+D, or mouse wheel | | Scroll sideways (when wrap is off) | ←/→ (Shift+←/→ fast), 0 to reset, or trackpad horizontal scroll | | Toggle multi-line text wrap (saved) | W (Shift+W) | | Jump to top / scroll to bottom | g (top), b / G / End (bottom & resume), B (all panes to bottom), or click ↓ Bottom | | Pause / resume tail | Space or p (active pane), P (all panes) | | Full-tab active session | f or z (or click Full), Esc to return to split view | | Cycle split layout | l (Vertical / Horizontal / Grid) | | Merged chronological timeline | M (Shift+M), Esc to return to split view | | Insert request marker across all panes | m | | Clear screen buffer (does not modify files) | c (active pane), C (all panes) | | Jump to next / previous ERROR | n / N (or ] / [), x resets error counter | | Inspect full entry (JSON & stack trace) | Enter (modal), or → in wrap mode for full-tab stack trace (←/Esc to return) | | Copy UUID / text / full log line | Double-click token, drag to select, y, Cmd+C, or click Copy | | Export filtered logs to .log file | s (active pane / merged), S (all panes) | | Toggle macOS error notifications (saved) | o | | Help overlay / Quit (auto-closes tab) | ? / q or Ctrl+C |


CLI Subcommands

Interactive Management

tail-logs          # Open viewer in a new tab (runs setup if .tail-log.json is missing)
tail-logs --here   # Open viewer in the current terminal tab
tail-logs init     # Create or overwrite .tail-log.json interactively
tail-logs add      # Add one or more log sources to .tail-log.json
tail-logs edit     # Rename, reorder, or remove sources in .tail-log.json
tail-logs update   # Upgrade to the latest version (alias: upgrade; supports --check, --force, --json)

Headless & AI Agent Commands

All headless commands are non-interactive, bounded (never hang), strip ANSI automatically when piped, and support --json / --jsonl and --cwd <dir>.

# 1. Discover configured sources & check live file/container health
tail-logs sources --json

# 2. Low-token triage: error/warning counts & deduplicated top errors
tail-logs summary --json
tail-logs summary --since 10m --source app,auth-api --json

# 3. Read & filter logs (groups stack traces, supports !exclude & --merged)
tail-logs read --level error --lines 50 --json
tail-logs read --search "2a3aa080-ddff-4fe5-8cc8-a52f3d89ba53 !healthcheck" --merged --json
tail-logs read --since 5m --source auth-api --jsonl

# 4. Bounded live capture (captures only new lines arriving during the window)
tail-logs wait --duration 5s --level warn --json
tail-logs wait --until "OrderCreated|ERROR" --timeout 15s --json

Built-in MCP Server (tail-logs mcp)

tail-logs includes a zero-dependency stdio MCP server exposing 4 structured tools:

  • get_sources — list .tail-log.json entries and live health status
  • get_log_summary — low-token error/warning triage with deduplicated top errors
  • read_logs — filtered, stack-trace-grouped log queries across files & Docker containers
  • wait_for_logs — bounded live capture with duration, until, and timeout

Add it to Cursor's .cursor/mcp.json:

{
  "mcpServers": {
    "tail-logs": {
      "command": "tail-logs",
      "args": ["mcp"]
    }
  }
}

Development

Requires a stable Rust toolchain (1.91+, install via rustup).

cargo run -- --here          # Run the viewer from source
cargo test                   # Unit tests + CLI/MCP integration tests
cargo clippy --all-targets   # Lints
cargo fmt                    # Format
cargo build --release        # Optimized binary in target/release/tail-logs

node bin/tail-logs.js runs the npm launcher against a local target/release (or target/debug) build, or against any binary set in TAIL_LOGS_BINARY.

Releasing

  1. Bump version in both Cargo.toml and package.json (keep optionalDependencies in sync with node scripts/npm-packages.mjs --sync-only).
  2. Commit, then push a matching tag: git tag v1.4.0 && git push --tags.

The Release workflow builds binaries for all five targets, creates the GitHub Release (archives, checksums, installers), publishes the @tail-logs/* platform packages and the tail-logs npm wrapper, updates the gwdhost/homebrew-tap formula (needs HOMEBREW_TAP_TOKEN), and publishes to crates.io (needs CARGO_REGISTRY_TOKEN).

License

MIT