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

logpeek

v0.0.1

Published

Pipe mobile device logs to AI coding agents

Downloads

22

Readme

logpeek

Pipe mobile device logs to AI coding agents.

logpeek gives coding agents like Claude Code, Cursor, and Gemini CLI direct access to Android and iOS device logs.

What you can do

Ask your agent things like:

  • "Why is my app crashing on launch?" — agent pulls crash logs, finds the stack trace, and fixes the issue
  • "Show me the last 30 seconds of error logs" — narrow time window, error-level filtering
  • "What's happening in the React Native JS layer?" — isolate framework-specific logs from native noise
  • "Check the network logs for failures" — grep through logs for specific patterns
  • "My app is slow, what's going on?" — pull verbose logs and spot the bottleneck

Quick Start

1. Install

npm install -g logpeek

2. Connect your agent

npx logpeek init

Registers logpeek as a Claude Code plugin. Restart Claude Code after.

Any agent that runs shell commands can use logpeek. Add this to your agent's system prompt:

You have access to `logpeek` for collecting mobile device logs:
- logpeek --app com.example.app                       # collect logs (last 5m)
- logpeek --app com.example.app --level error          # errors only
- logpeek --app com.example.app -f react-native        # React Native logs only
- logpeek --app com.example.app --grep "network"       # search logs
- logpeek --app com.example.app --last 30s             # narrow time window
- logpeek devices                                      # list connected devices

3. Verify

npx logpeek doctor

Checks that adb (Android) and xcrun (iOS) are available and ready.

Commands

# Collect logs (default command)
logpeek --app com.example.app
logpeek                                          # interactive device & app picker

# List connected devices
logpeek devices

# Check prerequisites
logpeek doctor

# Register Claude Code plugin
logpeek init

Flags

| Flag | Short | Default | Description | |------|-------|---------|-------------| | --app <id> | -a | interactive | Bundle ID (iOS) or package name (Android) | | --device <id> | -d | auto | Device ID or name | | --platform <type> | -p | auto | android or ios | | --level <level> | -l | verbose | Minimum log level: verbose, debug, info, warn, error | | --source <type> | -s | all | Log source: all, native, framework | | --framework <type> | -f | — | react-native or flutter. Automatically sets --source framework. | | --last <duration> | -t | 5m | Time window (e.g., 30s, 1m, 5m, 1h) | | --lines <n> | -n | 200 | Max lines to output | | --grep <pattern> | -g | — | Case-insensitive text filter | | --verbose | | — | Debug logging | | --quiet | | — | Suppress output except errors |

Examples

# All logs from last 5 minutes
logpeek --app com.example.app

# Errors only, last 30 seconds
logpeek --app com.example.app --level error --last 30s

# React Native JS logs only (-f implies --source framework)
logpeek --app com.example.app -f react-native

# Search for network-related errors
logpeek --app com.example.app --grep "network" --level error

# Target a specific device
logpeek --app com.example.app -d "iPhone 16"

# Combine framework filter with grep
logpeek --app com.example.app -f react-native --grep "inventory" --level error

# Widen the window for intermittent issues
logpeek --app com.example.app --last 30m -n 500

Log Output

Logs are automatically formatted for readability:

15:47:37 INF [Network] GET /api/cart → 200 OK (142ms)
15:47:37 INF [Network] GET /api/user/profile → 401 Unauthorized
15:47:37 WRN [Auth] Session token expired, refreshing...
15:47:37 INF [Network] POST /api/auth/refresh → 200 OK (203ms)
15:47:39 ERR [Inventory] Failed to verify stock: Connection timeout after 5000ms
15:47:39 INF [Performance] JS thread: 58.2fps | UI thread: 60.0fps

Raw platform timestamps and process metadata are stripped. Level indicators (INF, WRN, ERR, DBG) and categories are preserved.

How It Works

Android: Uses adb logcat with PID filtering. If the app has crashed (no PID), automatically includes AndroidRuntime and FATAL EXCEPTION logs.

iOS: Uses xcrun simctl spawn <udid> log show with process/subsystem predicates. Falls back to ReportCrash and SpringBoard logs for crash debugging.

Filtering: Logs pass through a pipeline — format → level filter → source filter → grep filter → line limit. Filters combine with AND logic.

Device discovery: Automatically detects booted Android emulators (adb devices) and iOS simulators (xcrun simctl list). If multiple devices are found, an interactive picker is shown.

Framework Support

| Framework | Android | iOS | |-----------|---------|-----| | React Native | ReactNativeJS tag | com.facebook.react.runtime.JavaScript | | Flutter | flutter tag | flutter subsystem | | Native | Full logcat | Full unified log |

Platform Support

| Platform | Emulator/Simulator | Physical Device | |----------|-------------------|-----------------| | Android | Supported | Not yet | | iOS | Supported (macOS only) | Not yet |

Requirements

  • Node.js >= 18
  • Android: adb available, emulator booted
  • iOS: macOS with xcrun simctl, simulator booted

Development

npm install
npm run dev          # watch mode
npm test             # run tests
npm run build        # production build

License

MIT