@1930dev/opencode-usage 0.1.4 → 0.1.5
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.
- package/LICENSE +21 -0
- package/README.md +36 -1
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agu Rodríguez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
Usage tracking, budget percentages and model ranking for [opencode](https://opencode.ai):
|
|
4
4
|
a CLI, and a `/usage` slash command for the TUI.
|
|
5
5
|
|
|
6
|
+
Every connected provider in one table, with each one's remaining budget as a
|
|
7
|
+
comparable percentage — whether the provider bills in tokens, requests, credits or
|
|
8
|
+
neurons.
|
|
9
|
+
|
|
10
|
+
<!-- Absolute URL so the image also renders on npm, which resolves nothing relative. -->
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/@1930dev/opencode-usage)
|
|
14
|
+
[](./LICENSE)
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
opencode talks to many providers at once, and each one meters differently: a weekly
|
|
19
|
+
window here, premium requests there, credits, neurons, tokens per day. Nothing tells
|
|
20
|
+
you which one you are about to exhaust.
|
|
21
|
+
|
|
22
|
+
This reads opencode's own SQLite and auth store — no configuration, no account — and
|
|
23
|
+
normalizes every quota into one percentage, so the answer to "which provider still has
|
|
24
|
+
room" is one glance.
|
|
25
|
+
|
|
6
26
|
## Install
|
|
7
27
|
|
|
8
28
|
```bash
|
|
@@ -45,7 +65,22 @@ opencode-usage top --limit 10 --json
|
|
|
45
65
|
## Plugin for opencode
|
|
46
66
|
|
|
47
67
|
The package also ships a `/usage` slash command for the opencode TUI. It shows the
|
|
48
|
-
same table as the CLI, with the % budget column drawn as a progress bar
|
|
68
|
+
same table as the CLI, with the % budget column drawn as a progress bar:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
Usage — today esc
|
|
72
|
+
|
|
73
|
+
PROVIDER MSGS TOK IN TOK OUT COST BUDGET
|
|
74
|
+
opencode-go 7 0 0 $0.00 ████████████ 100% weekly
|
|
75
|
+
nvidia 98 10.9M 19.9K $0.00
|
|
76
|
+
cloudflare-workers-ai 0 0 0 $0.00
|
|
77
|
+
github-copilot 1 4.2K 830 $12.35 █████░░░░░░░ 42% 1M tok/day
|
|
78
|
+
|
|
79
|
+
TOTAL 106 $12.35
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The dialog sizes itself to the terminal: a wide frame spells the budget labels out,
|
|
83
|
+
a narrow one shortens them to the window (`wk`, `mo`, `d`).
|
|
49
84
|
|
|
50
85
|
```bash
|
|
51
86
|
opencode plugin @1930dev/opencode-usage
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1930dev/opencode-usage",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Usage tracking, budget percentages and model ranking for opencode \u2014 CLI plus a /usage TUI plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|
|
48
|
+
"LICENSE",
|
|
48
49
|
"README.md"
|
|
49
50
|
],
|
|
50
51
|
"publishConfig": {
|