ccclub 0.2.44 → 0.2.46
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 +23 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { Command } from "commander";
|
|
4
|
+
import { Command, Option } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/commands/init.ts
|
|
7
7
|
import { createInterface } from "readline/promises";
|
|
@@ -806,8 +806,8 @@ function printGroup(data, code, period, config, showCache = false) {
|
|
|
806
806
|
head.push("Monthly ROI");
|
|
807
807
|
widths.push(15);
|
|
808
808
|
}
|
|
809
|
-
head.push("Chats");
|
|
810
|
-
widths.push(8);
|
|
809
|
+
head.push("Chats", "$/Chat");
|
|
810
|
+
widths.push(8, 9);
|
|
811
811
|
const table = new Table({
|
|
812
812
|
head: head.map((h) => chalk5.cyan(h)),
|
|
813
813
|
style: { head: [], border: [] },
|
|
@@ -841,6 +841,7 @@ function printGroup(data, code, period, config, showCache = false) {
|
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
row.push(c(String(entry.chatCount)));
|
|
844
|
+
row.push(entry.chatCount > 0 ? c(`$${(entry.costUSD / entry.chatCount).toFixed(2)}`) : chalk5.dim("\u2014"));
|
|
844
845
|
table.push(row);
|
|
845
846
|
}
|
|
846
847
|
console.log(table.toString());
|
|
@@ -1114,17 +1115,26 @@ async function hookCommand() {
|
|
|
1114
1115
|
}
|
|
1115
1116
|
|
|
1116
1117
|
// src/index.ts
|
|
1117
|
-
var VERSION = "0.2.
|
|
1118
|
+
var VERSION = "0.2.46";
|
|
1118
1119
|
startUpdateCheck(VERSION);
|
|
1119
1120
|
var program = new Command();
|
|
1120
|
-
program.name("ccclub").description("
|
|
1121
|
-
program.command("init").description("Initialize CCClub (one-time setup)").action(initCommand);
|
|
1122
|
-
program.command("join").description("Join a friend's group").argument("<invite-code>", "6-character invite code").action(joinCommand);
|
|
1123
|
-
program.command("sync").description("Sync local usage data to server").option("-s, --silent", "No output (used by auto-sync hook)").option("-f, --full", "Force full re-sync of all data").action(syncCommand);
|
|
1121
|
+
program.name("ccclub").description("Compare Claude Code usage with friends").version(VERSION);
|
|
1124
1122
|
program.command("rank", { isDefault: true, hidden: true }).description("Show leaderboard").option("-p, --period [period]", "daily | weekly | monthly | all-time", "daily").option("-g, --group <code>", "Group invite code").option("--global", "Show global public ranking").option("--cache", "Include cache tokens in count").action(rankCommand);
|
|
1125
|
-
program.command("
|
|
1126
|
-
program.command("
|
|
1127
|
-
program.command("
|
|
1128
|
-
|
|
1129
|
-
|
|
1123
|
+
program.command("init").description("Create a group and start tracking (first-time setup)").action(initCommand);
|
|
1124
|
+
program.command("join").description("Join a group with a 6-letter invite code").argument("<invite-code>", "6-character invite code").action(joinCommand);
|
|
1125
|
+
program.command("sync").description("Upload usage data (runs automatically after each chat)").addOption(new Option("-s, --silent").hideHelp()).option("-f, --force", "Force full re-sync of all data").addOption(new Option("--full", "Same as --force").hideHelp()).action(
|
|
1126
|
+
(options) => syncCommand({ ...options, full: options.full || options.force })
|
|
1127
|
+
);
|
|
1128
|
+
program.command("profile").description("View or update name, avatar, plan, visibility").option("-n, --name <name>", "Set display name").option("--avatar <url>", "Set avatar URL (empty to reset)").option("--public", "Make profile visible in global ranking").option("--private", "Hide from global ranking").option("--plan <plan>", "pro ($20) | max100 ($100) | max200 ($200) | api | none").action(profileCommand);
|
|
1129
|
+
program.command("create").description("Create an additional group").action(createGroupCommand);
|
|
1130
|
+
program.command("show-data").description("Preview exactly what gets uploaded (privacy check)").action(showDataCommand);
|
|
1131
|
+
program.command("hook", { hidden: true }).description("Set up auto-sync hook").action(hookCommand);
|
|
1132
|
+
program.addHelpText("after", `
|
|
1133
|
+
Examples:
|
|
1134
|
+
$ ccclub Show today's leaderboard (default)
|
|
1135
|
+
$ ccclub -p weekly Switch period: weekly | monthly | all-time
|
|
1136
|
+
$ ccclub --global Global public leaderboard
|
|
1137
|
+
$ ccclub --cache Include cache tokens in total
|
|
1138
|
+
$ ccclub sync --force Force full re-sync of all data
|
|
1139
|
+
`);
|
|
1130
1140
|
program.parse();
|