cli-consumption 0.0.4__tar.gz → 0.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/PKG-INFO +31 -3
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/README.md +30 -2
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/docs/architecture.md +3 -2
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/docs/provider-support.md +33 -2
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/docs/roadmap.md +3 -2
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/pyproject.toml +1 -1
- cli_consumption-0.0.6/src/cli_consumption/adapters/__init__.py +13 -0
- cli_consumption-0.0.6/src/cli_consumption/adapters/kilo.py +499 -0
- cli_consumption-0.0.6/src/cli_consumption/adapters/pi.py +454 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/cli.py +11 -3
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_cli.py +120 -1
- cli_consumption-0.0.6/tests/test_kilo_adapter.py +292 -0
- cli_consumption-0.0.6/tests/test_pi_adapter.py +287 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/uv.lock +1 -1
- cli_consumption-0.0.4/src/cli_consumption/adapters/__init__.py +0 -5
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/add-cli-adapter/SKILL.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/add-cli-adapter/agents/openai.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/audit-usage-privacy/SKILL.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/audit-usage-privacy/agents/openai.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/evolve-storage-schema/SKILL.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/evolve-storage-schema/agents/openai.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/yeet-github/SKILL.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/yeet-github/agents/openai.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/yolo/SKILL.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.agents/skills/yolo/agents/openai.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.github/workflows/ci.yml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.github/workflows/release.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.gitignore +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.pre-commit-config.yaml +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/.python-version +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/AGENTS.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/CONTRIBUTING.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/LICENSE +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/NOTICE +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/docs/privacy.md +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/__init__.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/__main__.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/adapters/base.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/adapters/claude.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/adapters/codex.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/adapters/opencode.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/api.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/dashboard.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/exporting.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/models.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/py.typed +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/storage.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/src/cli_consumption/sync.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/conftest.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_api.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_claude_adapter.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_codex_adapter.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_opencode_adapter.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_storage_and_exports.py +0 -0
- {cli_consumption-0.0.4 → cli_consumption-0.0.6}/tests/test_sync.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: cli-consumption
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: Analyze and consolidate AI coding CLI consumption across machines.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Guillaume-Lombardo/cli-consumption
|
|
6
6
|
Project-URL: Documentation, https://github.com/Guillaume-Lombardo/cli-consumption#readme
|
|
@@ -33,8 +33,8 @@ models, tokens, tools, conversations, and turns. It can analyze one workstation,
|
|
|
33
33
|
consolidate copied data from several machines, or send metadata-only snapshots to a
|
|
34
34
|
central collector.
|
|
35
35
|
|
|
36
|
-
Codex, OpenCode, and the core Claude Code local transcript format are
|
|
37
|
-
|
|
36
|
+
Codex, Kilo Code, Pi, OpenCode, and the core Claude Code local transcript format are
|
|
37
|
+
supported.
|
|
38
38
|
|
|
39
39
|
The collector deliberately excludes prompts, responses, tool arguments, and
|
|
40
40
|
credentials. See [Privacy](docs/privacy.md) before sharing a database or export.
|
|
@@ -108,6 +108,18 @@ Select OpenCode to read `~/.local/share/opencode/opencode.db` instead:
|
|
|
108
108
|
uv run cli-consumption collect --provider opencode --database usage.sqlite
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
Select Kilo Code to read `~/.local/share/kilo/kilo.db` instead:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv run cli-consumption collect --provider kilo --database usage.sqlite
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Select Pi to read `~/.pi/agent/sessions/` instead:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
uv run cli-consumption collect --provider pi --database usage.sqlite
|
|
121
|
+
```
|
|
122
|
+
|
|
111
123
|
Use `all` to detect and collect every supported provider present on the machine:
|
|
112
124
|
|
|
113
125
|
```bash
|
|
@@ -156,6 +168,22 @@ uv run cli-consumption collect --provider opencode \
|
|
|
156
168
|
--source laptop=/data/opencode/laptop
|
|
157
169
|
```
|
|
158
170
|
|
|
171
|
+
Copied Kilo Code sources point to the data directory containing `kilo.db`:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
uv run cli-consumption collect --provider kilo \
|
|
175
|
+
--source desktop=/data/kilo/desktop \
|
|
176
|
+
--source laptop=/data/kilo/laptop
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Copied Pi sources point to the agent directory containing `sessions/`:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
uv run cli-consumption collect --provider pi \
|
|
183
|
+
--source desktop=/data/pi/desktop \
|
|
184
|
+
--source laptop=/data/pi/laptop
|
|
185
|
+
```
|
|
186
|
+
|
|
159
187
|
## SQLite and PostgreSQL
|
|
160
188
|
|
|
161
189
|
A file path selects SQLite. A SQLAlchemy URL selects PostgreSQL:
|
|
@@ -5,8 +5,8 @@ models, tokens, tools, conversations, and turns. It can analyze one workstation,
|
|
|
5
5
|
consolidate copied data from several machines, or send metadata-only snapshots to a
|
|
6
6
|
central collector.
|
|
7
7
|
|
|
8
|
-
Codex, OpenCode, and the core Claude Code local transcript format are
|
|
9
|
-
|
|
8
|
+
Codex, Kilo Code, Pi, OpenCode, and the core Claude Code local transcript format are
|
|
9
|
+
supported.
|
|
10
10
|
|
|
11
11
|
The collector deliberately excludes prompts, responses, tool arguments, and
|
|
12
12
|
credentials. See [Privacy](docs/privacy.md) before sharing a database or export.
|
|
@@ -80,6 +80,18 @@ Select OpenCode to read `~/.local/share/opencode/opencode.db` instead:
|
|
|
80
80
|
uv run cli-consumption collect --provider opencode --database usage.sqlite
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
Select Kilo Code to read `~/.local/share/kilo/kilo.db` instead:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
uv run cli-consumption collect --provider kilo --database usage.sqlite
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Select Pi to read `~/.pi/agent/sessions/` instead:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
uv run cli-consumption collect --provider pi --database usage.sqlite
|
|
93
|
+
```
|
|
94
|
+
|
|
83
95
|
Use `all` to detect and collect every supported provider present on the machine:
|
|
84
96
|
|
|
85
97
|
```bash
|
|
@@ -128,6 +140,22 @@ uv run cli-consumption collect --provider opencode \
|
|
|
128
140
|
--source laptop=/data/opencode/laptop
|
|
129
141
|
```
|
|
130
142
|
|
|
143
|
+
Copied Kilo Code sources point to the data directory containing `kilo.db`:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
uv run cli-consumption collect --provider kilo \
|
|
147
|
+
--source desktop=/data/kilo/desktop \
|
|
148
|
+
--source laptop=/data/kilo/laptop
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Copied Pi sources point to the agent directory containing `sessions/`:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
uv run cli-consumption collect --provider pi \
|
|
155
|
+
--source desktop=/data/pi/desktop \
|
|
156
|
+
--source laptop=/data/pi/laptop
|
|
157
|
+
```
|
|
158
|
+
|
|
131
159
|
## SQLite and PostgreSQL
|
|
132
160
|
|
|
133
161
|
A file path selects SQLite. A SQLAlchemy URL selects PostgreSQL:
|
|
@@ -16,8 +16,9 @@ provider files -> adapter -> metadata-only snapshot -> SQL storage -> dashboard/
|
|
|
16
16
|
|
|
17
17
|
- `adapters`: parse a CLI's local data into conversations, turns, model calls, tool
|
|
18
18
|
calls, context-pressure samples, bounded turn settings, compactions, and content-free
|
|
19
|
-
work-item intervals. Codex exposes the complete analytics contract; Claude Code
|
|
20
|
-
OpenCode expose the core dimensions available in their local
|
|
19
|
+
work-item intervals. Codex exposes the complete analytics contract; Claude Code,
|
|
20
|
+
Kilo Code, OpenCode, and Pi expose the core dimensions available in their local
|
|
21
|
+
stores.
|
|
21
22
|
- `models`: define the transport boundary shared by offline and API ingestion.
|
|
22
23
|
- `storage`: owns the normalized schema, idempotent replacement rules, SQLite, and
|
|
23
24
|
PostgreSQL engine creation.
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
| --- | --- | --- |
|
|
5
5
|
| Codex | Supported | Local rollout JSONL and optional metadata-only subagent state |
|
|
6
6
|
| Claude Code | Supported (core) | Local project transcript JSONL |
|
|
7
|
+
| Kilo Code | Supported (core) | Local SQLite session store |
|
|
7
8
|
| OpenCode | Supported (core) | Local SQLite v2 session store |
|
|
8
|
-
|
|
|
9
|
-
| Pi | Planned | To be verified before implementation |
|
|
9
|
+
| Pi | Supported (core) | Local session JSONL v1-v3 |
|
|
10
10
|
|
|
11
11
|
“Supported” means the adapter has synthetic fixtures, extracts conversations, turns,
|
|
12
12
|
models, token usage, and tool names when available, and passes privacy regression tests.
|
|
@@ -49,6 +49,37 @@ components. The adapter does not currently read pre-v2 JSON storage, legacy
|
|
|
49
49
|
provider-reported cost. The SQLite schema is internal and may change without notice;
|
|
50
50
|
local token events are not billing data.
|
|
51
51
|
|
|
52
|
+
Kilo Code reads `kilo.db` from its data directory (normally
|
|
53
|
+
`~/.local/share/kilo/`). The adapter was qualified against Kilo Code CLI v7.5.5 and
|
|
54
|
+
the matching current `session`, `message`, and `part` schema. It extracts user turns,
|
|
55
|
+
assistant model calls, model references, token usage, tool names, and compaction parts
|
|
56
|
+
while discarding titles, prompts, responses, reasoning, tool inputs/results, commands,
|
|
57
|
+
errors, paths, diffs, costs, snapshots, and arbitrary metadata.
|
|
58
|
+
|
|
59
|
+
Kilo Code reports uncached input, cache reads, cache writes, visible output, and
|
|
60
|
+
reasoning separately. Normalized input and output totals include their respective
|
|
61
|
+
components. The adapter does not read the legacy IDE extension's task files, cloud-only
|
|
62
|
+
sessions, `session_message` queue records, child-session relationships, context-window
|
|
63
|
+
sizes, costs, snapshots, or provider-reported generation metrics. `KILO_DB` can select
|
|
64
|
+
a non-default database, which must be passed explicitly with `--source`. Kilo Code's
|
|
65
|
+
SQLite schema can change without notice, and its local token events are not billing
|
|
66
|
+
data.
|
|
67
|
+
|
|
68
|
+
Pi reads session JSONL files under `~/.pi/agent/sessions/` (or copied agent
|
|
69
|
+
directories). It extracts user turns, assistant and compaction model calls, provider
|
|
70
|
+
and model identifiers, token usage, tool names, thinking-level changes, and compaction
|
|
71
|
+
timestamps while discarding prompts, responses, thinking, tool arguments/results,
|
|
72
|
+
commands/output, summaries, errors, costs, paths, extension data, and arbitrary
|
|
73
|
+
metadata. All persisted branches are counted because Pi retains branch history in the
|
|
74
|
+
same session file.
|
|
75
|
+
|
|
76
|
+
Pi reports uncached input, cache reads, cache writes, output, and optional reasoning
|
|
77
|
+
tokens. Normalized input includes all three input components; reasoning is retained as
|
|
78
|
+
a subset of output rather than added twice. This adapter does not collect custom
|
|
79
|
+
session directories automatically, context-window sizes, costs, branch relationships,
|
|
80
|
+
or provider-reported durations. Pi's JSONL schema can change without notice, and its
|
|
81
|
+
local token events are not billing data.
|
|
82
|
+
|
|
52
83
|
Provider formats can change without notice. Unknown fields are ignored; malformed
|
|
53
84
|
provider records are counted and skipped. Compatibility fixes should add a fixture for
|
|
54
85
|
both the old and new format whenever possible.
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
- Complete Codex local collector
|
|
6
6
|
- Core Claude Code local transcript collector
|
|
7
|
+
- Core Pi local session collector
|
|
8
|
+
- Core Kilo Code local SQLite collector
|
|
7
9
|
- Offline multi-machine deduplication
|
|
8
10
|
- SQLite and PostgreSQL storage
|
|
9
11
|
- Metadata-only central collection API
|
|
@@ -14,8 +16,7 @@
|
|
|
14
16
|
|
|
15
17
|
1. Extend Claude Code support only where local metadata has reliable semantics.
|
|
16
18
|
2. Add OpenCode with the same normalized contract.
|
|
17
|
-
3. Add
|
|
18
|
-
4. Add cross-provider comparison views once at least two adapters expose reliable model
|
|
19
|
+
3. Add cross-provider comparison views once at least two adapters expose reliable model
|
|
19
20
|
and token dimensions.
|
|
20
21
|
|
|
21
22
|
## Later operational work
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from cli_consumption.adapters.claude import ClaudeAdapter
|
|
2
|
+
from cli_consumption.adapters.codex import CodexAdapter
|
|
3
|
+
from cli_consumption.adapters.kilo import KiloAdapter
|
|
4
|
+
from cli_consumption.adapters.opencode import OpenCodeAdapter
|
|
5
|
+
from cli_consumption.adapters.pi import PiAdapter
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"ClaudeAdapter",
|
|
9
|
+
"CodexAdapter",
|
|
10
|
+
"KiloAdapter",
|
|
11
|
+
"OpenCodeAdapter",
|
|
12
|
+
"PiAdapter",
|
|
13
|
+
]
|