peekm

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 28 Imported by: 0

README ΒΆ

peekm

Go Report Card GitHub Release

The markdown viewer built for AI-assisted development

peekm demo

Watch your AI write documentation live. See which session created every file. Get toast notifications the instant something changes β€” no hunting through file trees, no manual refresh, no breaking your flow.

peekm README.md    # Install, run, done.

Works beautifully for everyone else, too β€” zero-config live preview with GitHub styling, directory browsing, and dark/light themes.

Perfect for:

  • πŸ€– AI coding workflows β€” See which AI session created or modified each file, live as it happens
  • πŸ€– Multi-session projects β€” Track which AI conversation touched which files
  • πŸ“– Documentation, writing, PR reviews β€” Centered layout, live reload, distraction-free

Quick Start β€’ AI Session Tracking β€’ Comparison

Quick Start

# Install
brew install razvandimescu/tap/peekm

# Start viewing
peekm .

That's it. No config, no runtime dependencies.

Optional: Connect to Claude Code for AI session tracking:

peekm setup claude-code    # One-time setup

AI session badges now appear automatically when Claude Code creates or modifies files. Learn more β†’

AI Session Tracking

peekm automatically tracks which AI session created or modified each file. This works out of the box β€” the tracking endpoint is always active.

One-time setup to connect your AI coding assistant:

peekm setup claude-code              # Configure Claude Code integration
peekm setup claude-code --port 8080  # Use custom port
peekm setup claude-code --remove     # Remove integration

The setup command:

  • Creates the hook script (~/.claude/peekm-hook.sh)
  • Merges PostToolUse hooks into Claude Code's settings.json
  • Is idempotent β€” safe to run multiple times
  • Is non-destructive β€” preserves your existing settings

What you get:

  • Toast notifications when AI creates or modifies markdown files
  • Session badges showing which AI session touched each file
  • Info panel with session ID, operation type, permission mode, and timestamp
  • Notification history (bell icon) with the last 10 file changes

peekm vs. The World

Feature Glow grip VS Code peekm
Best for Terminal purists GitHub preview VS Code users AI-assisted development
Live reload ❌ Static ❌ Manual refresh βœ… βœ… SSE-based
AI session tracking ❌ ❌ ❌ βœ… Built-in
Sidebar + zen mode ❌ ❌ ❌ Persistent only βœ… Cmd/Ctrl+B toggle
Comfortable layout ❌ Terminal only ❌ Full-width ❌ Splits editor βœ… Centered 900px
Directory browser βœ… TUI list ❌ Single file ❌ File explorer βœ… Web UI tree
Works offline βœ… ❌ GitHub API βœ… βœ…
Zero dependencies βœ… Single binary ❌ Python runtime ❌ Needs VS Code βœ… Single binary
Startup time Fast ~2s Editor launch < 100ms

Features

VS Code-Style Navigation

Navigate your documentation with a familiar sidebar. Need full-width focus? Hit Cmd/Ctrl+B to hide the sidebar.

  • 280px tree view β€” collapsible folders with indent-based hierarchy
  • Smart defaults β€” auto-opens README.md or most recent file
  • Independent scrolling β€” sidebar and content scroll separately
  • Current file highlighting β€” see your location in the project
  • Multi-tab support β€” Cmd/Ctrl+Click opens files in new tabs
Zero Friction
  • Single binary β€” download and run, nothing to install
  • No configuration β€” works perfectly out of the box
  • Instant startup β€” under 100ms to first render
Live Workflow
  • Auto-reload on save β€” see changes instantly via Server-Sent Events
  • Event replay β€” reconnecting clients catch up on missed events
  • Directory navigation β€” console-like Ξ» button to navigate between directories
  • Theme switching β€” Light/Dark/Auto with localStorage persistence
  • HTML export β€” download self-contained HTML for sharing
  • Live editing β€” edit markdown files directly in browser
Production-Ready
  • Secure β€” whitelist-based file access, CSRF protection, symlink validation, path traversal protection, $HOME boundary enforcement
  • Fast β€” ~8MB memory footprint, embedded resources
  • Cross-platform β€” works on macOS, Linux, and Windows
  • GitHub-Flavored Markdown β€” full GFM support with syntax highlighting
  • Graceful shutdown β€” clean resource cleanup on SIGINT/SIGTERM

