Skip to content
GitHub stars

CLI Reference

Commands

agentsview serve

Start the HTTP server with embedded web UI.

Terminal window
agentsview serve [flags]

As of 0.23.0, starting the server requires the explicit serve subcommand. Running plain agentsview shows help instead of starting the web UI.

FlagDefaultDescription
--host127.0.0.1Host to bind to
--port8080Port to listen on
--no-browserfalseDon’t open browser on startup
--no-update-checkfalseDisable automatic update checks
--public-urlPublic URL for hostname or proxy access
--public-originTrusted browser origin (repeatable/comma-separated)
--proxyManaged proxy mode (caddy)
--caddy-bincaddyCaddy binary path
--proxy-bind-host127.0.0.1Interface for managed proxy
--public-port8443External port for managed proxy
--tls-certTLS certificate path
--tls-keyTLS key path
--allowed-subnetClient CIDR allowlist (repeatable/comma-separated)

The server auto-discovers an available port if 8080 is busy. See Remote Access for details on the remote access and proxy flags.

Examples:

Terminal window
agentsview serve # defaults
agentsview serve --port 9090 # custom port
agentsview serve --no-browser # disable browser auto-open
agentsview serve --public-url https://agents.example.com

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

The server shuts down cleanly on Ctrl+C, flushing the database and stopping file watchers.


agentsview sync

Run the sync engine to populate the database, then exit without starting the HTTP server. Useful for scripting, CI, or refreshing data after config changes.

Terminal window
agentsview sync [flags]
FlagDefaultDescription
--fullfalseForce a full resync regardless of data version
--hostSSH hostname for remote sync
--userSSH username for remote sync
--port22SSH port for remote sync

Examples:

Terminal window
agentsview sync # incremental sync and exit
agentsview sync --full # full resync and exit
agentsview sync --host buildbox.local
agentsview sync --host buildbox.local --user wes --port 2222

After syncing, a summary of session and message counts is printed to stdout.

When --host is set, AgentsView performs a remote sync over SSH: it resolves the supported agent session directories on the remote machine, transfers the source session data locally, and indexes it into your local archive.


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 0.23.0 (commit d49f1a9, built 2026-04-19)

agentsview usage daily

Report token usage and estimated cost aggregated by local-time day, scoped to the last 30 days by default. See Token Usage & Costs for a full write-up, including benchmarks against ccusage.

Terminal window
agentsview usage daily [flags]
FlagDefaultDescription
--jsonfalseEmit JSON instead of a terminal table
--since30 days agoStart date (YYYY-MM-DD), inclusive
--untilEnd date (YYYY-MM-DD), inclusive
--allfalseScan all history; overrides the default 30-day window
--agentFilter by agent name
--breakdownfalseShow indented per-model rows under each day
--offlinefalseSkip the LiteLLM pricing fetch; use embedded fallback
--no-syncfalseSkip the on-demand sync pass before querying
--timezonesystemIANA timezone name for date bucketing

Examples:

Terminal window
agentsview usage daily # last 30 days
agentsview usage daily --all # full history
agentsview usage daily --since 2026-04-01 --breakdown
agentsview usage daily --json --agent claude

agentsview usage statusline

Print today’s total estimated cost as a single line, for shell prompts and tmux status lines.

Terminal window
agentsview usage statusline [flags]
FlagDefaultDescription
--agentFilter by agent name
--offlinefalseUse embedded fallback pricing only
--no-syncfalseSkip on-demand sync

Example:

Terminal window
$ agentsview usage statusline
$9.61 today

See Token Usage & Costs for integration examples (Starship, tmux).


agentsview token-use

Print machine-readable token usage data and a cost estimate for a single session.

Terminal window
agentsview token-use <session-id>

Session ID format depends on the agent. For example, Claude root sessions usually use UUIDs like 550e8400-e29b-41d4-a716-446655440000, Claude subagents use IDs like agent-a86574e, and some other agents use prefixes such as codex:my-session-id. Raw session IDs emitted by the underlying agent are also accepted when AgentsView can resolve them back to the canonical stored session.

If the AgentsView server is already running, the command reads the current database state. If no server is running, it performs an on-demand sync for the requested session first.

Example:

Terminal window
agentsview token-use 550e8400-e29b-41d4-a716-446655440000
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"agent": "claude",
"project": "my-project",
"total_output_tokens": 15230,
"peak_context_tokens": 84000,
"has_token_data": true,
"cost_usd": 2.41,
"has_cost": true,
"models": ["claude-opus-4-7"],
"server_running": false
}

See agentsview session usage for the full field reference and exit-code contract.


agentsview pg push

Sync sessions from local SQLite to PostgreSQL. See PostgreSQL Sync for full documentation.

Terminal window
agentsview pg push [flags]
FlagDefaultDescription
--fullfalseForce full local resync and re-push
--projectsComma-separated projects to push (inclusive)
--exclude-projectsComma-separated projects to exclude from push
--all-projectsfalseIgnore configured project filters for this run
--watchfalseRun continuously, pushing on change plus a periodic floor
--debounce30sCoalesce window after a change before pushing (--watch only)
--interval15mPeriodic floor push interval (--watch only)

See PostgreSQL Sync — Project Filtering for details on how filtering interacts with the push watermark.


agentsview pg status

Show PostgreSQL sync status.

Terminal window
agentsview pg status

agentsview pg serve

Start a read-only web UI backed by PostgreSQL. See PostgreSQL Sync for full documentation.

Terminal window
agentsview pg serve [flags]

Accepts the same serve flags (--host, --port, --proxy, etc.) plus PostgreSQL configuration from config.toml.


agentsview pg service

Install and manage the PostgreSQL auto-push service, which runs agentsview pg push --watch in the background. Supported service managers are launchd on macOS and systemd --user on Linux. See PostgreSQL Sync — agentsview pg service for setup notes.

Terminal window
agentsview pg service install
agentsview pg service status
agentsview pg service logs [-f]
agentsview pg service start
agentsview pg service stop
agentsview pg service uninstall
CommandDescription
installGenerate the service unit, enable it, and start it
statusShow the service-manager status plus last successful push
logs -fFollow pg-watch.log under the AgentsView data directory
startStart the installed service
stopStop the installed service
uninstallStop and remove the service unit

agentsview projects

List all projects in the local database with their session counts.

Terminal window
agentsview projects [flags]
FlagDefaultDescription
--jsonfalseOutput as a JSON array

Examples:

Terminal window
agentsview projects # tabular output
agentsview projects --json # JSON array

agentsview health

Inspect session intelligence in a human-friendly CLI view. See Session Intelligence for the scoring and signal model.

Terminal window
agentsview health [session-id] [flags]
FlagDefaultDescription
--jsonfalseOutput JSON instead of terminal text
--limit20Number of sessions to list when no session ID is given

Examples:

Terminal window
agentsview health
agentsview health --limit 50
agentsview health 550e8400-e29b-41d4-a716-446655440000
agentsview health agent-a86574e --json

Without a session ID, the command lists recent sessions with grade and outcome columns. With a session ID, it prints the detailed signal counts for that session.


agentsview stats

Experimental window-scoped workspace analytics across sessions and git activity. See Stats for the full write-up.

Terminal window
agentsview stats [flags]
FlagDefaultDescription
--formathumanOutput format: human or json
--since28dStart of window, either YYYY-MM-DD or a compact duration like 28d
--untilEnd of window as YYYY-MM-DD
--agentallRestrict to one agent or use all
--include-projectRepeatable project allowlist
--exclude-projectRepeatable project blocklist
--timezonelocalTimezone used for temporal reporting

Examples:

Terminal window
agentsview stats
agentsview stats --format json --since 2026-04-01 --until 2026-04-15
agentsview stats --agent claude --include-project agentsview

The command is experimental. The exact human output may change, and the JSON output should be treated as a moving surface even though it currently carries schema_version: 1.


agentsview import

Import Claude.ai or ChatGPT conversations into the local database. See Chat Import for full documentation.

Terminal window
agentsview import --type <type> <path>
FlagDefaultDescription
--typeImport type: claude-ai or chatgpt (required)

The path can be a .zip file, a conversations.json file (Claude.ai only), or a directory containing the extracted export.

Examples:

Terminal window
agentsview import --type claude-ai ~/Downloads/claude.zip
agentsview import --type chatgpt ~/Downloads/chatgpt.zip
agentsview import --type claude-ai ./conversations.json

agentsview session

Programmatic access to session data for scripts, automation agents, and CI jobs. See Session API for full documentation, including stability guarantees, transport auto-detection, and every subcommand.

Terminal window
agentsview session get <id> # metadata + signals
agentsview session list [flags] # filtered list
agentsview session messages <id> # paginated messages
agentsview session tool-calls <id> # flat tool-call list
agentsview session export <id> # stream raw source file
agentsview session sync <path-or-id> # parse + insert
agentsview session watch <id> # NDJSON event stream
agentsview session search <pattern> # content search across sessions
agentsview session usage <id> # token usage and cost estimate

Use agentsview health for a human-first signal view and Session API for the full programmatic contract, including transport behavior and markdown export details.


agentsview secrets

Scan for and list detected secret leaks across sessions, with matches redacted by default. See Secret Scanning for the full detector set, storage shape, and HTTP API.

Terminal window
agentsview secrets scan [flags] # scan sessions for leaks
agentsview secrets list [flags] # list stored findings

secrets scan walks the archive, applies the full ruleset (definite + candidate tiers), and writes new findings to the secret_findings table. Pass --backfill to scan only sessions that haven’t yet been scanned at the current ruleset version — the inline scan that runs during sync only stamps definite-tier findings, so --backfill is how you pick up the heuristic candidates without re-scanning the whole archive.

secrets list returns redacted findings by default. Pass --reveal to print the raw values — this only works against a localhost-bound daemon and emits a warning to stderr.

FlagUsed byDescription
--formatbothhuman or json (inherited from secrets)
--backfillscanScan only sessions not yet scanned at the current ruleset version
--projectbothLimit to a project
--agentbothLimit to an agent
--date-frombothSessions on or after YYYY-MM-DD
--date-tobothSessions on or before YYYY-MM-DD
--rulelistFilter by rule name (e.g. aws-access-key)
--confidencelistdefinite, candidate, or all (default definite)
--reveallistShow unredacted values (localhost-only)
--limitlistMax findings (default 50, max 500)
--cursorlistPagination cursor from a previous response

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
CURSOR_PROJECTS_DIR~/.cursor/projectsCursor transcripts directory
GEMINI_DIR~/.geminiGemini CLI directory
OPENCODE_DIR~/.local/share/opencodeOpenCode data directory
OPENHANDS_CONVERSATIONS_DIR~/.openhands/conversationsOpenHands CLI conversations directory
AMP_DIR~/.local/share/amp/threadsAmp threads directory
VSCODE_COPILOT_DIR(platform-specific)VS Code Copilot sessions directory
POSITRON_DIR(platform-specific)Positron Assistant user directory
OPENCLAW_DIR~/.openclaw/agentsOpenClaw agents directory
QCLAW_DIR~/.qclaw/agentsQClaw agents directory
PI_DIR~/.pi/agent/sessionsPi sessions directory
IFLOW_DIR~/.iflow/projectsiFlow projects directory
ZENCODER_DIR~/.zencoder/sessionsZencoder sessions directory
KIMI_DIR~/.kimi/sessionsKimi sessions directory
QWEN_PROJECTS_DIR~/.qwen/projectsQwen Code projects directory
WORKBUDDY_PROJECTS_DIR~/.workbuddy/projectsWorkBuddy projects directory
WARP_DIR(platform-specific)Warp database directory
HERMES_SESSIONS_DIR~/.hermes/sessionsHermes Agent sessions directory
CORTEX_DIR~/.snowflake/cortex/conversationsCortex Code conversations directory
KIRO_SESSIONS_DIR~/.kiro/sessions/cli and ~/.local/share/kiro-cliKiro CLI sessions directory (JSONL and SQLite)
KIRO_IDE_DIR(platform-specific)Kiro IDE sessions directory
FORGE_DIR~/.forgeForge directory (contains .forge.db)
PIEBALD_DIR~/.local/share/piebaldPiebald directory (contains app.db)
ANTIGRAVITY_DIR~/.gemini/antigravityGoogle Antigravity IDE sessions directory
ANTIGRAVITY_CLI_DIR~/.gemini/antigravity-cliGoogle Antigravity CLI sessions directory
ANTIGRAVITY_KEYOptional key for decrypting Antigravity CLI .pb transcripts (defaults to summary mode without it)
AGENTSVIEW_DATA_DIR~/.agentsviewData directory (database, config)
AGENTSVIEW_PG_URLPostgreSQL connection URL
AGENTSVIEW_PG_MACHINEMachine name for PG push sync
AGENTSVIEW_PG_SCHEMAagentsviewPostgreSQL schema name
AGENTSVIEW_GITHUB_TOKENGitHub token used by agentsview stats for PR aggregation
AGENTSVIEW_DISABLE_UPDATE_CHECKSet to 1 to disable the update check

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

Terminal window
AGENTSVIEW_DATA_DIR=/tmp/av-test agentsview serve