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

logpilot-ai

v1.0.32

Published

LogPilot: Instantly watch, analyze, and explain your Node.js app errors with AI. Real-time log monitoring, LLM-powered insights, and a dashboard—zero code changes required.

Readme

logpilot-ai

logpilot-ai is an intuitive Node.js tool that watches your application logs, detects errors in real time, and generates insightful, human-readable explanations using LLMs (Claude via AWS Bedrock or OpenAI). It also provides a dashboard and alerting system for seamless monitoring.

Features

  • Real-time log watching and error detection
  • LLM-powered explanations and suggested fixes
  • Dashboard for incident review
  • Email alerting (optional)
  • Plug-and-play: no code changes required
  • Configurable via .env file

Installation

npm install logpilot-ai

Quick Start

  1. Add a .env file to your project root:

# For Bedrock (default)
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=your-aws-region # e.g., ap-south-1
BEDROCK_MODEL_ID=your-bedrock-model-id # e.g., apac.anthropic.claude-3-5-sonnet-20240620-v1:0

# For OpenAI
# OPENAI_API_KEY=your-openai-api-key
# OPENAI_MODEL=gpt-4o # or gpt-3.5-turbo, etc.

INCIDENTS_MAX_MB=5 # (optional, default 5MB)
DELETE_INCIDENTS_ON_EXIT=true # (optional, default is not set; set to true to auto-delete incidents.json on exit)
  1. Update your package.json scripts:

If your app entry point is app.js:

"scripts": {
  "start": "npx logpilot-ai --auto --run \"node app.js\""
}
  1. Start your app as usual:
npm start
  • logpilot-ai will run your app, watch its output, analyze errors, and start the dashboard automatically.

Configuration

All configuration is via environment variables in your .env file:

| Variable | Description | |-------------------------|---------------------------------------------| | AWS_ACCESS_KEY_ID | Your AWS access key (Bedrock only) | | AWS_SECRET_ACCESS_KEY | Your AWS secret key (Bedrock only) | | AWS_REGION | AWS region (Bedrock only) | | BEDROCK_MODEL_ID | Bedrock Claude model ID (Bedrock only) | | OPENAI_API_KEY | OpenAI API key (OpenAI only) | | OPENAI_MODEL | OpenAI model name (OpenAI only) | | INCIDENTS_MAX_MB | Max incidents file size in MB (default: 5) | | DASHBOARD_PORT | Dashboard port (default: 3001) | | DELETE_INCIDENTS_ON_EXIT| If true, incidents.json is deleted when you stop logpilot-ai |

AI Provider Selection and Installation

After installing, run the following command to select your AI provider (AWS Bedrock or OpenAI):

npx logpilot-ai-setup

Note: Both AI provider dependencies (openai and @aws-sdk/client-bedrock-runtime) are installed with logpilot-ai, but only the one you select will be used at runtime. You do not need to install them manually or worry about extra dependencies in your own project.

Switching AI Providers

You can switch your AI provider at any time by running:

npx logpilot-ai-setup

Follow the prompt and then update your .env file with the credentials for your new provider.

Dashboard

  • The dashboard runs on a separate port (default: 3001). If port 3001 is in use, set DASHBOARD_PORT in your .env file to change it. Visit http://localhost:<your-port> to view incidents and explanations.

Programmatic Error Capture

If you want to log errors directly from your code (for example, in a catch block), you can use logpilot-ai's capture API:

const { capture } = require('logpilot-ai/api');

try {
  // some code that may throw
} catch (err) {
  console.log('Error caught:', err);
  capture(err, 'Critical'); // or 'Error', 'Exception', 'Fail', etc.
}

This will print the error and stack to the terminal, allowing logpilot-ai to detect and explain it in real time.

Advanced Usage

  • Watch a log file instead of process output:
    npx logpilot-ai --auto --watch path/to/your.log
  • Start only the dashboard:
    npx logpilot-ai --dashboard

Security

  • Do NOT commit your .env file to version control.
  • Credentials are only read from your local .env file.

Troubleshooting

  • If incidents are not being recorded, check your .env values and ensure your app outputs errors to stdout/stderr.
  • If the incidents file grows too large, it will be auto-cleared when it exceeds the configured size.
  • If you set DELETE_INCIDENTS_ON_EXIT=true in your .env, the incidents file (incidents.json) will be automatically deleted when you stop logpilot-ai (Ctrl+C or process exit).

License

ISC


For more details, see the source code or open an issue.

Keywords

log monitoring, error analysis, AI, LLM, Claude, Bedrock, OpenAI, dashboard, Node.js, logpilot-ai, observability, incident response, developer tools