antigravity-quota-tui 1.0.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/LICENSE +21 -0
- package/README.md +25 -0
- package/bin/ant-quota.js +23 -0
- package/install.js +123 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dinujaya Sandaruwan
|
|
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
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Antigravity QuotA
|
|
2
|
+
|
|
3
|
+
A sleek terminal dashboard to monitor your AI model quotas and rate limits across multiple accounts.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g antigravity-quota-tui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ant-quota
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Place your config at `~/.config/opencode/antigravity-accounts.json`, or override with the `OPENCODE_CONFIG_DIR` environment variable.
|
|
20
|
+
|
|
21
|
+
See the [full documentation](https://github.com/Dinujaya-Sandaruwan/Antigravity-QuotA) for details.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
package/bin/ant-quota.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ant-quota launcher.
|
|
4
|
+
* Spawns the platform-specific antigravity-quota binary downloaded during postinstall.
|
|
5
|
+
*/
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const { spawnSync } = require("child_process");
|
|
8
|
+
const fs = require("fs");
|
|
9
|
+
|
|
10
|
+
const binaryName = process.platform === "win32" ? "antigravity-quota.exe" : "antigravity-quota";
|
|
11
|
+
const binaryPath = path.join(__dirname, "..", "bin", binaryName);
|
|
12
|
+
|
|
13
|
+
if (!fs.existsSync(binaryPath)) {
|
|
14
|
+
console.error("antigravity-quota binary not found.");
|
|
15
|
+
console.error("Try reinstalling: npm i -g antigravity-quota-tui --force");
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const result = spawnSync(binaryPath, process.argv.slice(2), {
|
|
20
|
+
stdio: "inherit",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
process.exit(result.status ?? 0);
|
package/install.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* install.js - Postinstall script
|
|
4
|
+
* Downloads the correct pre-built binary from GitHub Releases based on
|
|
5
|
+
* the user's OS and architecture, and places it inside bin/.
|
|
6
|
+
*/
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const https = require("https");
|
|
10
|
+
const os = require("os");
|
|
11
|
+
const { execSync } = require("child_process");
|
|
12
|
+
|
|
13
|
+
const REPO = "Dinujaya-Sandaruwan/Antigravity-QuotA";
|
|
14
|
+
const pkg = require("./package.json");
|
|
15
|
+
const VERSION = pkg.version;
|
|
16
|
+
|
|
17
|
+
// Map Node platform/arch to GoReleaser artifact names
|
|
18
|
+
function detectPlatform() {
|
|
19
|
+
const platform = process.platform; // darwin, linux, win32
|
|
20
|
+
const arch = process.arch; // x64, arm64
|
|
21
|
+
|
|
22
|
+
const platformMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
23
|
+
const archMap = { x64: "amd64", arm64: "arm64" };
|
|
24
|
+
|
|
25
|
+
const goOs = platformMap[platform];
|
|
26
|
+
const goArch = archMap[arch];
|
|
27
|
+
|
|
28
|
+
if (!goOs || !goArch) {
|
|
29
|
+
console.error(
|
|
30
|
+
`\nUnsupported platform: ${platform}/${arch}\n` +
|
|
31
|
+
`Supported: darwin/x64, darwin/arm64, linux/x64, linux/arm64, windows/x64, windows/arm64\n`
|
|
32
|
+
);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const ext = goOs === "windows" ? "zip" : "tar.gz";
|
|
37
|
+
const filename = `antigravity-quota_${goOs}_${goArch}.${ext}`;
|
|
38
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${filename}`;
|
|
39
|
+
return { goOs, goArch, ext, filename, url };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function download(url, dest) {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
const file = fs.createWriteStream(dest);
|
|
45
|
+
|
|
46
|
+
const doGet = (link) => {
|
|
47
|
+
https
|
|
48
|
+
.get(link, (res) => {
|
|
49
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
50
|
+
doGet(res.headers.location);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (res.statusCode !== 200) {
|
|
54
|
+
reject(new Error(`Download failed: HTTP ${res.statusCode} for ${link}`));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
res.pipe(file);
|
|
58
|
+
file.on("finish", () => file.close(resolve));
|
|
59
|
+
})
|
|
60
|
+
.on("error", reject);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
doGet(url);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function main() {
|
|
68
|
+
const { goOs, ext, filename, url } = detectPlatform();
|
|
69
|
+
const binDir = path.join(__dirname, "bin");
|
|
70
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
71
|
+
|
|
72
|
+
const archivePath = path.join(binDir, filename);
|
|
73
|
+
|
|
74
|
+
console.log(`\nDownloading antigravity-quota v${VERSION} for ${goOs}...`);
|
|
75
|
+
console.log(` ${url}\n`);
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
await download(url, archivePath);
|
|
79
|
+
} catch (err) {
|
|
80
|
+
console.error("Failed to download binary:", err.message);
|
|
81
|
+
console.error("You can download it manually from:");
|
|
82
|
+
console.error(` https://github.com/${REPO}/releases/tag/v${VERSION}`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Extract archive
|
|
87
|
+
try {
|
|
88
|
+
if (ext === "zip") {
|
|
89
|
+
// Try PowerShell on Windows, unzip elsewhere
|
|
90
|
+
if (process.platform === "win32") {
|
|
91
|
+
execSync(
|
|
92
|
+
`powershell -Command "Expand-Archive -Force -Path '${archivePath}' -DestinationPath '${binDir}'"`,
|
|
93
|
+
{ stdio: "inherit" }
|
|
94
|
+
);
|
|
95
|
+
} else {
|
|
96
|
+
execSync(`unzip -o "${archivePath}" -d "${binDir}"`, { stdio: "inherit" });
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
execSync(`tar -xzf "${archivePath}" -C "${binDir}"`, { stdio: "inherit" });
|
|
100
|
+
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
console.error("Failed to extract archive:", err.message);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Clean up archive
|
|
107
|
+
fs.unlinkSync(archivePath);
|
|
108
|
+
|
|
109
|
+
// Make binary executable on Unix
|
|
110
|
+
const binaryName = process.platform === "win32" ? "antigravity-quota.exe" : "antigravity-quota";
|
|
111
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
112
|
+
if (fs.existsSync(binaryPath) && process.platform !== "win32") {
|
|
113
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
console.log(`\nInstalled antigravity-quota v${VERSION}`);
|
|
117
|
+
console.log(` Run it with: ant-quota\n`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
main().catch((err) => {
|
|
121
|
+
console.error(err);
|
|
122
|
+
process.exit(1);
|
|
123
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "antigravity-quota-tui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A sleek terminal dashboard to monitor your AI model quotas and rate limits across multiple accounts.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"ant-quota": "bin/ant-quota.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node install.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"antigravity",
|
|
13
|
+
"quota",
|
|
14
|
+
"cli",
|
|
15
|
+
"tui",
|
|
16
|
+
"gemini",
|
|
17
|
+
"claude",
|
|
18
|
+
"ai",
|
|
19
|
+
"dashboard",
|
|
20
|
+
"terminal"
|
|
21
|
+
],
|
|
22
|
+
"author": "Dinujaya Sandaruwan",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/Dinujaya-Sandaruwan/Antigravity-QuotA.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/Dinujaya-Sandaruwan/Antigravity-QuotA/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/Dinujaya-Sandaruwan/Antigravity-QuotA#readme",
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=14"
|
|
34
|
+
},
|
|
35
|
+
"os": [
|
|
36
|
+
"darwin",
|
|
37
|
+
"linux",
|
|
38
|
+
"win32"
|
|
39
|
+
],
|
|
40
|
+
"cpu": [
|
|
41
|
+
"x64",
|
|
42
|
+
"arm64"
|
|
43
|
+
],
|
|
44
|
+
"files": [
|
|
45
|
+
"bin/",
|
|
46
|
+
"install.js",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
]
|
|
50
|
+
}
|