Goal
Add a TokenSource implementation that captures token usage from OpenAI's Codex CLI, so Tokie grows from Codex usage too — not just Claude Code.
Why
The project is designed around the TokenSource interface explicitly so multiple AI CLI tools can feed the same pet. Codex is the obvious next source. The pet's "diet" expands and users who use both tools get a unified view.
Acceptance
Hints
- Reference implementations:
core/tokenSource/claudeStatusLine.ts (push / HTTP) and core/tokenSource/claudeJsonl.ts (pull / file watch). Pick whichever pattern fits Codex's surfaces — probably JSONL-style log watching unless Codex has a hook similar to Claude's statusLine.
- Codex CLI stores logs somewhere similar to
~/.config/codex/ or ~/.codex/ — investigate.
- Make sure the cursor persistence path uses a distinct key (e.g.
codex-jsonl-files) in lastCursors so it doesn't collide with Claude's.
Out of scope
- UI changes (the pet sprite/badge already shows aggregate state — no Codex-specific visual indicator).
- Multi-source per-AI breakdown in stats panel (separate issue if wanted).
Goal
Add a
TokenSourceimplementation that captures token usage from OpenAI's Codex CLI, so Tokie grows from Codex usage too — not just Claude Code.Why
The project is designed around the
TokenSourceinterface explicitly so multiple AI CLI tools can feed the same pet. Codex is the obvious next source. The pet's "diet" expands and users who use both tools get a unified view.Acceptance
core/tokenSource/codex.tsimplementing theTokenSourceinterface (id,start,stop, optionalinstall).TokenEventfor each detected Codex turn withtokenspopulated.SourceRegistryinelectron/bootstrap.ts.core/tokenSource/codex.test.ts— parser / cursor / dedup behavior.docs/01-tokens.mdupdated with Codex section.Hints
core/tokenSource/claudeStatusLine.ts(push / HTTP) andcore/tokenSource/claudeJsonl.ts(pull / file watch). Pick whichever pattern fits Codex's surfaces — probably JSONL-style log watching unless Codex has a hook similar to Claude'sstatusLine.~/.config/codex/or~/.codex/— investigate.codex-jsonl-files) inlastCursorsso it doesn't collide with Claude's.Out of scope