ccclub 0.3.15 → 0.3.16

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1712,6 +1712,7 @@ var ACTIVE_THRESHOLD_MS = 15 * 60 * 1e3;
1712
1712
  var AGENT_ORDER = ["claude", "codex", "opencode", "amp", "pi"];
1713
1713
  async function rankCommand(options) {
1714
1714
  const config = await requireConfig();
1715
+ const includeCache = options.cache !== false;
1715
1716
  if (!isHookInstalled()) await installHook();
1716
1717
  if (!isHeartbeatInstalled()) await installHeartbeat();
1717
1718
  if (needsFullSync()) {
@@ -1806,11 +1807,15 @@ async function rankCommand(options) {
1806
1807
  const me = rankData.rankings.find((r) => r.userId === config.userId);
1807
1808
  if (me) me.usageSnapshot = localSnapshot;
1808
1809
  }
1809
- printGroup(rankData, code, period, config, options.cache, options.all);
1810
+ printGroup(rankData, code, period, config, includeCache, options.all);
1810
1811
  if (activityData) renderActivity(activityData, range);
1811
1812
  if (i < groupResults.length - 1) console.log("");
1812
1813
  }
1813
- console.log(theme.muted("\n Tokens = input + output + reasoning ") + theme.warning("(cache excluded)") + theme.muted(". Use ") + theme.text("--cache") + theme.muted(" to include cache tokens."));
1814
+ if (includeCache) {
1815
+ console.log(theme.muted("\n Tokens include cache by default. Use ") + theme.text("--no-cache") + theme.muted(" to show input + output + reasoning only."));
1816
+ } else {
1817
+ console.log(theme.muted("\n Tokens = input + output + reasoning ") + theme.warning("(cache excluded)") + theme.muted(". Cost still includes cache."));
1818
+ }
1814
1819
  const update = await getUpdateResult();
1815
1820
  if (update) {
1816
1821
  console.log(theme.warningBold("\n Update available") + theme.muted(`: ${update.current} \u2192 ${update.latest} Run `) + theme.linkText("npm i -g ccclub@latest"));
@@ -1834,7 +1839,7 @@ function formatTokens(n) {
1834
1839
  }
1835
1840
  return String(n);
1836
1841
  }
1837
- function printGroup(data, code, period, config, showCache = false, showAll = false) {
1842
+ function printGroup(data, code, period, config, showCache = true, showAll = false) {
1838
1843
  if (data.rankings.length === 0) {
1839
1844
  console.log(theme.title(`
1840
1845
  ${data.group.name}`));
@@ -2388,7 +2393,7 @@ async function hookCommand() {
2388
2393
  }
2389
2394
 
2390
2395
  // src/index.ts
2391
- var VERSION = "0.3.15";
2396
+ var VERSION = "0.3.16";
2392
2397
  startUpdateCheck(VERSION);
2393
2398
  var program = new Command();
2394
2399
  if (process.argv.slice(2).includes("-v")) {
@@ -2396,7 +2401,7 @@ if (process.argv.slice(2).includes("-v")) {
2396
2401
  process.exit(0);
2397
2402
  }
2398
2403
  program.name("ccclub").description("Claude Code, Codex, OpenCode, Amp, and pi-agent usage leaderboard among friends").version(VERSION);
2399
- program.command("rank", { isDefault: true, hidden: true }).description("Show leaderboard").option("-d, --days [days]", "Time window: 1 | 7 | 30 | all (default: today)").addOption(new Option("-p, --period [period]").hideHelp()).option("-g, --group <code>", "Group invite code").option("--global", "Show global public ranking").option("--cache", "Include cache tokens in count").option("--all", "Show all members including those with no activity").action(rankCommand);
2404
+ program.command("rank", { isDefault: true, hidden: true }).description("Show leaderboard").option("-d, --days [days]", "Time window: 1 | 7 | 30 | all (default: today)").addOption(new Option("-p, --period [period]").hideHelp()).option("-g, --group <code>", "Group invite code").option("--global", "Show global public ranking").addOption(new Option("--cache", "Include cache tokens in count (default)").hideHelp()).option("--no-cache", "Exclude cache tokens from token counts").option("--all", "Show all members including those with no activity").action(rankCommand);
2400
2405
  program.command("init").description("Create a group and get started (first-time setup)").action(initCommand);
2401
2406
  program.command("join").description("Join a group with a 6-letter invite code").argument("[invite-code]", "6-character invite code").action((code) => {
2402
2407
  if (!code) {
@@ -2433,7 +2438,7 @@ Leaderboard options:
2433
2438
  -d <period> Time window: 1 | 7 | 30 | all (default: today)
2434
2439
  -g <code> Show a specific group
2435
2440
  --global Global public leaderboard
2436
- --cache Include cache tokens in total
2441
+ --no-cache Exclude cache tokens from token totals
2437
2442
  --all Show all members including inactive ones
2438
2443
 
2439
2444
  Examples:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccclub",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "type": "module",
5
5
  "description": "Claude Code and Codex leaderboard among friends for coding agent tokens and costs",
6
6
  "bin": {