agentviewer
A localhost web server that allows AI agents (Claude Code, etc.) to display rich content to users in a browser.
Features
- Tabbed browser interface for viewing multiple documents
- Markdown with GitHub Flavored Markdown, Mermaid diagrams, and LaTeX math
- Code with syntax highlighting (180+ languages)
- Diffs with side-by-side comparison view
- Live updates via WebSocket - content updates instantly in the browser
- REST API for programmatic control by AI agents
┌─────────────────┐ WebSocket ┌─────────────────┐
│ Browser Tab │◄────────────────►│ agentviewer │
│ (localhost) │ │ HTTP Server │
└─────────────────┘ └────────▲────────┘
│ REST API (curl)
┌────────┴────────┐
│ Claude / Agent │
└─────────────────┘
Installation
macOS (Homebrew)
brew install pengelbrecht/tap/agentviewer
Windows (Scoop)
scoop bucket add agentviewer https://github.com/pengelbrecht/scoop-agentviewer
scoop install agentviewer
Windows (Winget)
winget install pengelbrecht.agentviewer
Note: Winget package pending submission to winget-pkgs repository.
Windows (Binary)
Download from GitHub Releases:
# Download and add to PATH
Invoke-WebRequest -Uri "https://github.com/pengelbrecht/agentviewer/releases/latest/download/agentviewer-windows-amd64.exe" -OutFile "$env:LOCALAPPDATA\agentviewer.exe"
$env:PATH += ";$env:LOCALAPPDATA"
Or download agentviewer-windows-amd64.exe manually and add to your PATH.
Linux (apt/deb - Debian, Ubuntu)
# Download and install .deb package
curl -LO https://github.com/pengelbrecht/agentviewer/releases/latest/download/agentviewer_$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/').deb
sudo dpkg -i agentviewer_*.deb
Linux (rpm - Fedora, RHEL, CentOS)
# Download and install .rpm package
curl -LO https://github.com/pengelbrecht/agentviewer/releases/latest/download/agentviewer.$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/').rpm
sudo rpm -i agentviewer.*.rpm
macOS/Linux (Binary)
Download the latest release for your platform:
# Detect platform and download
curl -L "https://github.com/pengelbrecht/agentviewer/releases/latest/download/agentviewer-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')" -o agentviewer
chmod +x agentviewer
sudo mv agentviewer /usr/local/bin/
Or download manually from GitHub Releases.
Available binaries:
agentviewer-darwin-arm64 - macOS Apple Silicon (M1/M2/M3)
agentviewer-darwin-amd64 - macOS Intel
agentviewer-linux-amd64 - Linux x86_64
agentviewer-linux-arm64 - Linux ARM64
agentviewer-windows-amd64.exe - Windows x86_64
Available packages:
agentviewer_<version>_amd64.deb - Debian/Ubuntu x86_64
agentviewer_<version>_arm64.deb - Debian/Ubuntu ARM64
agentviewer-<version>.amd64.rpm - Fedora/RHEL x86_64
agentviewer-<version>.arm64.rpm - Fedora/RHEL ARM64
Go Install
If you have Go 1.22+ installed:
go install github.com/pengelbrecht/agentviewer@latest
From Source
git clone https://github.com/pengelbrecht/agentviewer
cd agentviewer
make install
This installs to $GOBIN (usually ~/go/bin). Ensure this is in your PATH.
Verify Installation
agentviewer --version
agentviewer serve --help
Quick Start
-
Start the server (opens browser automatically):
agentviewer serve --open
-
Create content via API:
curl -X POST http://localhost:3333/api/tabs \
-H "Content-Type: application/json" \
-d '{"title": "Hello", "type": "markdown", "content": "# Hello World\n\nThis is **bold** text."}'
-
View in browser at http://localhost:3333
Usage
Command Line
# Start server (foreground, blocks)
agentviewer serve
# Start server and open browser
agentviewer serve --open
# Custom port
agentviewer serve --port 4000
# Start with initial file
agentviewer serve --open README.md
REST API
Base URL: http://localhost:3333/api
| Method | Endpoint | Description |
|---|
| POST | /api/tabs | Create or update a tab |
| GET | /api/tabs | List all tabs |
| GET | /api/tabs/:id | Get tab content |
| DELETE | /api/tabs/:id | Delete a tab |
| DELETE | /api/tabs | Delete all tabs |
| POST | /api/tabs/:id/activate | Switch to a tab |
| GET | /api/status | Server status |
API Examples