home / skills / openclaw / skills / react-native-logs-cli

react-native-logs-cli skill

/skills/okwasniewski/react-native-logs-cli

This skill helps you read live React Native Metro logs using rn-logs CLI, delivering plain text output for non-interactive agent runs.

npx playbooks add skill openclaw/skills --skill react-native-logs-cli

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.5 KB
---
name: react-native-logs-cli
description: >
  Use rn-logs to read React Native Metro logs via CDP without MCP overhead.
  Default output is plain text and safe for non-interactive agent runs.
license: MIT
metadata:
  author: okwasniewski
  version: "1.0.0"
---

# rn-logs cli

Use `rn-logs` to read React Native Metro logs via CDP without MCP overhead.
Default output is plain text and safe for non-interactive agent runs.

## When to use

- You need live Metro logs from a running RN app
- You want low-context, plain text log output

## Installation

```bash
npm install -g rn-logs-cli
```

```bash
bun add -g rn-logs-cli
```

Then verify:

```bash
rn-logs --help
```

## Requirements

- `rn-logs` is installed and available in PATH
- Metro is running
- App is running on a simulator or device

## Core workflow

```bash
# 1. List connected apps
rn-logs apps

# 2. Stream logs
rn-logs logs --app "<id|name>"

# 3. Snapshot logs
rn-logs logs --app "<id|name>" --limit 50
```

## Command options

```bash
# Changing default port or host
rn-logs "[command]" --host "<host>"    # Metro host (default: localhost)
rn-logs "[command]" --port "<port>"    # Metro port (default: 8081)

rn-logs help
```

## Non-interactive mode

- When multiple apps are connected, you must pass `--app`.
- Output is plain text for agent-friendly consumption.

## Common failures

- `metro not reachable` -> start Metro or fix host/port
- `no apps connected` -> run app on simulator or device
- `multiple apps connected` -> pass `--app`

Overview

This skill provides a simple command-line interface that uses rn-logs to read React Native Metro logs via the Chrome DevTools Protocol (CDP) with no MCP overhead. The default output is plain text, making it safe for non-interactive agent runs and script consumption. It’s focused on low-context log streaming and quick snapshots from running simulators or devices.

How this skill works

The CLI connects to Metro’s CDP endpoint and either lists connected apps or streams log events from a selected app. You can stream live logs or take a limited snapshot of recent entries. Host and port are configurable so it can target local or remote Metro instances.

When to use it

  • You need live Metro logs from a running React Native app for debugging.
  • You want simple plain-text output suitable for automated agents or CI pipelines.
  • You have multiple connected apps and must select one explicitly.
  • You need a quick snapshot (limited number of lines) rather than a persistent stream.

Best practices

  • Install rn-logs-cli globally and verify with rn-logs --help before use.
  • Ensure Metro is running and the app is launched on a simulator or device.
  • When multiple apps are connected, always pass --app to avoid ambiguity.
  • Use --host and --port to target non-default Metro instances or remote machines.
  • Prefer plain-text output in non-interactive agent workflows to simplify parsing.

Example use cases

  • List connected apps: rn-logs apps to pick the correct target.
  • Stream live logs during development: rn-logs logs --app "MyApp".
  • Capture a recent set of entries for CI debugging: rn-logs logs --app "MyApp" --limit 50.
  • Point to a remote Metro server: rn-logs logs --host 192.168.1.10 --port 8081 --app "MyApp".

FAQ

What do I need before using this CLI?

Install rn-logs-cli globally, ensure Metro is running, and launch your app on a simulator or device.

Why is output plain text by default?

Plain text keeps output low-context and safe for non-interactive agents, scripts, and CI log collection.

What if I see 'multiple apps connected'?

Pass the --app option with the app name or id to select the target explicitly.