tokenjam 0.5.6 → 0.6.0
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/README.md +6 -16
- package/bin/tj.js +16 -8
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -11,19 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
TokenJam ingests telemetry data about your agents from a multitude of sources and provides you a quick and easy way to visualize and optimize cost so that you get the most out of the tokens you pay for. This package is the zero-install launcher:
|
|
14
|
+
TokenJam ingests telemetry data about your agents from a multitude of sources and provides you a quick and easy way to visualize and optimize cost so that you get the most out of the tokens you pay for. This package is the zero-install launcher: no pip environment, no manual config.
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npx tokenjam
|
|
17
|
+
npx tokenjam onboard # or: pipx install tokenjam && tj onboard
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## What you get
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<div align="center">
|
|
25
|
-
<img src="https://raw.githubusercontent.com/Metabuilder-Labs/tokenjam/main/docs/assets/tj-quickstart-hero.png" alt="Sample npx tokenjam output: quota composition (95.9% re-reading context, 4.1% net-new work) and a session timeline table" width="620">
|
|
26
|
-
</div>
|
|
22
|
+
`tj onboard` is guided setup: it writes a config, generates an ingest secret, and asks how you use AI agents (Claude Code, Codex, or your own SDK/API agents) to wire the right path. For Claude Code and Codex that means backfilling recent history and installing a statusline and hooks for live capture; restart and you're live. Onboarding unlocks all six analyzers, the Lens dashboard, and the zero-token statusline in one command.
|
|
27
23
|
|
|
28
24
|
## Commands
|
|
29
25
|
|
|
@@ -31,20 +27,14 @@ All arguments pass straight through to the Python CLI, so any `tj` subcommand an
|
|
|
31
27
|
|
|
32
28
|
| Command | What it does |
|
|
33
29
|
|---|---|
|
|
34
|
-
| `npx tokenjam`
|
|
30
|
+
| `npx tokenjam onboard` | Guided setup: writes a config, generates an ingest secret, and optionally installs the background daemon for live capture. |
|
|
35
31
|
| `npx tokenjam context` | Where your quota goes: re-read vs. net-new share, recurring inclusions, `/compact` candidates. |
|
|
36
32
|
| `npx tokenjam optimize` | Cost-saving candidates: model downsizing, cache opportunities, prompt trimming, workflow reuse, subagent right-sizing. |
|
|
37
|
-
| `npx tokenjam
|
|
33
|
+
| `npx tokenjam` | Bare run: still works, still zero-install, still a reference passthrough to the Python CLI. |
|
|
38
34
|
|
|
39
35
|
## Go deeper
|
|
40
36
|
|
|
41
|
-
`
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
npx tokenjam onboard # or: pipx install tokenjam && tj onboard
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
`tj onboard` asks how you use AI agents (Claude Code, Codex, or your own SDK/API agents) and wires the right path. For Claude Code and Codex that means backfilling recent history plus a statusline and hooks; restart and you're live. From there:
|
|
37
|
+
`tj onboard` sets up live capture, the local Lens dashboard, and the zero-token statusline in one command. From there:
|
|
48
38
|
|
|
49
39
|
```bash
|
|
50
40
|
tj optimize # cost-saving candidates from your actual usage
|
package/bin/tj.js
CHANGED
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* `npx <tool>` first. `npx tokenjam` here resolves a Python launcher with NO pip env,
|
|
8
8
|
* NO daemon, NO onboarding — it shells out to the Python CLI via the first
|
|
9
9
|
* available runner and hands every argument straight through. Bare `npx tokenjam`
|
|
10
|
-
* (no subcommand)
|
|
11
|
-
* from the same ~/.claude/projects/*.jsonl files ccusage reads, in one
|
|
10
|
+
* (no subcommand) prints the zero-install report: where your Claude Code quota
|
|
11
|
+
* goes, from the same ~/.claude/projects/*.jsonl files ccusage reads, in one
|
|
12
|
+
* command.
|
|
12
13
|
*
|
|
13
14
|
* Runner preference (first that exists wins):
|
|
14
15
|
* 1. `uvx --from tokenjam tj …` — fully ephemeral, downloads nothing global
|
|
@@ -112,13 +113,19 @@ function markRefreshed() {
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
function main() {
|
|
115
|
-
// Bare `npx tokenjam` IS the zero-install first run —
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
116
|
+
// Bare `npx tokenjam` IS the zero-install first run — the quota report the
|
|
117
|
+
// docs promise. The branded home screen that bare LOCAL `tj` prints assumes
|
|
118
|
+
// an installed CLI and would dead-end an npx user ("You're set up",
|
|
119
|
+
// suggesting commands they don't have). Any explicit args pass through
|
|
120
|
+
// untouched; a bare invocation stays bare (no synthetic subcommand — there
|
|
121
|
+
// is no public/typeable command for this) and instead sets an env var that
|
|
122
|
+
// the Python CLI's own no-subcommand branch reads to pick the report over
|
|
123
|
+
// the home screen.
|
|
120
124
|
const argv = process.argv.slice(2);
|
|
121
|
-
const passthrough = argv
|
|
125
|
+
const passthrough = argv;
|
|
126
|
+
const childEnv = argv.length
|
|
127
|
+
? process.env
|
|
128
|
+
: { ...process.env, TJ_NPX_ZERO_INSTALL_REPORT: "1" };
|
|
122
129
|
|
|
123
130
|
for (const { bin, prefix } of runners()) {
|
|
124
131
|
if (!has(bin)) continue;
|
|
@@ -127,6 +134,7 @@ function main() {
|
|
|
127
134
|
const args = doRefresh ? ["--refresh", ...prefix] : prefix;
|
|
128
135
|
const result = spawnSync(bin, [...args, ...passthrough], {
|
|
129
136
|
stdio: "inherit",
|
|
137
|
+
env: childEnv,
|
|
130
138
|
});
|
|
131
139
|
if (result.error) continue; // try the next runner on spawn failure
|
|
132
140
|
if (doRefresh && result.status === 0) markRefreshed();
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tokenjam",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Zero-install launcher for TokenJam (tj): npx tokenjam runs the Python CLI via uvx/pipx and
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Zero-install launcher for TokenJam (tj): npx tokenjam runs the Python CLI via uvx/pipx and reports the recurring mistakes your AI agent keeps repeating, no setup required.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
7
7
|
"ccusage",
|
|
8
8
|
"tokens",
|
|
9
|
-
"cost",
|
|
9
|
+
"cost-optimization",
|
|
10
10
|
"llm",
|
|
11
11
|
"agents",
|
|
12
12
|
"observability",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"anthropic",
|
|
15
15
|
"claude",
|
|
16
16
|
"token-usage",
|
|
17
|
-
"
|
|
17
|
+
"agent-behavior",
|
|
18
18
|
"cli",
|
|
19
19
|
"statusline",
|
|
20
20
|
"opentelemetry",
|