ccgather 1.3.1 → 1.3.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/dist/index.js +30 -8
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -334,7 +334,9 @@ async function sync(options) {
|
|
|
334
334
|
}
|
|
335
335
|
if (!isClaudeCodeInstalled()) {
|
|
336
336
|
console.log(import_chalk4.default.yellow("\u26A0\uFE0F Claude Code installation not detected."));
|
|
337
|
-
console.log(
|
|
337
|
+
console.log(
|
|
338
|
+
import_chalk4.default.gray("Make sure Claude Code is installed and has been used at least once.\n")
|
|
339
|
+
);
|
|
338
340
|
if (process.env.CCGATHER_DEMO === "true") {
|
|
339
341
|
console.log(import_chalk4.default.gray("Demo mode: Using mock data..."));
|
|
340
342
|
} else {
|
|
@@ -385,7 +387,9 @@ async function sync(options) {
|
|
|
385
387
|
console.log(import_chalk4.default.bold("\u{1F4CA} Your Stats"));
|
|
386
388
|
console.log(import_chalk4.default.gray("\u2500".repeat(40)));
|
|
387
389
|
console.log(` ${import_chalk4.default.gray("Tokens:")} ${import_chalk4.default.white(formatNumber2(usageData.totalTokens))}`);
|
|
388
|
-
console.log(
|
|
390
|
+
console.log(
|
|
391
|
+
` ${import_chalk4.default.gray("Spent:")} ${import_chalk4.default.green("$" + usageData.totalSpent.toFixed(2))}`
|
|
392
|
+
);
|
|
389
393
|
console.log(` ${import_chalk4.default.gray("Rank:")} ${import_chalk4.default.yellow("#" + result.data?.rank)}`);
|
|
390
394
|
if (options.verbose) {
|
|
391
395
|
console.log("\n" + import_chalk4.default.gray("Model Breakdown:"));
|
|
@@ -555,6 +559,7 @@ var init_auth = __esm({
|
|
|
555
559
|
var import_commander = require("commander");
|
|
556
560
|
var import_inquirer3 = __toESM(require("inquirer"));
|
|
557
561
|
var import_chalk6 = __toESM(require("chalk"));
|
|
562
|
+
var import_update_notifier = __toESM(require("update-notifier"));
|
|
558
563
|
|
|
559
564
|
// src/commands/submit.ts
|
|
560
565
|
var import_ora = __toESM(require("ora"));
|
|
@@ -1404,10 +1409,13 @@ function createCallbackServer() {
|
|
|
1404
1409
|
server.on("error", (err) => {
|
|
1405
1410
|
reject(new Error(`Failed to start callback server: ${err.message}`));
|
|
1406
1411
|
});
|
|
1407
|
-
setTimeout(
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1412
|
+
setTimeout(
|
|
1413
|
+
() => {
|
|
1414
|
+
server.close();
|
|
1415
|
+
reject(new Error("Authentication timed out"));
|
|
1416
|
+
},
|
|
1417
|
+
5 * 60 * 1e3
|
|
1418
|
+
);
|
|
1411
1419
|
});
|
|
1412
1420
|
}
|
|
1413
1421
|
function generateSyncScript(apiUrl, apiToken) {
|
|
@@ -1625,7 +1633,9 @@ async function setupAuto(options = {}) {
|
|
|
1625
1633
|
console.log(import_chalk3.default.gray("This will install a hook that automatically syncs"));
|
|
1626
1634
|
console.log(import_chalk3.default.gray("your usage data when Claude Code sessions end."));
|
|
1627
1635
|
console.log();
|
|
1628
|
-
console.log(
|
|
1636
|
+
console.log(
|
|
1637
|
+
import_chalk3.default.yellow("Note: Manual submission (`npx ccgather`) is recommended for most users.")
|
|
1638
|
+
);
|
|
1629
1639
|
console.log();
|
|
1630
1640
|
const inquirer4 = await import("inquirer");
|
|
1631
1641
|
const { proceed } = await inquirer4.default.prompt([
|
|
@@ -1835,7 +1845,19 @@ async function scan(options = {}) {
|
|
|
1835
1845
|
// src/index.ts
|
|
1836
1846
|
init_config();
|
|
1837
1847
|
init_api();
|
|
1838
|
-
var VERSION = "1.3.
|
|
1848
|
+
var VERSION = "1.3.2";
|
|
1849
|
+
var pkg = { name: "ccgather", version: VERSION };
|
|
1850
|
+
var notifier = (0, import_update_notifier.default)({ pkg, updateCheckInterval: 1e3 * 60 * 60 });
|
|
1851
|
+
notifier.notify({
|
|
1852
|
+
message: `${import_chalk6.default.yellow("Update")} available ${import_chalk6.default.dim(VERSION)} \u2192 ${import_chalk6.default.yellow(notifier.update?.latest || "")}
|
|
1853
|
+
${import_chalk6.default.yellow("Run")} ${import_chalk6.default.cyan("npx ccgather@latest")} to update`,
|
|
1854
|
+
boxenOptions: {
|
|
1855
|
+
padding: 1,
|
|
1856
|
+
margin: 1,
|
|
1857
|
+
borderStyle: "round",
|
|
1858
|
+
borderColor: "yellow"
|
|
1859
|
+
}
|
|
1860
|
+
});
|
|
1839
1861
|
var program = new import_commander.Command();
|
|
1840
1862
|
program.name("ccgather").description("Submit your Claude Code usage to the CCgather leaderboard").version(VERSION).option("-y, --yes", "Skip confirmation prompt").option("--auto", "Enable automatic sync on session end").option("--manual", "Disable automatic sync").option("--no-menu", "Skip interactive menu (direct submit)");
|
|
1841
1863
|
program.command("scan").description("Scan Claude Code usage and create ccgather.json").option("-a, --all", "Scan all-time usage (no date limit)").option("-d, --days <number>", "Number of days to scan (default: 30)", parseInt).action((opts) => scan(opts));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccgather",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "CLI tool for syncing Claude Code usage data to CCgather leaderboard",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ccgather": "dist/index.js",
|
|
@@ -30,11 +30,13 @@
|
|
|
30
30
|
"conf": "^13.0.1",
|
|
31
31
|
"inquirer": "^10.2.2",
|
|
32
32
|
"open": "^10.1.0",
|
|
33
|
-
"ora": "^8.1.0"
|
|
33
|
+
"ora": "^8.1.0",
|
|
34
|
+
"update-notifier": "^7.3.1"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@types/inquirer": "^9.0.7",
|
|
37
38
|
"@types/node": "^22.10.2",
|
|
39
|
+
"@types/update-notifier": "^6.0.8",
|
|
38
40
|
"tsup": "^8.3.5",
|
|
39
41
|
"typescript": "^5.7.2"
|
|
40
42
|
},
|