Why I Built This
RunPod is great for spinning up GPU pods, but there's one frustrating gap: you can't view pod logs from the CLI.
The official runpodctl lets you start, stop, and manage pods — but if you want to check logs, you're forced to open the web console every time. This is especially painful when you're managing multiple pods or trying to build automation scripts.
So I built runpod-log, a simple CLI tool that fetches RunPod GPU pod logs directly in your terminal.
Features
- Fetch logs instantly — get both container logs and system logs in one command
-
Real-time monitoring — stream logs to a file with the
tailcommand - Automatic authentication — browser-based login via Playwright with automatic JWT token refresh
Installation
pip install runpod-log
Usage
# Login (opens browser for authentication)
runpod-log login
# Fetch logs for a specific pod
runpod-log logs <pod-id>
# Filter by log type
runpod-log logs <pod-id> --only container
runpod-log logs <pod-id> --only system
# Real-time log monitoring
runpod-log tail <pod-id> ./logs.txt
# Logout
runpod-log logout
How It Works
Authentication
Since RunPod doesn't offer a public API for logs, runpod-log uses a browser-based authentication flow:
-
runpod-log loginopens a Playwright browser window - You log in to RunPod normally
- The tool captures the JWT token from
hapi.runpod.netrequests - Session data is stored locally — no repeated logins needed
Token Refresh
JWT tokens expire after about 60 seconds. When that happens, runpod-log automatically spins up a headless browser to fetch fresh credentials — no manual intervention required.
Log Retrieval
Under the hood, it calls the undocumented https://hapi.runpod.net/v1/pod/{pod_id}/logs endpoint to fetch both container and system logs.
Why Not Just Use the Web Console?
- Automation: pipe logs into other tools, grep for errors, trigger alerts
- Multi-pod management: check logs across pods without switching browser tabs
- SSH workflows: view logs on remote machines without a GUI
Links
- GitHub: ho4040/runpod-log
- PyPI: runpod-log
- Original blog post (Korean): ho4040.github.io
If you're a RunPod user who's been frustrated by the lack of CLI log access, give it a try and let me know what you think!
Top comments (0)