Skip to content

Expose shared analytics through read-only CLI, local API, MCP, and statusline adapters #47

Description

@ekalb81

Outcome

Make Odometer data scriptable and agent-accessible without creating a second parser, database, pricing engine, or analytics implementation.

Current state

  • Product access is the Tauri desktop UI, its IPC commands, filtered file export, and tray.
  • The Rust crate is primarily a Tauri library/binary; there is no supported report CLI, local service, MCP server, or statusline protocol.

Scope

  • Extract a UI-independent application/query service over the provider registry, ledger, project resolver, pricing, diagnostics, and quota services.
  • Add a CLI with stable commands for status, date-range report, sessions, models, projects, categories, tools/context, findings, diagnostics, quotas, and export.
  • Provide versioned JSON/CSV/Markdown output schemas plus responsive human-readable terminal output.
  • Add an optional loopback-only local API with explicit lifecycle, random local authentication, bounded queries, and no remote bind by default.
  • Add a read-only stdio MCP server exposing the same bounded query methods to local agents.
  • Add a low-latency statusline command/payload that does not trigger a full corpus parse on every shell prompt.

DRY boundary

  • Tauri commands, CLI, API, MCP, statusline, tray, and exports adapt one query service.
  • No surface owns SQL, pricing, quota forecasting, provider parsing, or project normalization.
  • Mutating config/guard actions are not exposed through MCP or unauthenticated local HTTP.

Acceptance criteria

  • Equivalent queries across desktop IPC and CLI/JSON return reconciling totals and provenance.
  • Schemas are versioned and backward-compatibility policy is documented.
  • Query limits, cancellation, concurrency, malformed input, and large histories are tested.
  • Local API is disabled by default, binds only to loopback, rejects missing/invalid auth, and publishes no discoverable remote service.
  • MCP descriptions warn about sensitive session metadata and default to aggregate/read-only results.
  • Cold and warm statusline performance budgets prevent repeated full scans.

Dependency and ordering

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions