home / skills / reddit / devvit-skills / devvit-logs

devvit-logs skill

/skills/devvit-logs

This skill streams Devvit app logs for a specified subreddit, capturing output briefly to help you debug without hanging.

npx playbooks add skill reddit/devvit-skills --skill devvit-logs

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

Files (2)
SKILL.md
2.0 KB
---
name: devvit-logs
description: 'Stream Devvit logs for an installed app (trigger phrases: "devvit logs", "stream logs", "check logs", "show logs"). Requires the user to provide the target subreddit.'
---

# Devvit Logs

Stream log events from an installed Devvit app for quick debugging. This skill wraps `devvit logs` and auto-exits after a short window (5 seconds) to avoid hanging on a streaming command.

## How It Works

1. Ask the user for the target subreddit (required).
2. Optionally accept an app name and `--since=...` flag.
3. Run `devvit logs` and capture output.
4. Exit automatically after the first burst of output or 5 seconds, whichever comes first.

## Usage

```bash
node ./scripts/devvit-logs.cjs <subreddit> [app-name] [--since=1h]
```

Script path is relative to this skill's directory.

**Arguments:**

- `subreddit` - Required. Subreddit to stream logs from.
- `app-name` - Optional. App name if streaming from another folder.
- `--since=Xd` - Optional. Historical logs window (e.g., `--since=30m`, `--since=1d`).

**Examples:**

```bash
node ./scripts/devvit-logs.cjs my-subreddit
node ./scripts/devvit-logs.cjs my-subreddit my-app --since=1h
```

## Output

```json
{
  "ok": true,
  "reason": "timeout",
  "exitCode": null,
  "signal": null,
  "stdout": "=============================== streaming logs for my-app on my-subreddit ================================\n[DEBUG] Dec 8 15:55:23 Action called!",
  "stderr": ""
}
```

## Present Results to User

- If the user did not provide a subreddit, ask for it explicitly.
- Summarize the captured logs (if any) and mention the 5-second capture window.
- If no logs were captured, say so and suggest retrying with activity or `--since=...`.

## Troubleshooting

- **Devvit CLI not found**: Install or ensure `devvit` is in PATH.
- **Not logged in**: Run `devvit login` and try again.
- **No logs**: Trigger an action in the app or use `--since=...`.
- **Permission errors**: Confirm the app is installed in the subreddit and you have access.

Overview

This skill streams Devvit logs for an installed app on a specified subreddit to help with quick debugging. It wraps the devvit CLI logs command, captures the first burst of output, and auto-exits after a short window to avoid long-running streaming sessions. Provide the target subreddit and optional app name or --since flag to control the capture window.

How this skill works

The skill asks for the target subreddit (required) and optionally accepts an app name and --since=... duration. It runs the devvit logs command, captures stdout/stderr, and listens for output. The run stops automatically after the first burst of logs or 5 seconds, whichever comes first, and returns a short summary and the raw output captured.

When to use it

  • You need a quick snapshot of an app’s recent logs without an open streaming session.
  • Debugging an installed Devvit app after triggering an action in a subreddit.
  • Confirm whether the app is producing logs after a deploy or configuration change.
  • Capture historical logs with a --since flag to inspect prior activity.
  • When you want an automated short capture to avoid hanging the CLI during interactive sessions.

Best practices

  • Always provide the subreddit name; the skill will prompt if omitted.
  • Use --since=30m or --since=1h to include recent historical logs when live traffic is low.
  • Specify the app name if the app code lives in another folder or differs from the default.
  • Trigger a known action in the app just before running the skill to ensure output is generated.
  • If no logs appear, retry with a longer --since window or verify devvit CLI access and permissions.

Example use cases

  • Quickly check logs after deploying a change to my-app on r/my-subreddit.
  • Run a five-second capture to confirm an action handler executed during a manual test.
  • Fetch recent logs from r/example-subreddit using --since=1h to investigate an intermittent error.
  • Verify that the app is installed and has logging access when troubleshooting permission issues.
  • Capture a short log snippet to paste into a bug report or chat with teammates.

FAQ

What if I forget to provide the subreddit?

You will be prompted to supply the target subreddit; the skill requires it to run.

Why does the stream stop after 5 seconds?

The skill auto-exits to avoid hanging on a continuous stream and returns the first burst of output for quick debugging.

No logs captured — what should I do?

Trigger an action in the app, retry with a longer --since window (for example --since=1h), and confirm the devvit CLI is installed and you’re logged in.