Deploying a preview environment with prev takes seconds. But when your Next.js app throws a white screen, your Python API returns a 500, or your container exits immediately after startup — you need logs. Fast. Not "SSH into a server and dig through files" fast. More like "I can see what's happening right now, in my terminal" fast.

Today we're shipping three features that close the debugging gap: prev logs for streaming container output, prev create --logs for watching your deployment come alive, and prev ui for a local mini-dashboard that puts logs, metrics, and environment controls in your browser.

prev logs — Your Container's Stdout, Streamed to Your Terminal

The prev logs command pulls the stdout and stderr output from your running preview environment and prints it directly to your terminal. No setup, no agents, no log aggregation service to configure.

prev logs cosmic-falcon.us.prev.sh

This fetches the most recent logs from the container and exits — similar to docker logs. You'll see whatever your application has written to stdout since it started: HTTP request logs, startup messages, database connections, error traces.

To keep watching in real-time, add the --follow flag:

prev logs --follow cosmic-falcon.us.prev.sh

Now your terminal stays open and new log lines appear as they're emitted. Hit Ctrl+C to stop. This is invaluable when you're actively debugging — deploy a fix, tail the logs, and watch the error either disappear or change shape.

If you only care about errors, filter by stream type:

# Show only stderr output
prev logs --type stderr cosmic-falcon.us.prev.sh

# Show only stdout output
prev logs --type stdout cosmic-falcon.us.prev.sh

The CLI automatically detects the region from the URL. If you pass cosmic-falcon.us.prev.sh, it knows to query the US edge API. No need to specify --region manually.

prev create --logs — Deploy and Watch in One Command

The most common debugging workflow is: deploy, wait, open logs, stare at the output. The --logs flag on prev create collapses this into a single step.

prev --logs .

This deploys your project, waits for the container to start, and immediately begins streaming logs — all in one terminal session. No tab switching. No copying URLs. You watch the build finish, the container boot, and your application start accepting requests, all in the same output stream.

$ prev --logs .
Deploying... done
Preview: https://arctic-penguin.us.prev.sh

[logs] Waiting for container to start...
[logs] Connected — streaming stdout

> next start
  - Local:  http://localhost:3000
  - Ready in 1.2s

GET / 200 in 45ms
GET /api/health 200 in 12ms

When you see the output you need, hit Ctrl+C to stop following. The preview environment keeps running — you're only disconnecting from the log stream.

This is especially useful for catching startup crashes. If your container exits within the first few seconds, you'll see the error output immediately instead of deploying, checking the URL, seeing nothing, and then manually running prev logs to figure out what happened.

prev ui — A Local Mini-Dashboard in Your Browser

Sometimes a terminal isn't enough. You want to see all your environments at a glance, watch logs in a scrollable window, and check resource usage without memorizing CLI flags. That's what prev ui is for.

prev ui

This starts a lightweight local web server and opens your default browser to a mini-dashboard. No login required — it uses the API key from your environment or config file, just like every other prev command.

The dashboard gives you:

  • Environment list — All your active preview environments across all regions, with URLs, TTL countdowns, and status indicators
  • Live log viewer — Click any environment to open a real-time log stream in a dark-themed, scrollable panel. Supports auto-scroll with a pause button when you need to read something higher up
  • Resource metrics — CPU and memory usage for each container, updated live
  • Destroy button — Tear down an environment without going back to the terminal

By default, the dashboard runs on port 3000. If that's taken, pick another:

prev ui --port 3001

The interface uses a dark theme that matches what you'd expect from a developer tool — high contrast text, monospace log output, and minimal chrome. It's designed to sit alongside your editor, not replace your workflow.

How It Works Under the Hood

All three features share the same underlying mechanism: the edge API exposes a log streaming endpoint that the CLI consumes.

When you run prev logs --follow, the CLI opens an SSE (Server-Sent Events) connection to the regional API. On the server side, the API polls the Nomad allocation logs every 2 seconds and pushes new lines over the SSE stream. This keeps the protocol simple — no WebSocket upgrade, no long-polling hacks — just a plain HTTP connection that stays open.

For prev logs without --follow, the CLI makes a single request, receives the current log buffer, and exits. Nomad retains the last 500KB of stdout and stderr per allocation, so you'll always have recent output even if the container has been running for days.

The mini-dashboard (prev ui) is an embedded single-page application compiled directly into the Go binary. The HTML, CSS, and JavaScript are bundled at build time using Go's embed package. When you run prev ui, the CLI starts a local HTTP server that serves the SPA and proxies API requests to the correct regional endpoints.

This means zero external dependencies. No npm install. No Python server. No Docker container for the dashboard. It's a single binary you already have installed, serving a fully functional web UI from memory.

Practical Scenarios

Here are a few situations where these features save real time:

Debugging a startup crash. Your Rails app needs a DATABASE_URL that you forgot to set. You deploy with prev --logs . and immediately see: ActiveRecord::ConnectionNotEstablished: connection to server refused. Fix the env var, redeploy, watch the logs confirm a clean startup.

Monitoring a demo. You're about to show a client your preview. Open prev ui, keep an eye on the log viewer, and confirm the app is healthy before sharing the link. If something breaks during the demo, you already have the logs open.

Debugging region-specific issues. A preview works fine on us.prev.sh but behaves differently on eu.prev.sh. Stream logs from both in parallel:

# Terminal 1
prev logs --follow myapp.us.prev.sh

# Terminal 2
prev logs --follow myapp.eu.prev.sh

Compare the output side by side to spot the difference.

Try It Now

All three features are available in the latest CLI release. Update to the newest version and start streaming:

# Update the CLI
brew upgrade prev
# or
curl -fsSL https://prev.sh/install.sh | sh

# Stream logs from a running environment
prev logs --follow arctic-penguin.us.prev.sh

# Deploy and watch logs in one shot
prev --logs .

# Open the local mini-dashboard
prev ui

Full documentation for prev logs and prev ui is available in the docs. If you run into anything unexpected, reach out at hello@prev.sh — we'd love to hear how you use these in your workflow.