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

logdoctor-cli

v0.1.0

Published

Privacy-first AI log analysis in your terminal.

Readme

🩺 LogDoctor

GitHub stars GitHub forks GitHub issues License

LogDoctor is an open-source, privacy-first CLI tool that diagnoses production logs and explains incidents instantly right in your terminal.

💡 Pipe logs → Scrub PII Locally → Get Root Cause Analysis.

🔗 GitHub Repository: https://github.com/shivamshashank/logdoctor


✨ What LogDoctor Does

LogDoctor analyzes application logs using AI to produce clear incident reports directly in your terminal. It focuses on three core pillars:

  1. Local Data Sanitization (Privacy First)
  2. Multi-Model AI Diagnosis
  3. Developer-Native Workflow

Demo


🧠 Features

1. 🛡️ Local Data Sanitization (Privacy First)

Regular expressions and heuristic scanners automatically strip Emails, IP addresses, JWTs, AWS Keys, and application secrets (passwords, auth tokens) locally. [email protected] becomes [REDACTED_EMAIL]. Your sensitive data never leaves your machine.

2. 🤖 Multi-Model AI Diagnosis

Bring your own key (BYOK). Choose your preferred AI engine—OpenAI, Gemini, or Claude—to pinpoint the root cause of the error and generate a suggested code fix.

3. 💻 Developer-Native Workflow

No context switching. Pipe messy, large log files directly into the CLI (e.g., cat error.log | logdoctor analyze) and get color-coded, formatted explanations directly in the terminal where you debug.

4. 📴 100% Offline Mode (Ollama Support)

For absolute zero-trust environments, LogDoctor integrates directly with Ollama. Analyze logs and generate fixes using local LLMs (like llama3 or mistral) without a single byte of data leaving your machine.

5. 📎 Context-Aware Debugging

Provide source code files alongside your logs using the -c flag. LogDoctor will inject your codebase context into the prompt, resulting in hyper-accurate, project-specific code fixes.

6. 📜 Native JSON Log Support

Automatically detects, un-stringifies, and beautifully formats nested JSON logs (like Pino or Winston) so the AI can read them accurately without choking on escaped characters.


🧰 Tech Stack

  • Language: Node.js / TypeScript
  • CLI Framework: commander
  • Terminal UI: chalk (colors), ora (spinners), marked-terminal (Markdown rendering)
  • AI SDKs: @google/generative-ai, openai, @anthropic-ai/sdk

⚙️ Installation

Requires Node.js v18+.

Option 1: Quick Install (macOS / Linux)

You can install LogDoctor instantly using our install script:

curl -fsSL https://raw.githubusercontent.com/shivamshashank/logdoctor/main/install.sh | bash

Windows (PowerShell)

npm install -g logdoctor-cli

🚀 Quick Start

# Configure your AI provider and API key
logdoctor config

# Analyze a log file
logdoctor analyze error.log

# Or pipe a file
cat error.log | logdoctor analyze

# Analyze with custom instructions and save output to a file
logdoctor analyze error.log -p "Focus on database connection errors" -o report.md

# Attach source code context to help the AI fix the error
logdoctor analyze error.log -c src/database.js

# View the exact prompts being sent to the AI (Verbose mode)
logdoctor analyze error.log --verbose

# Clear your stored configuration (log out)
logdoctor logout

⚙️ Run Locally (for Development)

  1. Clone the repository:

    git clone https://github.com/shivamshashank/logdoctor
    cd logdoctor
  2. Install dependencies:

    npm install
  3. Link the CLI: This command makes logdoctor available globally on your machine, pointing to your local source code.

    npm link
  4. Run the tool: Now you can run the logdoctor command from any directory. Any changes you make to the code will be reflected immediately.

    # Configure your API key
    logdoctor config
    
    # Clear your stored configuration (log out)
    logdoctor logout
    
    # Analyze a log file
    logdoctor analyze examples/node-error.log
    
    # Or pipe a file to the command
    cat examples/pii-data.txt | logdoctor analyze
    
    # Analyze with custom instructions and save the output
    logdoctor analyze examples/node-error.log --prompt "Explain it to a junior dev" --output report.md

🤝 Contributing

Contributions are welcome.

You can help by:

• improving log parsers • adding new integrations • improving AI prompts • fixing bugs

Please open issues or pull requests.


👨‍💻 Author

Shivam Shashank

📧 Email: [email protected]

🔗 LinkedIn: https://www.linkedin.com/in/shivam-shashank-2b5766217/


⭐ Support the Project

If you find LogDoctor useful, please give the repository a star ⭐ on GitHub.

It helps the project reach more developers.

👉 https://github.com/shivamshashank/logdoctor