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 🙏

© 2025 – Pkg Stats / Ryan Hefner

local-lens-cli

v0.1.0

Published

Universal CLI tool to capture server logs from any backend framework

Readme

Local Lens CLI

Universal CLI tool to capture server logs from any backend framework and forward them to Local Lens.

Features

  • Framework-agnostic: Works with any backend (Rails, Express, Django, FastAPI, Laravel, etc.)
  • Zero configuration: No setup required, just wrap your server command
  • Real-time forwarding: Logs appear immediately in Local Lens MCP tools
  • Process management: Graceful start/stop with proper signal handling

Installation

Install globally via npm:

npm install -g @local-lens/cli

Or build locally with Local Lens:

npm run build:all

Usage

Basic Usage

Wrap any server command with local-lens capture:

# Rails server
local-lens capture "rails server"

# Express/Node.js
local-lens capture "npm start"

# Django
local-lens capture "python manage.py runserver"

# FastAPI
local-lens capture "uvicorn main:app --reload"

# Any command with arguments
local-lens capture "rails server" "-p" "4000"

Options

# Custom process name for logs
local-lens capture "rails server" --name "my-api"

# Custom Local Lens server URL
local-lens capture "npm start" --server "http://localhost:27497"

# Silent mode (suppress Local Lens output)
local-lens capture "rails server" --silent

Status Check

Check if Local Lens server is running:

local-lens status

Examples

Rails Development

# Start Rails server with log capture
local-lens capture "rails server" --name "rails-api"

Your Rails logs (including ActiveRecord queries) will now appear in Local Lens with source: backend-console.

Express Development

# Start Express server with log capture
local-lens capture "npm run dev" --name "express-server"

Django Development

# Start Django server with log capture
local-lens capture "python manage.py runserver" --name "django-api"

Integration with Local Lens

Once your server is running with Local Lens CLI, you can query the logs using MCP tools:

// Get all backend console logs
get_console_logs({ source: "backend-console" })

// Search for specific logs from your process
search_logs({ query: "error", source: "backend-console", backendProcess: "rails-api" })

// Get logs from a specific process
get_console_logs({ backendProcess: "express-server" })

How It Works

  1. Process Wrapping: CLI spawns your server process and captures stdout/stderr
  2. Log Formatting: Formats logs according to Local Lens schema with metadata
  3. Real-time Forwarding: Sends logs to Local Lens server via HTTP API
  4. Source Tagging: Tags all logs with source: "backend-console" for filtering

Process Management

  • Graceful Shutdown: Ctrl+C properly terminates the wrapped process
  • Signal Forwarding: SIGTERM and SIGINT are forwarded to your server
  • Exit Codes: Preserves original process exit codes
  • Error Handling: Captures and reports process startup errors

This allows you to capture server logs from any backend framework without modifying your application code.