mcpField
D
devvit-logs

devvit-logs

github.com/redditDevelopment154 installsUpdated 13w ago
Repository

About devvit-logs

devvit-logs is a debugging skill for installed Devvit apps. It captures output from `devvit logs` and exits after the first burst or five seconds, making it useful for developers who need a bounded view of logs for a subreddit.

Key features

  1. 01Capture logs by running `devvit logs`
  2. 02Require a target subreddit
  3. 03Optionally specify an app name and time window
  4. 04Exit after the first output burst or five seconds
  5. 05Return captured results as JSON

Use cases

  1. 01Quickly inspect logs for an app installed in a subreddit
  2. 02Review historical logs for a chosen time window
  3. 03Prevent a streaming log command from hanging
  4. 04Retry after triggering app activity when no logs appear

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/reddit/devvit-skills --skill devvit-logs

After installing, type/devvit-logsin Claude Code to confirm it loaded.

Bundled filesscripts/devvit-logs.cjs

Details

From the project README

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

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:

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

Output

{
  "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.

Comments

Markdown supported