agentsview-cli
Skill5 starsChanged 3 months agoMITView on GitHub
Use when running or scripting the agentsview CLI from the command line — querying, searching, syncing, exporting, or reporting on local AI agent session history. Triggers for cost/usage reports, session search and resume, archive sync, prune/import/export, secret scans, pg/duckdb mirroring, the MCP server, or any `agentsview <command>` invocation, even when the user never says "agentsview" and just asks "what did I spend on Claude this week" or "find where I fixed that timeout". Do NOT use for developing the agentsview codebase itself (parsers, storage, frontend, server internals) — this skill covers CLI usage only.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 113
If a writable daemon is known but unreachable, write commands refuse rather than double-write.
- Distinctive: line 132
Treat output as sensitive.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AgentsView CLI
AgentsView syncs sessions from local AI coding agents (Claude Code, Codex,
Cursor, Copilot, Gemini, and many more) into a local SQLite archive and
exposes them through the agentsview binary plus a web UI. Everything is
local; there are no accounts.
This skill covers the CLI surface only — how to run and script agentsview
commands against the installed binary. It is not a guide to developing
agentsview itself; for parser/storage/frontend work, follow the repo's
AGENTS.md task routes instead. Full upstream docs live in this repo under
docs/ (rendered at agentsview.io); the condensed references in
references/ are enough for most CLI tasks.
Before You Run Anything
- Check the installed version. Features land release by release, so a
binary installed via brew or the install script may be older than the docs
describe. Run
agentsview versionfirst; if a command you need is missing fromagentsview help, confirm it exists in the installed version before assuming the docs are wrong. In this repository the bleeding-edge CLI is also available viago run ./cmd/agentsview <command>. - Data is only as fresh as the last sync. The archive is populated by
sync. If results look missing or stale, run
agentsview syncbefore concluding data does not exist. Freshness-sensitive commands (usage,token-use/session usage) sync on demand by default. - Default to read-only operations. Commands that delete or rebuild data
(
prune,pg push --full,embeddings retire,recallimports) deserve a preview or explicit confirmation first.
Command Router
| Want to... | Command | Details |
| Browse/list sessions | session list | references/sessions.md |
| Resume recent work | session list --resume | references/sessions.md |
| Read a session's messages | session messages <id> | references/sessions.md |
| Search what was said/done | session search | references/sessions.md |
| Session metadata/signals | session get <id>, health [id] | references/sessions.md |
| Tool calls in a session | session tool-calls <id> | references/sessions.md |
| Per-session tokens/cost | session usage <id> | references/usage.md |
| Daily cost report | usage daily | references/usage.md |
| One-line today spend | usage statusline | references/usage.md |
| Active time/concurrency | activity report | references/usage.md |
| Workspace analytics | stats | references/usage.md |
| Refresh the archive | agentsview sync | references/commands.md |
| Serve web UI | agentsview serve / daemon start | references/commands.md |
| List projects | agentsview projects | references/commands.md |
| Delete sessions by filter | agentsview prune (use --dry-run first) | references/commands.md |
| Import Claude.ai/ChatGPT export | agentsview import --type ... <path> | references/commands.md |
| Export summaries/reports | export sessions, export hour|day|digest | references/commands.md |
| Secret leak scan | secrets scan / secrets list | references/commands.md |
| Semantic (meaning-based) search | embeddings build, --semantic/--hybrid | references/search.md |
| Durable knowledge layer | recall query/brief/... | references/search.md |
| Mirror to PostgreSQL | pg push / pg serve / pg service | references/remote-mcp.md |
| Mirror to DuckDB | duckdb push / duckdb serve | references/remote-mcp.md |
| Expose history to assistants | agentsview mcp | references/remote-mcp.md |
| Diagnose sync problems | agentsview doctor sync | references/commands.md |
| Config file, data dir, agent dirs | ~/.agentsview/config.toml, env vars | references/configuration.md |
Core Workflow
agentsview version # what is installed
agentsview sync # refresh archive (safe, incremental)
agentsview session list --limit 10 --jsonSearching history. Exact identifiers (error strings, paths, tool names) → substring/FTS search. Conceptual questions ("how did we handle X") → hybrid semantic search when the embedding index is set up, otherwise several short FTS probes. See references/sessions.md for modes and fallbacks.
agentsview session search "exact error text" --fts --json --limit 8
agentsview session search "deploy pipeline flaky" --hybrid --context 2 --jsonInspecting a hit. A search match is a lead. Center a message window on the match's ordinal before drawing conclusions:
agentsview session messages <session-id> --around <ordinal> --before 8 --after 8 --jsonCosts. usage daily aggregates cost by day (30-day default window).
session usage <id> gives one session's tokens and cost. Both read from the
indexed archive; --offline skips the network pricing fetch.
Deleting. prune requires at least one filter and always preview first:
agentsview prune --project scratch --max-messages 2 --dry-runDaemon Model (What Happens Under the Hood)
A detached daemon owns SQLite writes for the data directory. Read-only CLI
commands attach to it when running, otherwise open SQLite read-only directly —
so one-off reads stay fast and scripts never fight over the write lock.
Commands that write or need fresh data (sync, session sync, usage,
pg push, duckdb push) auto-start the daemon. Consequences:
- Set
AGENTSVIEW_NO_DAEMON=1in CI/scripts that must never spawn a daemon; writes then require acquiring the write-owner lock directly. - The daemon self-exits after idle timeout (default 20m); long-lived integrations should tolerate it restarting.
- If a writable daemon is known but unreachable, write commands refuse rather
than double-write. Check
agentsview daemon status.
Conventions
- Structured commands accept
--format json;--jsonis the alias. Prefer JSON when piping into scripts; human output is tuned for terminal reading. - Relative time windows use
--since Nh|Nd|Nw|Nm|Ny—mmeans calendar months, not minutes.--date/--date-from/--date-totakeYYYY-MM-DD. --project,--agent, and--machinefilters apply across most commands.- One-shot and automated sessions are excluded from
session listand search by default; re-include with--include-one-shot/--include-automated. - Session IDs vary by agent: Claude UUIDs (
550e8400-...), Claude subagents (agent-a86574e), prefixed forms (codex:my-session-id). Copy IDs fromsession listoutput rather than guessing.
Safety
- Session archives contain prompts, file paths, and possibly credentials. Treat output as sensitive; never paste secrets from sessions into examples.
secrets listredacts by default;--revealis localhost-only for a reason.AGENTSVIEW_DATA_DIRredirects everything (db, config, logs) — useful for scratch experiments so the production archive is never touched.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

