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

uncloggr

v0.1.1

Published

A powerful terminal-based log viewer with an interactive interface. View and filter logs from PM2, Docker containers, files, or stdin with real-time updates and advanced filtering capabilities.

Readme

uncloggr

A powerful terminal-based log viewer with an interactive interface. View and filter logs from PM2, Docker containers, files, or stdin with real-time updates and advanced filtering capabilities.

Features

  • Multiple Log Sources: Read from PM2 processes, Docker containers, Docker services, files, or stdin
  • Interactive TUI: Built with React/Ink for a smooth terminal experience
  • Real-time Updates: Follow logs as they're written with automatic updates
  • Advanced Filtering: Filter by log level, field values, or custom expressions
  • Search: Find specific entries with forward/backward search
  • Custom Fields: Add or remove fields from the display
  • Sorting: Sort logs by timestamp across multiple sources
  • Selection: Mark and navigate between selected log entries
  • Inspection: Detailed YAML view of any log entry

Installation

npm install -g uncloggr
# or
yarn global add uncloggr

Usage

uncloggr [OPTIONS] [sources...]

Options

  • -a, --all - Include all sources (e.g., stopped Docker containers)
  • -f, --follow - Follow log output (default: true)
  • --since <string> - Show logs since timestamp (e.g., "2013-01-02T13:23:37Z") or relative (e.g., "42m")
  • -n, --tail <string> - Number of lines to show from the end of logs
  • -s, --sort - Sort logs by timestamp (slower but useful for multiple sources)
  • -h, --help - Show help
  • -v, --version - Show version

Source Syntax

Sources can be specified with optional type prefixes:

  • pm2:<pattern> - PM2 process matching pattern
  • docker:<pattern> - Docker container matching pattern
  • docker-service:<pattern> - Docker service matching pattern
  • file:<path> - Log file at path
  • stdin:- - Read from stdin
  • <pattern> - Auto-detect source type

If no source is specified and stdin is not a TTY, reads from stdin. Otherwise, prompts for source selection.

Examples

# View logs from a PM2 process
uncloggr pm2:api-server

# View logs from a Docker container
uncloggr docker:nginx

# View a log file
uncloggr file:/var/log/app.log

# Follow multiple sources with sorting
uncloggr --sort docker:api docker:worker

# Read from stdin
tail -f /var/log/app.log | uncloggr

# Show last 100 lines from all Docker containers
uncloggr --all --tail 100 docker:

Piping From Node

You would think node index.js | uncloggr would work, and sometimes it does, but unfortunately node.js messes with terminal state when it exits, leaving uncloggr in a broken state. You can work around this by making sure neither of stdin/stdout/stderr is a tty. You can do this using the following:

node index.js </dev/null 2>&1 | uncloggr

This will also make sure stderr is sent to uncloggr. It can also be combined with node --watch. You can add the following to .bashrc to make it easier to type:

upipe() {
  "$@" </dev/null 2>&1 | uncloggr
}

Now you can type upipe node --watch index.js instead.

Reading Docker Logs Over SSH

If you often run this on remote servers using ssh, you can either install and run it on the remote host, or you can use DOCKER_HOST environment variable and run it locally.

When running it locally, it may take longer to load the log contents, but the user-interface will be less laggy.

DOCKER_HOST=ssh://[email protected] uncloggr <args>

To avoid typing this long command, you can add the following to your .bashrc (or similar):

u() {
  local host="$1"
  shift
  DOCKER_HOST="ssh://${host}" uncloggr "$@"
}

And you can now type u [email protected] <args> instead.

Docker Service Logs

When using the docker-service: source, docker service logs is used to read logs. This is sometimes buggy, causing it show incomplete logs. This is also why docker services are not suggested by default unless you specify docker-service:.

Keyboard Shortcuts

Navigation

  • j or - Move down one line
  • k or - Move up one line
  • Ctrl+d or PageDown - Move down half page
  • Ctrl+u or PageUp - Move up half page
  • h or - Select previous field
  • l or - Select next field
  • g - Go to first line
  • G - Go to last line
  • F - Follow mode (jump to end)

Filtering

  • 1-6 - Filter by log level (1=TRACE, 2=DEBUG, 3=INFO, 4=WARN, 5=ERROR, 6=FATAL)
  • + - Filter to entries where selected field equals current value
  • - - Filter out entries where selected field equals current value
  • & - Add custom text filter
  • = - Add custom expression filter
  • Backspace - Remove last filter
  • Meta+Backspace - Clear all filters

Search

  • / - Search forward
  • n - Next search result
  • N - Previous search result

Selection

  • Space - Toggle selection on current line
  • m - Jump to next selected line
  • M - Jump to previous selected line
  • s - Sort messages by timestamp

Fields

  • * - Add new field to display
  • \ - Remove selected field from display

View

  • Enter - Toggle detailed inspection view
  • c - Clear all messages
  • q - Quit

In Inspection View

  • or - Scroll inspection pane one line
  • shift+↑ or shift+↓ - Next/previous log item when in inspector view
  • Ctrl+d or PageDown - Scroll inspection pane down half page
  • Ctrl+u or PageUp - Scroll inspection pane up half page
  • Enter or Esc - Exit inspection view

Log Format

uncloggr works best with JSON-formatted logs, and is expected to be used with pino/bunyan. Each log entry should be a JSON object on a single line. Common fields:

  • time - Timestamp (ISO 8601 format)
  • level - Numeric log level (10=TRACE, 20=DEBUG, 30=INFO, 40=WARN, 50=ERROR, 60=FATAL)
  • name - Logger name or component
  • msg - Log message
  • Any other custom fields

Non-JSON lines are treated as plain text messages with level 100 (INVALID).

Example Log Entry

{"time":"2025-10-30T12:34:56.789Z","level":30,"name":"api","msg":"Request received","method":"GET","path":"/users"}

Development

# Install dependencies
yarn install

# Build
yarn build

# Watch mode for development
yarn dev

License

ISC