Skip to content

Troubleshooting

Run a scoped check first:

Terminal window
llm-usage daily --source pi
llm-usage daily --source codex
llm-usage daily --source gemini
llm-usage daily --source droid
llm-usage daily --source opencode

If OpenCode is expected, provide an explicit DB path:

Terminal window
llm-usage daily --source opencode --opencode-db /path/to/opencode.db

OpenCode parsing requires Node.js 24+ runtime with built-in node:sqlite.

  • --source-dir supports only pi, codex, gemini, and droid.
  • --pi-dir, --codex-dir, --gemini-dir, and --droid-dir must point to valid directories.
  • For OpenCode, use --opencode-db.

Correct examples:

Terminal window
llm-usage daily --source-dir pi=/path/to/pi --source-dir codex=/path/to/codex --source-dir gemini=/path/to/.gemini --source-dir droid=/path/to/.factory/sessions
llm-usage daily --pi-dir /path/to/pi --codex-dir /path/to/codex --gemini-dir /path/to/.gemini --droid-dir /path/to/.factory/sessions
llm-usage daily --opencode-db /path/to/opencode.db

If pricing resolution fails:

  1. retry with network enabled
  2. or use a cache that already exists with --pricing-offline
Terminal window
llm-usage monthly --pricing-offline

OpenCode runtime parsing is read-only and CLI-independent. For schema inspection, use OpenCode CLI tooling:

Terminal window
opencode db "select name from sqlite_master where type='table'"
opencode db --format json "<sql>"

Pin source and date range explicitly:

Terminal window
llm-usage monthly --source opencode --opencode-db /archives/opencode-2026-01.db --since 2026-01-01 --until 2026-01-31