toktrack 0.1.1
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/bin/run.js +34 -0
- package/bin/toktrack-darwin-arm64 +0 -0
- package/bin/toktrack-darwin-x64 +0 -0
- package/bin/toktrack-linux-arm64 +0 -0
- package/bin/toktrack-linux-x64 +0 -0
- package/bin/toktrack-win32-x64.exe +0 -0
- package/package.json +40 -0
package/bin/run.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execFileSync } = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const platform = os.platform();
|
|
7
|
+
const arch = os.arch();
|
|
8
|
+
|
|
9
|
+
// Platform mapping to binary names
|
|
10
|
+
const platformMap = {
|
|
11
|
+
'darwin-arm64': 'toktrack-darwin-arm64',
|
|
12
|
+
'darwin-x64': 'toktrack-darwin-x64',
|
|
13
|
+
'linux-x64': 'toktrack-linux-x64',
|
|
14
|
+
'linux-arm64': 'toktrack-linux-arm64',
|
|
15
|
+
'win32-x64': 'toktrack-win32-x64.exe',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const key = `${platform}-${arch}`;
|
|
19
|
+
const binaryName = platformMap[key];
|
|
20
|
+
|
|
21
|
+
if (!binaryName) {
|
|
22
|
+
console.error(`Unsupported platform: ${platform}-${arch}`);
|
|
23
|
+
console.error('Supported platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const binary = path.join(__dirname, binaryName);
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
execFileSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
31
|
+
} catch (e) {
|
|
32
|
+
if (e.status) process.exit(e.status);
|
|
33
|
+
throw e;
|
|
34
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "toktrack",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Ultra-fast AI CLI token usage tracker",
|
|
5
|
+
"bin": {
|
|
6
|
+
"toktrack": "./bin/run.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/mag123c/toktrack"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ai",
|
|
17
|
+
"token",
|
|
18
|
+
"usage",
|
|
19
|
+
"tracker",
|
|
20
|
+
"cli",
|
|
21
|
+
"claude",
|
|
22
|
+
"anthropic",
|
|
23
|
+
"openai",
|
|
24
|
+
"llm"
|
|
25
|
+
],
|
|
26
|
+
"author": "mag123c",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"os": [
|
|
29
|
+
"darwin",
|
|
30
|
+
"linux",
|
|
31
|
+
"win32"
|
|
32
|
+
],
|
|
33
|
+
"cpu": [
|
|
34
|
+
"x64",
|
|
35
|
+
"arm64"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=14"
|
|
39
|
+
}
|
|
40
|
+
}
|