Installation

Option 1: Quick Install

# macOS/Linux
curl -L https://github.com/razvandimescu/peekm/releases/latest/download/peekm_$(uname -s)_$(uname -m).tar.gz | tar xz && sudo mv peekm /usr/local/bin/

Option 2: Homebrew

brew install razvandimescu/tap/peekm

Option 3: Go Install

go install github.com/razvandimescu/peekm@latest

Option 4: Download Binary

Download from the releases page for your platform (macOS, Linux, Windows).

Usage

# View a specific file (opens in unified layout with sidebar)
peekm README.md

# Browse a directory
peekm .
peekm ../docs

# Custom port
peekm -port 8080 .

# Don't auto-open browser
peekm -browser=false .

# Setup AI session tracking
peekm setup claude-code
Options
Flag Default Description
-port 6419 Port to serve on
-browser true Automatically open browser
-version false Show version information
-show-ignored false Show all excluded directories and exit
-no-ai-tracking false Disable AI session tracking endpoint
Subcommands
Command Description
setup claude-code Configure Claude Code integration (one-time)
setup claude-code --remove Remove Claude Code integration
setup claude-code --port PORT Configure with custom port

Ignoring Directories

peekm automatically excludes common directories:

  • .* (hidden directories like .git, .vscode β€” except .claude)
  • node_modules, vendor, dist, venv, env, virtualenv

To add custom exclusions, create .peekmignore in your project root:

# .peekmignore - Project-specific exclusions
target
_site
out
*.tmp
*.cache

Syntax: One pattern per line. Simple paths, wildcards (*.tmp, test_*), and comments (#).

peekm --show-ignored           # See all exclusions
peekm --show-ignored ~/myapp   # Check exclusions for a directory

When You Need peekm

AI-Assisted Development
peekm .
# Ask Claude Code: "Create API docs in docs/api.md"
# β†’ Toast notification appears instantly
# β†’ Click to view the new file
# β†’ Watch live as AI writes
Onboarding to a New Project
git clone github.com/awesome/project && cd project
peekm docs/    # Browse all documentation with a visual tree
Writing Documentation
peekm README.md    # Edit in your favorite editor, preview updates instantly
Code Review
git checkout feature-branch
peekm CHANGELOG.md    # Beautiful rendering, auto-reloads on branch switch

How It Works

  1. Parse β€” Converts markdown to HTML using goldmark
  2. Serve β€” Starts a local HTTP server with graceful shutdown
  3. Watch β€” Monitors file changes using fsnotify
  4. Reload β€” Sends live updates via Server-Sent Events (SSE) with event replay
  5. Track β€” Receives AI session metadata and correlates with file changes
  6. Render β€” Applies GitHub styling with embedded CSS (zero runtime dependencies)

Development

Requirements
  • Go 1.21 or higher
Building
go build -o peekm
go test -race ./...
Project Structure
peekm/
β”œβ”€β”€ main.go                    # Single-file Go implementation with embedded resources
└── theme/                     # Embedded resources (loaded at build time)
    β”œβ”€β”€ github-markdown.css    # Official GitHub markdown CSS
    β”œβ”€β”€ theme-overrides.css    # Theme switching CSS
    β”œβ”€β”€ theme-manager.js       # Shared theme management logic
    β”œβ”€β”€ navigation.js          # SPA navigation, notifications, search
    β”œβ”€β”€ editor.js              # Markdown editing functionality
    β”œβ”€β”€ file-browser.html      # Unified template (browser + file views)
    └── session-info-panel.html # AI session metadata panel

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License β€” see LICENSE file for details.

Acknowledgments

  • goldmark β€” Markdown parser
  • fsnotify β€” Cross-platform file watching
  • chroma β€” Syntax highlighting
  • glow β€” Terminal markdown renderer (21k+ stars)
  • grip β€” GitHub-flavored markdown preview (6.7k stars)
  • VS Code Markdown Preview β€” Built-in editor preview

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL