ccclub 0.2.21 → 0.2.22
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 +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -667,10 +667,10 @@ async function rankCommand(options) {
|
|
|
667
667
|
}
|
|
668
668
|
const data = await res.json();
|
|
669
669
|
if (i === 0) spinner.stop();
|
|
670
|
-
printGroup(data, code, period, config);
|
|
670
|
+
printGroup(data, code, period, config, options.cache);
|
|
671
671
|
if (i < codes.length - 1) console.log("");
|
|
672
672
|
}
|
|
673
|
-
console.log(chalk5.dim("\n
|
|
673
|
+
console.log(chalk5.dim("\n Tokens = input + output (cache excluded). Use --cache to include cache tokens."));
|
|
674
674
|
} catch (err) {
|
|
675
675
|
spinner.fail(`Error: ${err instanceof Error ? err.message : err}`);
|
|
676
676
|
}
|
|
@@ -686,7 +686,7 @@ function formatTokens(n) {
|
|
|
686
686
|
}
|
|
687
687
|
return String(n);
|
|
688
688
|
}
|
|
689
|
-
function printGroup(data, code, period, config) {
|
|
689
|
+
function printGroup(data, code, period, config, showCache = false) {
|
|
690
690
|
if (data.rankings.length === 0) {
|
|
691
691
|
console.log(chalk5.bold(`
|
|
692
692
|
${data.group.name}`));
|
|
@@ -708,10 +708,11 @@ function printGroup(data, code, period, config) {
|
|
|
708
708
|
const marker = isMe ? chalk5.green("\u2192") : " ";
|
|
709
709
|
const name = isMe ? chalk5.green.bold(entry.displayName) : entry.displayName;
|
|
710
710
|
const rankColor = entry.rank <= 3 ? chalk5.yellow : chalk5.white;
|
|
711
|
+
const tokens = showCache ? entry.totalTokens : entry.inputTokens + entry.outputTokens;
|
|
711
712
|
table.push([
|
|
712
713
|
`${marker}${rankColor(String(entry.rank))}`,
|
|
713
714
|
name,
|
|
714
|
-
formatTokens(
|
|
715
|
+
formatTokens(tokens),
|
|
715
716
|
`$${entry.costUSD.toFixed(2)}`,
|
|
716
717
|
String(entry.chatCount)
|
|
717
718
|
]);
|
|
@@ -885,11 +886,11 @@ async function hookCommand() {
|
|
|
885
886
|
|
|
886
887
|
// src/index.ts
|
|
887
888
|
var program = new Command();
|
|
888
|
-
program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version("0.2.
|
|
889
|
+
program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version("0.2.22");
|
|
889
890
|
program.command("init").description("Initialize CCClub (one-time setup)").action(initCommand);
|
|
890
891
|
program.command("join").description("Join a friend's group").argument("<invite-code>", "6-character invite code").action(joinCommand);
|
|
891
892
|
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);
|
|
892
|
-
program.command("rank", { isDefault: true }).description("Show leaderboard rankings").option("-p, --period <period>", "daily, weekly, monthly, all-time", "daily").option("-g, --group <code>", "Group invite code").option("--global", "Show global public ranking").action(rankCommand);
|
|
893
|
+
program.command("rank", { isDefault: true }).description("Show leaderboard rankings").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", "Show token count including cache").action(rankCommand);
|
|
893
894
|
program.command("profile").description("View or update your profile").option("-n, --name <name>", "Set display name").option("--avatar <url>", "Set avatar URL (empty string to reset)").option("--public", "Set profile visibility to public").option("--private", "Set profile visibility to private").action(profileCommand);
|
|
894
895
|
program.command("create").description("Create a new group").action(createGroupCommand);
|
|
895
896
|
program.command("show-data").description("Show exactly what data CCClub uploads (privacy audit)").action(showDataCommand);
|