claude-rpc 0.22.1 → 0.23.0

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
@@ -146,13 +146,15 @@ claude-rpc readme # prints paste-ready README badge markdown
146
146
  claude-rpc readme --raw | pbcopy # straight to your clipboard
147
147
  ```
148
148
 
149
- **Live badges, paste once.** With a public profile (`claude-rpc profile set --handle <you> && claude-rpc profile on`), your stats are served as always-current badges from the community worker — no `gh`, no gist, nothing to re-run:
149
+ **Live card + badges, paste once.** With a public profile (`claude-rpc profile set --handle <you> && claude-rpc profile on`), your stats are served as an always-current card (and badges) from the community worker — no `gh`, no gist, nothing to re-run:
150
150
 
151
151
  ```md
152
+ [![Claude Code stats](https://claude-rpc-totals.claude-rpc.workers.dev/card/<you>.svg)](https://claude-rpc.vercel.app/u/<you>)
153
+
152
154
  [![Claude Code hours](https://claude-rpc-totals.claude-rpc.workers.dev/badge/<you>.svg?metric=hours)](https://claude-rpc.vercel.app/?ref=badge)
153
155
  ```
154
156
 
155
- `metric=` is one of `tokens · sessions · hours · streak` (optional `&label=` to retitle). Your profile page at `/u/<you>` has a one-click "copy" for the same block. The badge refreshes itself as the daemon flushes your profile (~every 30 min).
157
+ The card shows tokens, sessions, active hours and streak; badge `metric=` is one of `tokens · sessions · hours · streak` (optional `&label=` to retitle). Both refresh themselves as the daemon flushes your profile (~every 30 min). Your profile page at `/u/<you>` has a one-click "copy" for the whole block.
156
158
 
157
159
  Prefer to render locally? `badge`/`card`/`calendar`/`github-stat` all write SVG, and `--gist` self-hosts a live one:
158
160
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-rpc",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "description": "Discord Rich Presence for Claude Code — live model, project, tokens, and lifetime stats driven by Claude Code's hook system.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.js CHANGED
@@ -1075,35 +1075,43 @@ function doReadme(argv) {
1075
1075
  ['streak', 'Claude Code streak'],
1076
1076
  ['tokens', 'Claude Code tokens'],
1077
1077
  ];
1078
- const liveMd = (h) => metrics
1078
+ // The hero: a live stat card that auto-refreshes from your published profile.
1079
+ const cardMd = (h) => `[![Claude Code stats](${endpoint}/card/${h}.svg)](${site}/u/${h})`;
1080
+ const badgesMd = (h) => metrics
1079
1081
  .map(([m, alt]) => `[![${alt}](${endpoint}/badge/${h}.svg?metric=${m})](${site}/?ref=badge)`)
1080
1082
  .join('\n');
1083
+ const liveMd = (h) => `${cardMd(h)}\n\n${badgesMd(h)}`;
1081
1084
 
1082
1085
  // Raw mode: just the markdown, for `claude-rpc readme --raw | pbcopy`.
1083
1086
  if (raw) {
1084
1087
  process.stdout.write(live
1085
1088
  ? liveMd(handle) + '\n'
1086
- : '<!-- live badges need a public profile: claude-rpc profile set --handle <name> && claude-rpc profile on -->\n');
1089
+ : '<!-- live card/badges need a public profile: claude-rpc profile set --handle <name> && claude-rpc profile on -->\n');
1087
1090
  return;
1088
1091
  }
1089
1092
 
1090
1093
  console.log('');
1091
- console.log(` ${c.bold}${c.magenta}◆ README badges${c.reset}`);
1094
+ console.log(` ${c.bold}${c.magenta}◆ README card + badges${c.reset}`);
1092
1095
  console.log('');
1093
1096
 
1094
1097
  if (live) {
1095
- console.log(` ${c.dim}Live badges for ${c.reset}${c.cyan}@${handle}${c.reset}${c.dim} — paste anywhere; they refresh as you work:${c.reset}`);
1098
+ console.log(` ${c.dim}Live stat card for ${c.reset}${c.cyan}@${handle}${c.reset}${c.dim} — paste once; it auto-updates as you work:${c.reset}`);
1096
1099
  console.log('');
1097
- for (const line of liveMd(handle).split('\n')) console.log(` ${line}`);
1100
+ console.log(` ${cardMd(handle)}`);
1098
1101
  console.log('');
1099
- console.log(` ${c.dim}Pick any metric:${c.reset} ${c.cyan}tokens · sessions · hours · streak${c.reset}`);
1102
+ console.log(` ${c.dim}…or compact badges:${c.reset}`);
1103
+ console.log('');
1104
+ for (const line of badgesMd(handle).split('\n')) console.log(` ${line}`);
1105
+ console.log('');
1106
+ console.log(` ${c.dim}Badge metrics:${c.reset} ${c.cyan}tokens · sessions · hours · streak${c.reset}`);
1100
1107
  console.log(` ${c.dim}One-click copy + shareable page:${c.reset} ${c.cyan}${site}/u/${handle}${c.reset}`);
1101
1108
  console.log(` ${c.dim}Straight to clipboard:${c.reset} ${c.cyan}claude-rpc readme --raw${c.reset}${c.dim} | pbcopy${c.reset}`);
1102
1109
  } else {
1103
- console.log(` ${c.dim}A live, always-current badge needs a public profile. Turn one on:${c.reset}`);
1110
+ console.log(` ${c.dim}A live, always-current card + badges need a public profile. Turn one on:${c.reset}`);
1104
1111
  console.log(` ${c.cyan}claude-rpc profile set --handle <name> && claude-rpc profile on${c.reset}`);
1105
1112
  console.log('');
1106
- console.log(` ${c.dim}Then your badges live here (self-refreshing — paste once):${c.reset}`);
1113
+ console.log(` ${c.dim}Then your card + badges live here (self-refreshing — paste once):${c.reset}`);
1114
+ console.log(` ${c.cyan}${endpoint}/card/<handle>.svg${c.reset}`);
1107
1115
  console.log(` ${c.cyan}${endpoint}/badge/<handle>.svg?metric=hours${c.reset}`);
1108
1116
  }
1109
1117
 
@@ -2003,7 +2011,7 @@ function help() {
2003
2011
  ['statusline', 'One-line status for tmux/shell prompts (--template)'],
2004
2012
  ['calendar', 'Year activity heatmap SVG (--out --gist)'],
2005
2013
  ['session-card', 'Recap card for the current session (--out)'],
2006
- ['readme', 'Paste-ready README badges for your profile (--raw to pipe)'],
2014
+ ['readme', 'Paste-ready README card + badges for your profile (--raw to pipe)'],
2007
2015
  ['mcp install', 'Wire the stats MCP server into Claude Code (one command)'],
2008
2016
  ['mcp uninstall', 'Remove the stats MCP server from Claude Code'],
2009
2017
  ['mcp', 'Run the MCP server (stdio) — exposes your stats to Claude'],
package/src/version.js CHANGED
@@ -11,7 +11,7 @@ import { readFileSync } from 'node:fs';
11
11
  import { join } from 'node:path';
12
12
  import { ROOT } from './paths.js';
13
13
 
14
- const BAKED = '0.22.1';
14
+ const BAKED = '0.23.0';
15
15
 
16
16
  function readPkgVersion() {
17
17
  try {