opencode-usage 0.1.0__tar.gz → 0.1.1__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.
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/PKG-INFO +12 -3
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/README.md +11 -2
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/pyproject.toml +1 -1
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/src/opencode_usage/db.py +1 -12
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/.gitignore +0 -0
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/LICENSE +0 -0
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/src/opencode_usage/__init__.py +0 -0
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/src/opencode_usage/__main__.py +0 -0
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/src/opencode_usage/cli.py +0 -0
- {opencode_usage-0.1.0 → opencode_usage-0.1.1}/src/opencode_usage/render.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencode-usage
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: CLI tool to track and display OpenCode token usage statistics
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -23,6 +23,16 @@ CLI tool to track and display [OpenCode](https://github.com/opencodeco/opencode)
|
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
+
```bash
|
|
27
|
+
# From PyPI
|
|
28
|
+
pip install opencode-usage
|
|
29
|
+
|
|
30
|
+
# Or with uv
|
|
31
|
+
uv tool install opencode-usage
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### From source
|
|
35
|
+
|
|
26
36
|
```bash
|
|
27
37
|
git clone https://github.com/rchardx/opencode-usage.git
|
|
28
38
|
cd opencode-usage
|
|
@@ -89,8 +99,7 @@ opencode-usage --by model --json | jq '.rows[].label'
|
|
|
89
99
|
|
|
90
100
|
Default database locations:
|
|
91
101
|
|
|
92
|
-
- **macOS
|
|
93
|
-
- **Windows**: `%LOCALAPPDATA%\opencode\opencode.db`
|
|
102
|
+
- **All platforms** (macOS, Linux, Windows): `~/.local/share/opencode/opencode.db`
|
|
94
103
|
|
|
95
104
|
## Development
|
|
96
105
|
|
|
@@ -13,6 +13,16 @@ CLI tool to track and display [OpenCode](https://github.com/opencodeco/opencode)
|
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
+
```bash
|
|
17
|
+
# From PyPI
|
|
18
|
+
pip install opencode-usage
|
|
19
|
+
|
|
20
|
+
# Or with uv
|
|
21
|
+
uv tool install opencode-usage
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### From source
|
|
25
|
+
|
|
16
26
|
```bash
|
|
17
27
|
git clone https://github.com/rchardx/opencode-usage.git
|
|
18
28
|
cd opencode-usage
|
|
@@ -79,8 +89,7 @@ opencode-usage --by model --json | jq '.rows[].label'
|
|
|
79
89
|
|
|
80
90
|
Default database locations:
|
|
81
91
|
|
|
82
|
-
- **macOS
|
|
83
|
-
- **Windows**: `%LOCALAPPDATA%\opencode\opencode.db`
|
|
92
|
+
- **All platforms** (macOS, Linux, Windows): `~/.local/share/opencode/opencode.db`
|
|
84
93
|
|
|
85
94
|
## Development
|
|
86
95
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
import platform
|
|
7
6
|
import sqlite3
|
|
8
7
|
from dataclasses import dataclass, field
|
|
9
8
|
from datetime import datetime
|
|
@@ -15,17 +14,7 @@ def _default_db_path() -> Path:
|
|
|
15
14
|
"""Resolve the OpenCode database path per platform."""
|
|
16
15
|
if custom := os.environ.get("OPENCODE_DB"):
|
|
17
16
|
return Path(custom)
|
|
18
|
-
|
|
19
|
-
system = platform.system()
|
|
20
|
-
if system == "Darwin":
|
|
21
|
-
base = Path.home() / ".local" / "share"
|
|
22
|
-
elif system == "Linux":
|
|
23
|
-
base = Path(os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share"))
|
|
24
|
-
elif system == "Windows":
|
|
25
|
-
base = Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local"))
|
|
26
|
-
else:
|
|
27
|
-
base = Path.home() / ".local" / "share"
|
|
28
|
-
|
|
17
|
+
base = Path(os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share"))
|
|
29
18
|
return base / "opencode" / "opencode.db"
|
|
30
19
|
|
|
31
20
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|