Skip to content

Feature: CLI subcommands should optionally query the Postgres sync store, not just local SQLite #392

@ak2k

Description

@ak2k

Love this project!

I run a central Postgres instance that multiple machines agentsview pg push to. agentsview serve on that host gives me the web UI over the aggregated data, but CLI subcommands (session list, usage daily, stats, session messages, etc.) only query the local machine's SQLite — so I can only CLI-query whatever that one machine has generated, not the union across all my machines.

Ask: a --pg flag (or AGENTSVIEW_PG_URL env var) that routes read queries to the configured Postgres instead of local SQLite. Something like:

agentsview --pg session list --since 7d
agentsview --pg usage daily
agentsview --pg stats

Read-only would cover my use case; I don't need CLI writes against central PG.

Alternatives considered:

  • psql directly against the Postgres store — loses agentsview's FTS, cost calculation, tool-call normalization, and the subcommand ergonomics.
  • Hitting agentsview serve's HTTP API — works but isn't a first-class CLI surface, and duplicates what the CLI already does.
  • A hypothetical agentsview pg pull to hydrate local SQLite — would work but round-trips a lot of data just to run one query, and goes stale immediately.

Use case: multi-machine developer (laptop + workstation + VM) who wants unified CLI access to session history/usage without opening a browser.

Related: #346 proposes a stable CLI surface; #326 shipped PG read-only for usage. This request is the natural composition — the CLI surface backed by the PG store.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions