Skip to content
GitHub stars

CLI Reference

Commands

agentsview / agentsview serve

Start the HTTP server with embedded web UI.

Terminal window
agentsview [flags]
agentsview serve [flags]
FlagDefaultDescription
-host127.0.0.1Host to bind to
-port8080Port to listen on
-no-browserfalseDon’t open browser on startup

The server auto-discovers an available port if 8080 is busy.

Examples:

Terminal window
agentsview # defaults
agentsview -port 9090 # custom port
agentsview -host 0.0.0.0 # bind to all interfaces
agentsview -host 0.0.0.0 -no-browser # headless mode

On startup, the server:

  1. Loads or creates ~/.agentsview/sessions.db
  2. Runs initial sync across all discovered session directories
  3. Starts the file watcher (500ms debounce)
  4. Starts periodic sync (every 15 minutes)
  5. Serves the Svelte SPA and REST API

agentsview prune

Delete sessions matching one or more filters. At least one filter is required.

Terminal window
agentsview prune [flags]
FlagDefaultDescription
-projectSessions whose project contains this substring
-max-messages-1Sessions with at most N messages
-beforeSessions that ended before this date (YYYY-MM-DD)
-first-messageSessions whose first message starts with this text
-dry-runfalseShow what would be pruned without deleting
-yesfalseSkip confirmation prompt

Examples:

Terminal window
# Preview what would be deleted
agentsview prune -project "scratch" -dry-run
# Delete short sessions from before 2025
agentsview prune -max-messages 2 -before 2025-01-01
# Delete sessions starting with a specific message
agentsview prune -first-message "test" -yes
# Combine filters (AND logic)
agentsview prune -project "old-project" -max-messages 5 -before 2025-06-01

The prune command displays the number of sessions deleted and disk space reclaimed. Use -dry-run first to verify the filter matches what you expect.


agentsview version

Print the version, git commit, and build date.

Terminal window
agentsview version
agentsview v0.1.0 (abc1234) built 2025-01-15

agentsview help

Print usage information.

Terminal window
agentsview help

Environment Variables

VariableDefaultDescription
CLAUDE_PROJECTS_DIR~/.claude/projectsClaude Code projects directory
CODEX_SESSIONS_DIR~/.codex/sessionsCodex sessions directory
COPILOT_DIR~/.copilotCopilot CLI sessions directory
GEMINI_DIR~/.geminiGemini CLI directory
OPENCODE_DIR~/.local/share/opencodeOpenCode data directory
AGENT_VIEWER_DATA_DIR~/.agentsviewData directory (database, config)

Environment variables override the built-in defaults. Set them in your shell profile or pass them inline:

Terminal window
AGENT_VIEWER_DATA_DIR=/tmp/av-test agentsview