Skip to content

feat(cli,insights): wire --db path override and add --no-llm data-only mode - #7

Open
lorecanc wants to merge 1 commit into
rchardx:mainfrom
lorecanc:feat/db-and-no-llm
Open

lorecanc wants to merge 1 commit into
rchardx:mainfrom
lorecanc:feat/db-and-no-llm

Conversation

@lorecanc

@lorecanc lorecanc commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Two small fixes around the insights pipeline:

  1. --db PATH — the insights orchestrator already read args.db (getattr(args, "db", None)), but no parser flag ever set it, so the path could only be overridden via the OPENCODE_DB env var. This wires the flag through both run and insights, and _cmd_run now opens the DB at the requested path.

  2. --no-llm — lets you generate a data-only insights report without invoking any LLM (previously only possible implicitly when the LLM phase failed).

Changes

  • src/opencode_usage/cli.py: --db on run/insights, --no-llm on insights, OpenCodeDB(args.db) in _cmd_run
  • src/opencode_usage/insights/orchestrator.py: skip the LLM phase when no_llm is set, with the existing graceful-degradation path unchanged
  • tests/test_cli.py, tests/test_insights_orchestrator.py: new tests (--db parse on both subcommands, --no-llm default/set, LLM phases skipped in data-only mode)

Verification

  • uv run pytest tests/ — 377 passed
  • uvx ruff check . and uvx ruff format --check . — clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants