### Start AgentsView Server Source: https://github.com/wesm/agentsview/blob/main/README.md Starts the AgentsView server and automatically opens the web UI in your browser. ```bash agentsview serve ``` -------------------------------- ### Development Commands for AgentsView Source: https://github.com/wesm/agentsview/blob/main/README.md Commands for setting up a development environment, building the project, and installing the binary. Ensure Go 1.26+ (CGO) and Node.js 22+ are installed. ```bash make dev ``` ```bash make frontend-dev ``` ```bash make build ``` ```bash make install ``` -------------------------------- ### Install and Run Tauri Desktop App Source: https://github.com/wesm/agentsview/blob/main/desktop/README.md Commands to install dependencies and build/run the Tauri desktop application. The prepare-sidecar step is automatic. ```bash npm install npm run tauri:dev npm run tauri:build npm run tauri:build:macos-app npm run tauri:build:windows ``` -------------------------------- ### Start agentsview Server Source: https://context7.com/wesm/agentsview/llms.txt Starts the HTTP server and web UI for browsing sessions. Can be configured with custom ports, hosts, and public URLs for reverse proxying. ```bash agentsview serve ``` ```bash agentsview serve --port 9000 --host 0.0.0.0 ``` ```bash agentsview serve --public-url https://myserver.example.com ``` -------------------------------- ### Install AgentsView on Windows Source: https://github.com/wesm/agentsview/blob/main/README.md Use this PowerShell command to install AgentsView on Windows systems. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://agentsview.io/install.ps1 | iex" ``` -------------------------------- ### Install AgentsView on macOS/Linux Source: https://github.com/wesm/agentsview/blob/main/README.md Use this command to install AgentsView on macOS or Linux systems via curl. ```bash curl -fsSL https://agentsview.io/install.sh | bash ``` -------------------------------- ### Get Daily Cost Summary with Breakdown Source: https://github.com/wesm/agentsview/blob/main/README.md Displays a daily cost summary with a breakdown by model. ```bash agentsview usage daily --breakdown ``` -------------------------------- ### Get Daily Cost Summary Source: https://github.com/wesm/agentsview/blob/main/README.md Prints a summary of daily cost usage for AI coding agents. ```bash agentsview usage daily ``` -------------------------------- ### Run PostgreSQL Integration Tests with Docker Compose Source: https://github.com/wesm/agentsview/blob/main/CLAUDE.md Use these commands to start a PostgreSQL container, run integration tests, and stop the container when finished. ```bash make test-postgres ``` ```bash make postgres-down ``` -------------------------------- ### Get Version Info Source: https://context7.com/wesm/agentsview/llms.txt Retrieve the server version, commit hash, build date, and read-only status. Useful for diagnostics and compatibility checks. ```bash curl "http://127.0.0.1:8080/api/v1/version" ``` -------------------------------- ### Push and Serve PostgreSQL Data with AgentsView Source: https://github.com/wesm/agentsview/blob/main/README.md Use these commands to push local session data to a PostgreSQL instance or serve a read-only web UI from the PostgreSQL data. Refer to the PostgreSQL documentation for setup and configuration. ```bash agentsview pg push ``` ```bash agentsview pg serve ``` -------------------------------- ### Get One-Line JSON Cost Summary Source: https://github.com/wesm/agentsview/blob/main/README.md Outputs a one-line JSON summary of daily costs, suitable for scripting. ```bash agentsview usage daily --all --json ``` -------------------------------- ### Filter Daily Costs by Agent and Date Source: https://github.com/wesm/agentsview/blob/main/README.md Retrieves daily cost summaries, filtered by a specific agent and a start date. ```bash agentsview usage daily --agent claude --since 2026-04-01 ``` -------------------------------- ### Get Human-Readable Session Stats Source: https://github.com/wesm/agentsview/blob/main/README.md Displays a human-readable summary of session statistics over the last 28 days. ```bash agentsview session stats ``` -------------------------------- ### Get Status Line Cost Summary Source: https://github.com/wesm/agentsview/blob/main/README.md Provides a cost summary formatted for status bars or shell prompts. ```bash agentsview usage statusline ``` -------------------------------- ### Get Global Statistics Source: https://context7.com/wesm/agentsview/llms.txt Retrieve global statistics for the server. Useful for monitoring overall system health and performance. ```bash curl "http://127.0.0.1:8080/api/v1/stats" ``` -------------------------------- ### GET /api/v1/sessions/{session_id} Source: https://context7.com/wesm/agentsview/llms.txt Retrieve detailed information for a specific session, including all its messages. ```APIDOC ## GET /api/v1/sessions/{session_id} ### Description Retrieve complete session metadata including messages. ### Method GET ### Endpoint /api/v1/sessions/{session_id} ### Path Parameters - **session_id** (string) - Required - The unique identifier of the session to retrieve. ### Response #### Success Response (200) Returns the full session object, including messages. The exact structure for messages is not detailed in the provided text but would typically include message content, sender, and timestamps. #### Response Example (Example for session details is not provided, but would be similar to the session object in the list endpoint, potentially with an added 'messages' array.) ``` -------------------------------- ### GET /api/v1/sessions Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a paginated list of sessions with optional filtering by project, date range, agent, and session type. ```APIDOC ## GET /api/v1/sessions ### Description Retrieve paginated session list with optional filters. ### Method GET ### Endpoint /api/v1/sessions ### Query Parameters - **project** (string) - Optional - Filter sessions by project name. - **date_from** (string) - Optional - Filter sessions starting from this date (YYYY-MM-DD). - **date_to** (string) - Optional - Filter sessions ending by this date (YYYY-MM-DD). - **agent** (string) - Optional - Filter sessions by agent name (e.g., 'claude'). - **limit** (integer) - Optional - Number of sessions to return per page (default: 100). - **cursor** (string) - Optional - Token for paginating to the next set of results. - **include_one_shot** (boolean) - Optional - Include one-shot sessions in the results. - **include_automated** (boolean) - Optional - Include automated sessions in the results. - **min_user_messages** (integer) - Optional - Filter sessions with at least this many user messages. ### Response #### Success Response (200) - **sessions** (array) - List of session objects. - **id** (string) - Unique identifier for the session. - **project** (string) - Path to the project directory. - **agent** (string) - Name of the AI agent used. - **started_at** (string) - Timestamp when the session started (ISO 8601 format). - **ended_at** (string) - Timestamp when the session ended (ISO 8601 format). - **message_count** (integer) - Total number of messages in the session. - **user_message_count** (integer) - Number of messages sent by the user. - **first_message** (string) - The content of the first message in the session. - **total_output_tokens** (integer) - Total output tokens generated by the agent. - **peak_context_tokens** (integer) - Peak context window size used during the session. - **next_cursor** (string) - Token for fetching the next page of results. - **total_count** (integer) - Total number of sessions matching the query. #### Response Example ```json { "sessions": [ { "id": "abc123-def456", "project": "/Users/dev/myproject", "agent": "claude", "started_at": "2025-04-15T10:30:00Z", "ended_at": "2025-04-15T11:45:00Z", "message_count": 42, "user_message_count": 15, "first_message": "Help me implement user authentication", "total_output_tokens": 15000, "peak_context_tokens": 85000 } ], "next_cursor": "eyJpZCI6...", "total_count": 150 } ``` ``` -------------------------------- ### Get Child Sessions Source: https://context7.com/wesm/agentsview/llms.txt Retrieve child sessions, such as subagents or continuations, for a given session. Useful for understanding session hierarchies. ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/children" ``` -------------------------------- ### Override Desktop Environment Variables Source: https://github.com/wesm/agentsview/blob/main/desktop/README.md Example configurations for overriding environment variables in the AgentsView desktop application. This is useful for ensuring CLIs are accessible or setting API keys. ```bash PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin ``` ```bash ANTHROPIC_API_KEY=... ``` -------------------------------- ### Get Tool Calls for a Session Source: https://context7.com/wesm/agentsview/llms.txt Retrieve tool calls associated with a specific session. Use this to inspect agent tool usage. ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/tool-calls" ``` -------------------------------- ### Sync Session Data Source: https://context7.com/wesm/agentsview/llms.txt Syncs session data from discovered agent directories without starting the server. Supports incremental sync, full resync, and remote sync via SSH. ```bash agentsview sync ``` ```bash agentsview sync --full ``` ```bash agentsview sync --host remote-machine --user myuser --port 22 ``` -------------------------------- ### Get JSON Session Stats for a Date Range Source: https://github.com/wesm/agentsview/blob/main/README.md Outputs session statistics in JSON format for a specified date range. ```bash agentsview session stats --format json --since 2026-04-01 --until 2026-04-15 ``` -------------------------------- ### Get Session Details (REST API) Source: https://context7.com/wesm/agentsview/llms.txt Retrieves complete session metadata, including messages, for a specific session ID. Also provides an endpoint to fetch only the messages for a given session. ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456" ``` ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/messages" ``` -------------------------------- ### Build and Run Development Commands Source: https://github.com/wesm/agentsview/blob/main/CLAUDE.md Commands for building the project, running the Go server in development mode, building the frontend, and running the Vite dev server. ```bash make build # Build binary with embedded frontend make dev # Run Go server in dev mode make frontend # Build frontend SPA only make frontend-dev # Run Vite dev server (use alongside make dev) make install # Build and install to ~/.local/bin or GOPATH make install-hooks # Install pre-commit git hooks ``` -------------------------------- ### GET /api/v1/sessions/{session_id}/messages Source: https://context7.com/wesm/agentsview/llms.txt Retrieve all messages for a specific session. ```APIDOC ## GET /api/v1/sessions/{session_id}/messages ### Description Retrieve all messages for a specific session. ### Method GET ### Endpoint /api/v1/sessions/{session_id}/messages ### Path Parameters - **session_id** (string) - Required - The unique identifier of the session whose messages are to be retrieved. ### Response #### Success Response (200) Returns an array of message objects for the specified session. The exact structure for message objects is not detailed in the provided text but would typically include message content, sender, and timestamps. ``` -------------------------------- ### Build and Run AgentsView Test Server Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Compile the AgentsView binary with specific build tags and linker flags for testing. The `-ldflags` option sets the version, and the output is directed to `/tmp/agentsview-test`. ```bash go build -tags fts5 \ -ldflags "-X main.version=v0.1.0" \ -o /tmp/agentsview-test ./cmd/agentsview /tmp/agentsview-test serve ``` -------------------------------- ### List Projects Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a list of all projects managed by the server. Useful for understanding the organizational structure. ```bash curl "http://127.0.0.1:8080/api/v1/projects" ``` -------------------------------- ### Tag and Push for Desktop Update Test Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Use this command to create and push a new tag for testing the desktop update flow. Ensure the new tag is on a different commit than the previous one. ```bash git commit --allow-empty -m "staging: bump for v0.0.2 test" git tag v0.0.2-staging.1 git push staging tauri-packaging v0.0.2-staging.1 ``` -------------------------------- ### Run Testing Commands Source: https://github.com/wesm/agentsview/blob/main/CLAUDE.md Commands for executing unit tests, short tests, end-to-end tests, linting, and static analysis. ```bash make test # Go tests (CGO_ENABLED=1 -tags fts5) make test-short # Fast tests only (-short flag) make e2e # Playwright E2E tests make lint # golangci-lint + NilAway make vet # go vet ``` -------------------------------- ### CLI Commands Source: https://context7.com/wesm/agentsview/llms.txt Commands for managing the Agentsview server, syncing data, and analyzing sessions. ```APIDOC ## CLI Commands ### Start Server Start the HTTP server and web UI for browsing sessions. ```bash # Basic usage - starts server at http://127.0.0.1:8080 agentsview serve # Custom port and host agentsview serve --port 9000 --host 0.0.0.0 # With optional Caddy reverse proxy for TLS agentsview serve --public-url https://myserver.example.com ``` ### Sync Sessions Sync session data from all discovered agent directories without starting the server. ```bash # Incremental sync (default) agentsview sync # Force full resync of all sessions agentsview sync --full # Remote sync via SSH agentsview sync --host remote-machine --user myuser --port 22 ``` ### Daily Usage Summary Track token costs across all coding agents with detailed breakdowns. ```bash # Daily cost summary (default: last 30 days) agentsview usage daily # Per-model breakdown agentsview usage daily --breakdown # Filter by agent and date range agentsview usage daily --agent claude --since 2025-04-01 --until 2025-04-15 # JSON output for scripting agentsview usage daily --all --json # One-line summary for shell prompts agentsview usage statusline ``` ### Session Statistics Generate analytics over recorded sessions with archetypes and distributions. ```bash # Human-readable summary (last 28 days) agentsview session stats # Machine-readable JSON with date range agentsview session stats --format json --since 2025-04-01 --until 2025-04-15 # Filter by agent agentsview session stats --format json --agent claude | jq '.schema_version' ``` ### PostgreSQL Sync Push session data to PostgreSQL for team dashboards and shared access. ```bash # Push local data to PostgreSQL export AGENTSVIEW_PG_URL="postgres://user:pass@host:5432/dbname" agentsview pg push # Force full push (useful after schema changes) agentsview pg push --full # Push specific projects only agentsview pg push --projects "project-a,project-b" # Check sync status agentsview pg status # Serve web UI from PostgreSQL (read-only mode) agentsview pg serve --port 8080 ``` ### Session Health Analyze session health and signals for quality metrics. ```bash # List recent sessions with health grades agentsview health # Detailed signals for specific session agentsview health # JSON output with custom limit agentsview health --json --limit 100 ``` ### Prune Sessions Delete sessions matching specific filters. ```bash # Dry run to see what would be deleted agentsview prune --project "test-project" --dry-run # Delete sessions with few messages before a date agentsview prune --max-messages 2 --before 2025-01-01 --yes # Delete by first message content agentsview prune --first-message "test" --yes ``` ``` -------------------------------- ### Testing and Linting Commands for AgentsView Source: https://github.com/wesm/agentsview/blob/main/README.md Commands for running tests, linting the code, and performing end-to-end tests. NilAway is used for static analysis. ```bash make test ``` ```bash make lint ``` ```bash make nilaway ``` ```bash make e2e ``` -------------------------------- ### Usage Summary Statistics Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a summary of token consumption and costs for a given date range. Useful for cost tracking. ```bash curl "http://127.0.0.1:8080/api/v1/usage/summary?from=2025-04-01&to=2025-04-30" ``` -------------------------------- ### Generate New Tauri Signing Keypair Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Use the Tauri CLI to generate a new signing keypair for the AgentsView project. This is the first step in rotating the signing key. ```bash npx @tauri-apps/cli signer generate -w ~/.tauri/agentsview-v2.key ``` -------------------------------- ### Generate Tauri Signing Keypair Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Use this command to generate a new Tauri signing keypair for staging or testing purposes. Ensure you use the output for the correct environment variables. ```bash npx @tauri-apps/cli signer generate -w /tmp/staging-updater.key ``` -------------------------------- ### REST API Session List Response Source: https://context7.com/wesm/agentsview/llms.txt Example JSON response structure for the list sessions API endpoint, detailing session metadata and pagination information. ```json { "sessions": [ { "id": "abc123-def456", "project": "/Users/dev/myproject", "agent": "claude", "started_at": "2025-04-15T10:30:00Z", "ended_at": "2025-04-15T11:45:00Z", "message_count": 42, "user_message_count": 15, "first_message": "Help me implement user authentication", "total_output_tokens": 15000, "peak_context_tokens": 85000 } ], "next_cursor": "eyJpZCI6...", "total_count": 150 } ``` -------------------------------- ### Usage Top Sessions by Cost Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a list of top sessions ranked by cost within a date range and limit. Useful for identifying the most expensive sessions. ```bash curl "http://127.0.0.1:8080/api/v1/usage/top-sessions?from=2025-04-01&to=2025-04-30&limit=10" ``` -------------------------------- ### List Agents Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a list of all agents configured on the server. Useful for managing and inspecting agent configurations. ```bash curl "http://127.0.0.1:8080/api/v1/agents" ``` -------------------------------- ### Run PostgreSQL Integration Tests Manually Source: https://github.com/wesm/agentsview/blob/main/CLAUDE.md Execute integration tests against an existing PostgreSQL instance by setting the TEST_PG_URL environment variable and specifying build tags. ```bash TEST_PG_URL="postgres://user:pass@host:5432/dbname?sslmode=disable" \ CGO_ENABLED=1 go test -tags "fts5,pgtest" ./internal/postgres/... -v ``` -------------------------------- ### Reconstruct Apple API key file on runner Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md This command reconstructs the `.p8` private key file on the CI runner using the base64 encoded content stored in the `APPLE_API_KEY_CONTENT` secret. ```bash echo "$APPLE_API_KEY_CONTENT" | base64 --decode > AuthKey_${APPLE_API_KEY}.p8 ``` -------------------------------- ### Base64 encode Apple API key file Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Use this command to base64 encode the downloaded `.p8` private key file. The output is intended to be stored in the `APPLE_API_KEY_CONTENT` GitHub secret. ```bash base64 -i ~/Downloads/AuthKey_ABC123DEF0.p8 | pbcopy ``` -------------------------------- ### Watch Global Data Changes (SSE) Source: https://context7.com/wesm/agentsview/llms.txt Subscribe to server-sent events for global data changes. Use the '-N' flag to disable buffering. ```bash curl -N "http://127.0.0.1:8080/api/v1/events" ``` -------------------------------- ### Export Session as HTML Source: https://context7.com/wesm/agentsview/llms.txt Export a session's content and metadata as an HTML file. The output is redirected to 'session.html'. ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/export" > session.html ``` -------------------------------- ### List Sessions (REST API) Source: https://context7.com/wesm/agentsview/llms.txt Retrieves a paginated list of sessions with optional filters for project, date range, agent, and inclusion of one-shot/automated sessions. Supports pagination via cursor tokens. ```bash curl "http://127.0.0.1:8080/api/v1/sessions" ``` ```bash curl "http://127.0.0.1:8080/api/v1/sessions?project=myproject&date_from=2025-04-01&date_to=2025-04-30" ``` ```bash curl "http://127.0.0.1:8080/api/v1/sessions?agent=claude&limit=50&cursor=" ``` ```bash curl "http://127.0.0.1:8080/api/v1/sessions?include_one_shot=true&include_automated=true" ``` ```bash curl "http://127.0.0.1:8080/api/v1/sessions?min_user_messages=5" ``` -------------------------------- ### Find Code Signing Identity Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Run this command to list available code signing identities on your system. The output helps identify your signing identity and Team ID. ```bash security find-identity -v -p codesigning ``` -------------------------------- ### Skip Login Shell Environment Loading Source: https://github.com/wesm/agentsview/blob/main/desktop/README.md Environment variable to skip the login-shell environment loading process in the AgentsView desktop application. ```bash AGENTSVIEW_DESKTOP_SKIP_LOGIN_SHELL_ENV=1 ``` -------------------------------- ### Full-Text Search with Project Filter Source: https://context7.com/wesm/agentsview/llms.txt Perform a full-text search and filter results by a specific project. This helps narrow down searches to relevant contexts. ```bash curl "http://127.0.0.1:8080/api/v1/search?q=database%20migration&project=backend" ``` -------------------------------- ### Push Branch and Tag for Staging Test Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Commands to push your branch and a test tag to your staging repository. This action triggers the CI pipeline for testing the release process. ```bash git remote add staging git@github.com:YOUR_USER/agentsview.git git push staging tauri-packaging git tag v0.0.1-staging.1 git push staging v0.0.1-staging.1 ``` -------------------------------- ### Publish Session to GitHub Gist Source: https://context7.com/wesm/agentsview/llms.txt Publish a session's content to a GitHub Gist. This is a POST request to the publish endpoint. ```bash curl -X POST "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/publish" ``` -------------------------------- ### Daily Usage Summary Source: https://context7.com/wesm/agentsview/llms.txt Tracks token costs across all coding agents with detailed breakdowns. Can filter by agent and date range, output in JSON, or provide a one-line status summary. ```bash agentsview usage daily ``` ```bash agentsview usage daily --breakdown ``` ```bash agentsview usage daily --agent claude --since 2025-04-01 --until 2025-04-15 ``` ```bash agentsview usage daily --all --json ``` ```bash agentsview usage statusline ``` -------------------------------- ### Force Custom PATH in Desktop App Source: https://github.com/wesm/agentsview/blob/main/desktop/README.md Environment variable to force a custom PATH for the AgentsView desktop application, bypassing default shell loading. ```bash AGENTSVIEW_DESKTOP_PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin ``` -------------------------------- ### List Machines Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a list of all machines registered with the server. Useful for infrastructure monitoring. ```bash curl "http://127.0.0.1:8080/api/v1/machines" ``` -------------------------------- ### Real-Time Events (SSE) Source: https://context7.com/wesm/agentsview/llms.txt Endpoints for subscribing to server-sent events for live updates. ```APIDOC ## GET /api/v1/events ### Description Subscribes to global data change events. ### Method GET ### Endpoint /api/v1/events ## GET /api/v1/sessions/{session_id}/watch ### Description Subscribes to updates for a specific session. ### Method GET ### Endpoint /api/v1/sessions/{session_id}/watch ### Parameters #### Path Parameters - **session_id** (string) - Required - The unique identifier of the session to watch. ### Event Types - **data_changed**: Indicates a global data change. - **data**: {"scope": "sessions"} - **session_updated**: Indicates a specific session has been updated. - **data**: {session_id} - **heartbeat**: A periodic heartbeat event. - **data**: {timestamp} ``` -------------------------------- ### Analytics Activity Over Time Source: https://context7.com/wesm/agentsview/llms.txt Retrieve activity data over time with specified granularity (day, week, month). Useful for tracking trends. ```bash curl "http://127.0.0.1:8080/api/v1/analytics/activity?from=2025-04-01&to=2025-04-30&granularity=day" ``` -------------------------------- ### List Trash Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a list of all sessions currently in the trash. Useful for managing deleted items. ```bash curl "http://127.0.0.1:8080/api/v1/trash" ``` -------------------------------- ### Verify Base64 Encoded API Key Content Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Decode the `APPLE_API_KEY_CONTENT` environment variable to verify it is correctly base64-encoded and represents a PEM private key. ```bash echo "$APPLE_API_KEY_CONTENT" | base64 --decode # Should print: # -----BEGIN PRIVATE KEY----- # (2-3 lines of base64) # -----END PRIVATE KEY----- ``` -------------------------------- ### Export Session as Markdown Source: https://context7.com/wesm/agentsview/llms.txt Export a session's content and metadata as a Markdown file. The output is redirected to 'session.md'. ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/md" > session.md ``` -------------------------------- ### Agentsview Environment Variables Source: https://context7.com/wesm/agentsview/llms.txt Override configuration settings by setting environment variables. This is useful for dynamic configuration or when direct file editing is not feasible. ```bash # Session directories export CLAUDE_PROJECTS_DIR="/custom/claude/path" export CODEX_SESSIONS_DIR="/custom/codex/path" export COPILOT_DIR="/custom/copilot/path" export GEMINI_DIR="/custom/gemini/path" export CURSOR_PROJECTS_DIR="/custom/cursor/path" export AMP_DIR="/custom/amp/path" # Data directory export AGENTSVIEW_DATA_DIR="/custom/data/path" # PostgreSQL export AGENTSVIEW_PG_URL="postgres://user:pass@host:5432/dbname" export AGENTSVIEW_PG_MACHINE="my-laptop" export AGENTSVIEW_PG_SCHEMA="agentsview" ``` -------------------------------- ### Watch Specific Session for Updates (SSE) Source: https://context7.com/wesm/agentsview/llms.txt Subscribe to server-sent events for updates on a specific session. Use the '-N' flag to disable buffering. ```bash curl -N "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/watch" ``` -------------------------------- ### Analytics Top Sessions by Metric Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a list of top sessions based on a specified metric (e.g., output_tokens) within a date range. Useful for identifying high-usage sessions. ```bash curl "http://127.0.0.1:8080/api/v1/analytics/top-sessions?from=2025-04-01&to=2025-04-30&metric=output_tokens" ``` -------------------------------- ### Agentsview TOML Configuration Source: https://context7.com/wesm/agentsview/llms.txt Configure agentsview by editing the `~/.agentsview/config.toml` file. This includes custom session directories, watch exclude patterns, PostgreSQL settings, and custom model pricing. ```toml # Custom session directories (override defaults) claude_project_dirs = ["/path/to/claude/projects", "/another/path"] codex_sessions_dirs = ["/custom/codex/sessions"] # Watch excludes for file watcher watch_exclude_patterns = [".git", "node_modules", ".next", "dist"] # PostgreSQL configuration [pg] url = "postgres://user:pass@host:5432/dbname" machine = "my-laptop" schema = "agentsview" projects = ["project-a", "project-b"] # Optional: only sync these projects exclude_projects = ["test-project"] # Optional: exclude these projects # Custom model pricing overrides [custom_model_pricing] "my-custom-model" = { input_per_mtok = 3.0, output_per_mtok = 15.0 } ``` -------------------------------- ### Restore Session from Trash Source: https://context7.com/wesm/agentsview/llms.txt Restore a session that has been soft-deleted. This is a POST request to the session's restore endpoint. ```bash curl -X POST "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/restore" ``` -------------------------------- ### Usage Summary Filtered by Agent Source: https://context7.com/wesm/agentsview/llms.txt Retrieve usage summary statistics filtered by a specific agent. Useful for analyzing costs associated with particular agents. ```bash curl "http://127.0.0.1:8080/api/v1/usage/summary?from=2025-04-01&to=2025-04-30&agent=claude" ``` -------------------------------- ### Configure Tauri Updater Public Key in tauri.conf.json Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Directly replace the placeholder in `tauri.conf.json` with your updater's public key and specify the release endpoint. This is an alternative to using GitHub secrets for the public key. ```json "plugins": { "updater": { "pubkey": "", "endpoints": [ "https://github.com/wesm/agentsview/releases/latest/download/latest.json" ] } } ``` -------------------------------- ### Analytics Tool Usage Statistics Source: https://context7.com/wesm/agentsview/llms.txt Retrieve statistics on tool usage for a given date range. Useful for understanding which tools are being utilized. ```bash curl "http://127.0.0.1:8080/api/v1/analytics/tools?from=2025-04-01&to=2025-04-30" ``` -------------------------------- ### Paginated Full-Text Search by Recency Source: https://context7.com/wesm/agentsview/llms.txt Perform a paginated full-text search, sorted by recency. Use the 'limit' and 'cursor' parameters for efficient pagination. ```bash curl "http://127.0.0.1:8080/api/v1/search?q=error%20handling&sort=recency&limit=20&cursor=0" ``` -------------------------------- ### PostgreSQL Sync Operations Source: https://context7.com/wesm/agentsview/llms.txt Manages pushing session data to PostgreSQL for team dashboards. Supports full pushes, filtering by project, checking sync status, and serving the web UI from PostgreSQL in read-only mode. ```bash export AGENTSVIEW_PG_URL="postgres://user:pass@host:5432/dbname" agentsview pg push ``` ```bash agentsview pg push --full ``` ```bash agentsview pg push --projects "project-a,project-b" ``` ```bash agentsview pg status ``` ```bash agentsview pg serve --port 8080 ``` -------------------------------- ### Analytics Project Breakdown Source: https://context7.com/wesm/agentsview/llms.txt Retrieve a breakdown of activity by project for a given date range. Useful for understanding project-specific usage. ```bash curl "http://127.0.0.1:8080/api/v1/analytics/projects?from=2025-04-01&to=2025-04-30" ``` -------------------------------- ### Format Markdown Files Source: https://github.com/wesm/agentsview/blob/main/CLAUDE.md Format Markdown files using mdformat with a specific wrap width. Requires the mdformat-tables plugin. ```bash mdformat --wrap 80 ``` -------------------------------- ### Basic Full-Text Search Source: https://context7.com/wesm/agentsview/llms.txt Perform a basic full-text search across all session message content. This is the simplest way to find information across your entire data. ```bash curl "http://127.0.0.1:8080/api/v1/search?q=authentication" ``` -------------------------------- ### Trigger Full Resync Source: https://context7.com/wesm/agentsview/llms.txt Manually trigger a full resynchronization of sessions. This is a POST request to the resync endpoint. ```bash curl -X POST "http://127.0.0.1:8080/api/v1/resync" ``` -------------------------------- ### Star a Session Source: https://context7.com/wesm/agentsview/llms.txt Mark a session as starred. This is a PUT request to the session's star endpoint. ```bash curl -X PUT "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/star" ``` -------------------------------- ### Analytics Activity Heatmap Source: https://context7.com/wesm/agentsview/llms.txt Retrieve data for an activity heatmap, specifying the metric (messages, sessions, or output_tokens). Useful for visualizing activity density. ```bash curl "http://127.0.0.1:8080/api/v1/analytics/heatmap?from=2025-04-01&to=2025-04-30&metric=messages" ``` -------------------------------- ### Set GitHub Actions Secrets for Tauri Build Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Define environment variables in GitHub Actions to pass signing keys and the updater public key to the Tauri build process. The public key is read at compile time. ```yaml env: AGENTSVIEW_UPDATER_PUBKEY: ${{ secrets.AGENTSVIEW_UPDATER_PUBKEY }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` -------------------------------- ### Version and Health API Source: https://context7.com/wesm/agentsview/llms.txt Endpoints for retrieving server version information, global statistics, and listing system resources. ```APIDOC ## GET /api/v1/version ### Description Retrieves the server version information. ### Method GET ### Endpoint /api/v1/version ### Response #### Success Response (200) - **version** (string) - The current server version. - **commit** (string) - The git commit hash. - **build_date** (string) - The build date of the server. - **read_only** (boolean) - Indicates if the server is in read-only mode. ### Response Example ```json { "version": "0.12.1", "commit": "abc123", "build_date": "2025-04-15", "read_only": false } ``` ## GET /api/v1/stats ### Description Retrieves global statistics for the server. ### Method GET ### Endpoint /api/v1/stats ## GET /api/v1/projects ### Description Lists all available projects. ### Method GET ### Endpoint /api/v1/projects ## GET /api/v1/machines ### Description Lists all registered machines. ### Method GET ### Endpoint /api/v1/machines ## GET /api/v1/agents ### Description Lists all available agents. ### Method GET ### Endpoint /api/v1/agents ``` -------------------------------- ### Base64 Encode .p12 Certificate Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Use this command to base64 encode your .p12 certificate file for storage as a GitHub secret. The output string is used for the APPLE_CERTIFICATE secret. ```bash base64 -i "Developer_ID_Application.p12" | pbcopy ``` -------------------------------- ### Delete Session (Soft Delete) Source: https://context7.com/wesm/agentsview/llms.txt Perform a soft delete on a session. The session is moved to the trash and can be restored. ```bash curl -X DELETE "http://127.0.0.1:8080/api/v1/sessions/abc123-def456" ``` -------------------------------- ### Generate Tauri update signing keypair Source: https://github.com/wesm/agentsview/blob/main/docs/desktop-release-setup.md Use the Tauri CLI to generate an Ed25519 keypair for signing application updates. The private key should be kept secret and stored securely, while the public key is compiled into the app. ```bash npx @tauri-apps/cli signer generate -w ~/.tauri/agentsview.key ``` -------------------------------- ### Analytics Summary Statistics Source: https://context7.com/wesm/agentsview/llms.txt Retrieve summary statistics for a given date range. Useful for high-level overviews of system activity. ```bash curl "http://127.0.0.1:8080/api/v1/analytics/summary?from=2025-04-01&to=2025-04-30" ``` -------------------------------- ### Trigger Incremental Sync Source: https://context7.com/wesm/agentsview/llms.txt Manually trigger an incremental sync operation. This endpoint returns SSE progress updates. ```bash curl -X POST "http://127.0.0.1:8080/api/v1/sync" ``` -------------------------------- ### Empty Trash Source: https://context7.com/wesm/agentsview/llms.txt Permanently delete all items currently in the trash. Use with caution. ```bash curl -X DELETE "http://127.0.0.1:8080/api/v1/trash" ``` -------------------------------- ### Trigger Sync API Source: https://context7.com/wesm/agentsview/llms.txt Endpoints for manually triggering session synchronization operations. ```APIDOC ## POST /api/v1/sync ### Description Triggers an incremental synchronization process. Returns SSE progress updates. ### Method POST ### Endpoint /api/v1/sync ## POST /api/v1/resync ### Description Triggers a full resynchronization process. ### Method POST ### Endpoint /api/v1/resync ## GET /api/v1/sync/status ### Description Checks the current status of the synchronization process. ### Method GET ### Endpoint /api/v1/sync/status ``` -------------------------------- ### Usage Statistics API Source: https://context7.com/wesm/agentsview/llms.txt Endpoints for tracking token consumption and cost. ```APIDOC ## GET /api/v1/usage/summary ### Description Retrieves a summary of usage statistics within a date range. ### Method GET ### Endpoint /api/v1/usage/summary ### Parameters #### Query Parameters - **from** (string) - Required - Start date in YYYY-MM-DD format. - **to** (string) - Required - End date in YYYY-MM-DD format. - **agent** (string) - Optional - Filters usage by a specific agent. ## GET /api/v1/usage/top-sessions ### Description Retrieves a list of top sessions ranked by cost. ### Method GET ### Endpoint /api/v1/usage/top-sessions ### Parameters #### Query Parameters - **from** (string) - Required - Start date in YYYY-MM-DD format. - **to** (string) - Required - End date in YYYY-MM-DD format. - **limit** (integer) - Optional - The maximum number of sessions to return. ``` -------------------------------- ### Search Within a Session Source: https://context7.com/wesm/agentsview/llms.txt Perform a search query within the content of a specific session. Useful for finding information within a particular conversation or agent run. ```bash curl "http://127.0.0.1:8080/api/v1/sessions/abc123-def456/search?q=authentication" ``` -------------------------------- ### Session Statistics Source: https://context7.com/wesm/agentsview/llms.txt Generates analytics over recorded sessions, including archetypes and distributions. Supports human-readable summaries or machine-readable JSON output with date range filtering. ```bash agentsview session stats ``` ```bash agentsview session stats --format json --since 2025-04-01 --until 2025-04-15 ``` ```bash agentsview session stats --format json --agent claude | jq '.schema_version' ``` -------------------------------- ### Inspect Session Stats Schema Version Source: https://github.com/wesm/agentsview/blob/main/README.md Filters JSON output of session stats to display only the schema version, useful for checking compatibility. ```bash agentsview session stats --format json --agent claude | jq '.schema_version' ```