savemytokens 0.2.1 → 0.2.2
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 +8 -15
- package/dist/commands/install.js +10 -0
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
### Decide which projects get your Claude allowance.
|
|
8
8
|
|
|
9
|
+
<sub>A capacity scheduler for Claude Code · Node 18.17+ · nothing leaves your machine</sub>
|
|
10
|
+
|
|
9
11
|
<a href="https://www.npmjs.com/package/savemytokens"><img src="https://img.shields.io/npm/v/savemytokens?style=flat-square&color=1a7f37&label=npm" alt="npm version"></a>
|
|
10
12
|
<img src="https://img.shields.io/badge/dependencies-0-1a7f37?style=flat-square" alt="zero dependencies">
|
|
11
13
|
<img src="https://img.shields.io/badge/node-%E2%89%A5%2018.17-2b7489?style=flat-square" alt="node 18.17+">
|
|
@@ -71,7 +73,7 @@ burningdemand, because it is the only project on the high tier.
|
|
|
71
73
|
|
|
72
74
|
<div align="center">
|
|
73
75
|
|
|
74
|
-
<img src="https://raw.githubusercontent.com/offbeatport/savemytokens/main/assets/example.svg" alt="Seven projects in the ACTIVE table. Three are pinned, in the order they were pinned: burningdemand at 20% and 71% through it on HIGH, autonomykernel at 18% and 44% through, coldverdict at 12% and 93% through on LOW. Below them the unpinned ones share what is left." width="
|
|
76
|
+
<img src="https://raw.githubusercontent.com/offbeatport/savemytokens/main/assets/example.svg" alt="Seven projects in the ACTIVE table. Three are pinned, in the order they were pinned: burningdemand at 20% and 71% through it on HIGH, autonomykernel at 18% and 44% through, coldverdict at 12% and 93% through on LOW. Below them the unpinned ones share what is left." width="955">
|
|
75
77
|
|
|
76
78
|
</div>
|
|
77
79
|
|
|
@@ -83,20 +85,11 @@ them. Nothing here required you to guess how many tokens anything costs.
|
|
|
83
85
|
|
|
84
86
|
## Commands
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| `npx savemytokens priority buydiff high` | who gets spare capacity first |
|
|
92
|
-
| `npx savemytokens release buydiff` | hand its unused share back |
|
|
93
|
-
| `npx savemytokens policy strict` | wind down earlier when it gets tight |
|
|
94
|
-
| `npx savemytokens hud` | pick a status line, previewed on your numbers |
|
|
95
|
-
| `npx savemytokens theme` | eighteen themes, or write your own |
|
|
96
|
-
| `npx savemytokens defer` | work a session pushed to next time |
|
|
97
|
-
| `npx savemytokens audit` | what your last 7 days wasted |
|
|
98
|
-
| `npx savemytokens privacy` | every file it reads and writes |
|
|
99
|
-
| `npx savemytokens uninstall` | remove every trace · `--purge` drops the data too |
|
|
88
|
+
<div align="center">
|
|
89
|
+
|
|
90
|
+
<img src="https://raw.githubusercontent.com/offbeatport/savemytokens/main/assets/commands.svg" alt="The command list: npx savemytokens for the control centre, status, share, priority, release, policy, hud, theme, defer, audit, privacy and uninstall." width="955">
|
|
91
|
+
|
|
92
|
+
</div>
|
|
100
93
|
|
|
101
94
|
`--codex` points any of these at Codex instead, which publishes its own rate limits and needs no
|
|
102
95
|
hooks. It is metered and shown, but nothing can be injected into it, so there is no advice.
|
package/dist/commands/install.js
CHANGED
|
@@ -105,6 +105,9 @@ function writeRules() {
|
|
|
105
105
|
export function rulesInstalled() {
|
|
106
106
|
return readMemory().includes(RULES_START);
|
|
107
107
|
}
|
|
108
|
+
export function claudeCodeFound() {
|
|
109
|
+
return fs.existsSync(CLAUDE_HOME) || fs.existsSync(SETTINGS);
|
|
110
|
+
}
|
|
108
111
|
export function hookInstalled() {
|
|
109
112
|
return fs.existsSync(hookPath("hook.mjs"));
|
|
110
113
|
}
|
|
@@ -140,6 +143,7 @@ export function runInstall(options) {
|
|
|
140
143
|
process.exitCode = 1;
|
|
141
144
|
return;
|
|
142
145
|
}
|
|
146
|
+
const foundClaudeCode = claudeCodeFound();
|
|
143
147
|
const settings = parsed;
|
|
144
148
|
const existingStatusLine = settings.statusLine?.command;
|
|
145
149
|
const ours = ourCommand(existingStatusLine);
|
|
@@ -223,6 +227,12 @@ export function runInstall(options) {
|
|
|
223
227
|
writeSettings(settings);
|
|
224
228
|
out.push(`${green("Installed.")} It takes effect in sessions you start from now on.`);
|
|
225
229
|
out.push(dim(" Open the control centre with: npx savemytokens"));
|
|
230
|
+
if (!foundClaudeCode) {
|
|
231
|
+
out.push("");
|
|
232
|
+
out.push(yellow(" Claude Code was not found."));
|
|
233
|
+
out.push(dim(` Nothing was seen at ${CLAUDE_HOME}, so this machine may not have it installed.`));
|
|
234
|
+
out.push(dim(" The hooks are in place and will start working the first time you run it."));
|
|
235
|
+
}
|
|
226
236
|
out.push("");
|
|
227
237
|
if (!options.quiet)
|
|
228
238
|
process.stdout.write(out.join("\n") + "\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "savemytokens",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Give every Claude Code session a target share of your Claude window, and keep Claude aware of it. Local, private, zero setup.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -40,8 +40,11 @@
|
|
|
40
40
|
"build": "tsc -p tsconfig.json && node scripts/copy-runtime.mjs",
|
|
41
41
|
"dev": "npm run build && node dist/cli.js",
|
|
42
42
|
"test": "npm run build && node --test test/*.test.js",
|
|
43
|
-
"screenshot": "npm run build && COLORTERM=truecolor node scripts/screenshot.mjs",
|
|
44
|
-
"prepublishOnly": "npm run build && npm test"
|
|
43
|
+
"screenshot": "npm run build && COLORTERM=truecolor node scripts/screenshot.mjs && rsvg-convert -w 1280 -h 640 assets/social.svg -o assets/social.png && cp assets/screenshot.svg assets/statusline.svg assets/f-numbers.svg assets/f-share.svg assets/f-agent.svg assets/f-resting.svg assets/f-defer.svg web/ && node scripts/stamp-assets.mjs",
|
|
44
|
+
"prepublishOnly": "npm run build && npm test",
|
|
45
|
+
"postpublish": "node scripts/release.mjs",
|
|
46
|
+
"release": "node scripts/release.mjs",
|
|
47
|
+
"drift": "node scripts/drift.mjs"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
50
|
"@types/node": "^22.10.2",
|