ai-burnrate-tool 1.0.0 β†’ 1.0.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/README.md CHANGED
@@ -26,69 +26,23 @@ Track in real time how many tokens you are consuming across **Antigravity CLI**
26
26
 
27
27
  ---
28
28
 
29
- ## πŸš€ Quick Install (Latest Version)
29
+ ## πŸš€ Quick Install (Windows / macOS / Linux)
30
30
 
31
- You don't need to manually download or clone the repositoryβ€”simply paste **one command** into your terminal from any directory. The installer automatically resolves the latest GitHub Release (falling back to `main` if none exist yet).
31
+ Install globally from npm using **one command** from any terminal:
32
32
 
33
33
  > ⚠️ **Prerequisite:** Make sure you have [Node.js (>= 18)](https://nodejs.org/) and `npm` installed.
34
34
 
35
- ### πŸͺŸ Windows (PowerShell)
36
- Open PowerShell and run:
37
- ```powershell
38
- irm https://raw.githubusercontent.com/Cise07/ai-burnrate-tool/main/scripts/install.ps1 | iex
39
- ```
40
- > πŸ’‘ **Note on Windows permissions:** If PowerShell blocks the script with an `ExecutionPolicy` or permission error, enable script execution for your user by running:
41
- > ```powershell
42
- > Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
43
- > ```
44
-
45
- ### 🍎 macOS / 🐧 Linux (Bash / Zsh)
46
- Open your terminal and run:
47
- ```bash
48
- curl -fsSL https://raw.githubusercontent.com/Cise07/ai-burnrate-tool/main/scripts/install.sh | bash
49
- ```
50
-
51
- ### πŸ“¦ Universal Alternative via `npm` (Cross-Platform)
35
+ ### Latest Version
52
36
  ```bash
53
- npm install -g https://github.com/Cise07/ai-burnrate-tool/archive/main.tar.gz
37
+ npm install -g ai-burnrate-tool
54
38
  ```
55
39
 
56
- *(Want to run it once without installing? Use `npx https://github.com/Cise07/ai-burnrate-tool/archive/main.tar.gz`)*
57
-
58
- ### 🏷️ Install a Specific Release Version
59
- To pin a specific release tag (e.g., `v1.0.1`), use the release tarball directly or pass `BURNRATE_VERSION` to the installer:
40
+ *(Want to run it once without installing? Use `npx ai-burnrate-tool`)*
60
41
 
42
+ ### 🏷️ Install a Specific Version
43
+ To install a specific release (e.g., `1.0.0`), specify the version tag:
61
44
  ```bash
62
- # Universal (recommended for GitHub Release notes)
63
- npm install -g https://github.com/Cise07/ai-burnrate-tool/archive/refs/tags/vX.Y.Z.tar.gz
64
- ```
65
-
66
- ```powershell
67
- # Windows PowerShell
68
- $env:BURNRATE_VERSION="vX.Y.Z"; irm https://raw.githubusercontent.com/Cise07/ai-burnrate-tool/main/scripts/install.ps1 | iex
69
- ```
70
-
71
- ```bash
72
- # macOS / Linux
73
- BURNRATE_VERSION=vX.Y.Z curl -fsSL https://raw.githubusercontent.com/Cise07/ai-burnrate-tool/main/scripts/install.sh | bash
74
- ```
75
-
76
- ---
77
-
78
- ## πŸ› οΈ Install from Local Clone (For Developers)
79
-
80
- If you clone the repository locally, the installer script automatically detects `package.json`, installs dependencies, compiles both the React frontend (`dist/public`) and CLI (`dist/cli`), and registers the global `burnrate` binary:
81
-
82
- ```bash
83
- # 1. Clone the repository
84
- git clone https://github.com/Cise07/ai-burnrate-tool.git
85
- cd ai-burnrate-tool
86
-
87
- # 2. Build and install globally
88
- .\scripts\install.ps1 # Windows PowerShell
89
- ./scripts/install.sh # macOS / Linux
90
- # Or via npm script:
91
- npm run setup
45
+ npm install -g ai-burnrate-tool@X.Y.Z
92
46
  ```
93
47
 
94
48
  ---
@@ -103,9 +57,9 @@ Once installed, the **`burnrate`** (or **`ai-burnrate`**) command is available g
103
57
  | `burnrate --cli` | πŸ“Š **Terminal Mode:** Syncs pricing, prints the full token & cost report in colorized ANSI tables in the terminal, and exits immediately. |
104
58
  | `burnrate --no-open` | πŸ”‡ **Headless Mode:** Starts the live server and file watcher without automatically opening the browser. |
105
59
  | `burnrate -p, --port <number>` | πŸ”Œ **Custom Port:** Starts the dashboard on a specific port (default: `4321`, automatically falling back to the next free port if busy). |
106
- | `burnrate --update` | πŸ”„ **Self-Update:** Updates `ai-burnrate` to the latest release directly from GitHub. |
60
+ | `burnrate --update` | πŸ”„ **Self-Update:** Updates `ai-burnrate-tool` to the latest version from npm. |
107
61
  | `burnrate --uninstall` | πŸ—‘οΈ **Self-Uninstall:** Completely removes the global `burnrate` package from your system. |
108
- | `burnrate -V, --version` | 🏷️ Prints the installed version (`1.0.0`). |
62
+ | `burnrate -V, --version` | 🏷️ Prints the installed version. |
109
63
  | `burnrate -h, --help` | ℹ️ Displays all available CLI options. |
110
64
 
111
65
  > πŸ’‘ **Clean Shutdown:** While running in live mode (`burnrate`), press `Ctrl+C` (`SIGINT`) to cleanly close all SSE streams, active HTTP sockets, and the `chokidar` file watcher.
@@ -127,16 +81,6 @@ burnrate --uninstall
127
81
  npm uninstall -g ai-burnrate-tool
128
82
  ```
129
83
 
130
- ### 3️⃣ Via One-Liner Script
131
- - **Windows (PowerShell):**
132
- ```powershell
133
- irm https://raw.githubusercontent.com/Cise07/ai-burnrate-tool/main/scripts/uninstall.ps1 | iex
134
- ```
135
- - **macOS / Linux:**
136
- ```bash
137
- curl -fsSL https://raw.githubusercontent.com/Cise07/ai-burnrate-tool/main/scripts/uninstall.sh | bash
138
- ```
139
-
140
84
  ---
141
85
 
142
86
  ## πŸ’° How Pricing & Historical Rate Versioning Work
package/dist/cli/index.js CHANGED
@@ -10,7 +10,7 @@ import { getPackageRoot, syncOfficialPricing } from '../core/pricing.js';
10
10
  import { startLogWatcher } from '../core/watcher.js';
11
11
  import { startServer } from '../server/index.js';
12
12
  import { printCliReport } from './reporter.js';
13
- const REPO_SLUG = 'Cise07/ai-burnrate-tool';
13
+ const NPM_PACKAGE = 'ai-burnrate-tool';
14
14
  function getPackageVersion() {
15
15
  try {
16
16
  const pkgPath = path.join(getPackageRoot(), 'package.json');
@@ -21,37 +21,13 @@ function getPackageVersion() {
21
21
  return '1.0.0';
22
22
  }
23
23
  }
24
- async function resolveUpdateTarget() {
24
+ function resolveNpmUpdateSpec() {
25
25
  const requested = process.env.BURNRATE_VERSION?.trim();
26
26
  if (requested) {
27
- const tag = requested.startsWith('v') ? requested : `v${requested}`;
28
- return {
29
- label: tag,
30
- url: `https://github.com/${REPO_SLUG}/archive/refs/tags/${tag}.tar.gz`,
31
- };
27
+ const version = requested.replace(/^v/, '');
28
+ return `${NPM_PACKAGE}@${version}`;
32
29
  }
33
- try {
34
- const res = await fetch(`https://api.github.com/repos/${REPO_SLUG}/releases/latest`, {
35
- headers: { 'User-Agent': 'ai-burnrate-cli' },
36
- signal: AbortSignal.timeout(4000),
37
- });
38
- if (res.ok) {
39
- const data = (await res.json());
40
- if (data.tag_name) {
41
- return {
42
- label: data.tag_name,
43
- url: `https://github.com/${REPO_SLUG}/archive/refs/tags/${data.tag_name}.tar.gz`,
44
- };
45
- }
46
- }
47
- }
48
- catch {
49
- // Fallback to main branch if no GitHub Release exists yet or offline
50
- }
51
- return {
52
- label: 'main',
53
- url: `https://github.com/${REPO_SLUG}/archive/refs/heads/main.tar.gz`,
54
- };
30
+ return `${NPM_PACKAGE}@latest`;
55
31
  }
56
32
  const program = new Command();
57
33
  program
@@ -61,23 +37,23 @@ program
61
37
  .option('--cli', 'Print the usage report in ANSI tables in the terminal and exit immediately', false)
62
38
  .option('--no-open', 'Start the live server and file watcher without automatically opening the browser')
63
39
  .option('-p, --port <number>', 'Specify a custom port for the dashboard server', '4321')
64
- .option('--update', 'Update ai-burnrate to the latest release from GitHub', false)
40
+ .option('--update', 'Update ai-burnrate-tool to the latest version from npm', false)
65
41
  .option('--uninstall', 'Uninstall ai-burnrate globally from your system', false);
66
42
  program.parse(process.argv);
67
43
  const opts = program.opts();
68
44
  async function main() {
69
45
  if (opts.update) {
70
- const target = await resolveUpdateTarget();
71
- console.log(`\n ${pc.cyan('●')} Updating ${pc.bold('ai-burnrate')} (${pc.cyan(target.label)}) from GitHub...`);
46
+ const targetSpec = resolveNpmUpdateSpec();
47
+ console.log(`\n ${pc.cyan('●')} Updating ${pc.bold(targetSpec)} from npm...`);
72
48
  try {
73
- execSync(`npm install -g ${target.url}`, {
49
+ execSync(`npm install -g ${targetSpec}`, {
74
50
  stdio: 'inherit',
75
51
  });
76
- console.log(` ${pc.green('βœ“')} ${pc.bold('ai-burnrate')} updated successfully to ${pc.bold(target.label)}!\n`);
52
+ console.log(` ${pc.green('βœ“')} ${pc.bold(targetSpec)} updated successfully!\n`);
77
53
  process.exit(0);
78
54
  }
79
55
  catch {
80
- console.error(` ${pc.red('βœ—')} Failed to update automatically. Try running:\n ${pc.cyan(`npm install -g ${target.url}`)}\n`);
56
+ console.error(` ${pc.red('βœ—')} Failed to update automatically. Try running:\n ${pc.cyan(`npm install -g ${targetSpec}`)}\n`);
81
57
  process.exit(1);
82
58
  }
83
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-burnrate-tool",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Real-time local token & API equivalent cost tracker for Antigravity CLI and Claude Code",
5
5
  "type": "module",
6
6
  "bin": {