claudial 0.7.1 → 0.8.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
@@ -2,10 +2,10 @@
2
2
 
3
3
  # ⚽ claudial
4
4
 
5
- ### Live football inside Claude Code
5
+ ### Live football inside Claude Code, Cursor and your editor
6
6
 
7
- Your teams' scores sit under your prompt while you code.
8
- When one of them scores, your terminal celebrates.
7
+ Your teams' scores sit in your status bar while you code: Claude Code, Cursor,
8
+ VS Code, Antigravity, Windsurf. When one of them scores, it celebrates.
9
9
 
10
10
  ```
11
11
  npm install -g claudial && claudial setup
@@ -37,7 +37,7 @@ Europa League · Conference League · Super League Greece · World Cup**
37
37
  | You are… | Run |
38
38
  |---|---|
39
39
  | **New to claudial** | `npm install -g claudial`<br>`claudial setup` |
40
- | **Back from the World Cup** (you have 0.6.x) | `npm install -g claudial@latest`<br>`claudial --version` (should print 0.7.0 or newer)<br>`claudial follow` |
40
+ | **Back from the World Cup** (you have 0.6.x) | `npm install -g claudial@latest`<br>`claudial --version` (should print 0.8.0 or newer)<br>`claudial follow` |
41
41
 
42
42
  Then restart Claude Code. World Cup users keep their status line as it is; `claudial follow`
43
43
  picks your leagues and teams, because the new version starts following nothing.
@@ -46,6 +46,29 @@ Still seeing "WORLD CUP 2026" after updating? An old copy comes first on your PA
46
46
  `which -a claudial` lists every copy; remove the old one with
47
47
  `npm uninstall -g --prefix <its folder> claudial` (e.g. `--prefix ~/.npm-global`).
48
48
 
49
+ ## Works where you code
50
+
51
+ | Where you code | Run |
52
+ |---|---|
53
+ | **Claude Code** | `npm install -g claudial && claudial setup` |
54
+ | **Cursor CLI** (`cursor-agent`) | `npm install -g claudial && claudial setup --cursor --yes` |
55
+ | **VS Code** | `code --install-extension lefprog.claudial` |
56
+ | **Cursor** | `cursor --install-extension lefprog.claudial` |
57
+ | **Antigravity** | `antigravity --install-extension lefprog.claudial` |
58
+ | **Windsurf** | `windsurf --install-extension lefprog.claudial` |
59
+ | **Codex CLI** | not yet: Codex's status line can only show its own built-in items |
60
+
61
+ In the editors you can also search **claudial** in the Extensions panel. Reload the
62
+ window after installing; the score sits at the bottom right. Click it to pick your
63
+ teams. The editor extension and the CLI share your device, so you follow the same
64
+ teams everywhere.
65
+
66
+ <div align="center">
67
+
68
+ ![claudial in the editor status bar: VS Code during Liverpool 6—0 and the GOOOL flash for 7—0, and Cursor showing the next kickoff](extension/images/statusbar.png)
69
+
70
+ </div>
71
+
49
72
  ## The score, right under your prompt
50
73
 
51
74
  One command puts a live score line into Claude Code's status bar. It stays out
@@ -114,10 +137,11 @@ claudial follow # pick leagues and teams
114
137
 
115
138
  Requires Node ≥ 18. No account, no sign-up, no API key.
116
139
 
117
- Scripting it? `claudial setup --statusline --yes` installs without
118
- prompts, and `claudial leagues`, `claudial teams <league>`,
119
- `claudial follow <id>...`, `claudial unfollow <id>...` and `claudial following`
120
- work without the UI. `claudial forget` deletes your device from the server.
140
+ Scripting it? `claudial setup --statusline --yes` (Claude Code) and
141
+ `claudial setup --cursor --yes` (Cursor CLI) install without prompts, and
142
+ `claudial leagues`, `claudial teams <league>`, `claudial follow <id>...`,
143
+ `claudial unfollow <id>...` and `claudial following` work without the UI.
144
+ `claudial forget` deletes your device from the server.
121
145
 
122
146
  ## Status
123
147
 
@@ -3,8 +3,13 @@ import { deviceId } from './device.js';
3
3
  // TLS; scripts/check-release.mjs blocks an npm publish until this is https://.
4
4
  // CLAUDIAL_API_URL always wins (local dev: http://localhost:8080).
5
5
  export const DEFAULT_API_URL = 'http://161.97.67.12:30083';
6
+ let serverOverride = null;
7
+ /** For embedders (the editor extension): a server chosen in settings. The env var still wins. */
8
+ export function setServerUrl(url) {
9
+ serverOverride = url && url.trim() ? url.trim() : null;
10
+ }
6
11
  export function apiUrl(env = process.env) {
7
- return (env.CLAUDIAL_API_URL || DEFAULT_API_URL).replace(/\/+$/, '');
12
+ return (env.CLAUDIAL_API_URL || serverOverride || DEFAULT_API_URL).replace(/\/+$/, '');
8
13
  }
9
14
  /** Thrown for any non-2xx answer, carrying the server's own error message. */
10
15
  export class ApiError extends Error {
package/dist/index.js CHANGED
@@ -29,8 +29,9 @@ const HELP = `claudial: live football in your terminal and Claude Code's status
29
29
  claudial the live dashboard (keys: f follow · r refresh · q quit)
30
30
  claudial --ticker a 4-line strip for slim split panes
31
31
  claudial | cat plain snapshot for pipes and scripts
32
- claudial setup install the Claude Code status line and pick your teams
33
- claudial setup --statusline --yes install the status line only, no prompts
32
+ claudial setup install the status line (Claude Code, Cursor CLI) and pick your teams
33
+ claudial setup --statusline --yes Claude Code status line only, no prompts
34
+ claudial setup --cursor --yes Cursor CLI status line only, no prompts
34
35
  ${USAGE.replace(/^usage:\n/, '')}
35
36
 
36
37
  CLAUDIAL_API_URL=<url> use another claudial server`;
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Text, useInput, useApp } from 'ink';
3
3
  import { ACCENT } from '../ui/Header.js';
4
4
  /**
5
- * A single confirmation: install the live-score statusline globally into Claude
6
- * Code. No scope or tmux prompts — global is the one supported path.
5
+ * A single confirmation: install the live-score statusline into Claude Code,
6
+ * and into the Cursor CLI too when Cursor is on this machine.
7
7
  */
8
- export function Wizard({ defaultShell, onDone }) {
8
+ export function Wizard({ defaultShell, cursorFound, onDone }) {
9
9
  const { exit } = useApp();
10
10
  useInput((input, key) => {
11
11
  if (input === 'q' || input.toLowerCase() === 'n') {
@@ -13,9 +13,9 @@ export function Wizard({ defaultShell, onDone }) {
13
13
  return;
14
14
  }
15
15
  if (key.return || input.toLowerCase() === 'y') {
16
- onDone({ statusline: true, scope: 'global', tmux: false, shell: defaultShell, yes: true, interactive: false });
16
+ onDone({ statusline: true, cursor: cursorFound, scope: 'global', tmux: false, shell: defaultShell, yes: true, interactive: false });
17
17
  exit();
18
18
  }
19
19
  });
20
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: _jsx(Text, { bold: true, color: ACCENT, children: "claudial setup" }) }), _jsx(Text, { children: "Install the live-score statusline into Claude Code? (Y/n)" }), _jsx(Text, { dimColor: true, children: " \u2022 statusline \u2192 global (~/.claude/settings.json)" }), _jsx(Text, { dimColor: true, children: "q to quit" })] }));
20
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { children: _jsx(Text, { bold: true, color: ACCENT, children: "claudial setup" }) }), _jsx(Text, { children: "Install the live-score statusline? (Y/n)" }), _jsx(Text, { dimColor: true, children: " \u2022 Claude Code \u2192 ~/.claude/settings.json" }), cursorFound ? _jsx(Text, { dimColor: true, children: " \u2022 Cursor CLI \u2192 ~/.cursor/cli-config.json" }) : null, _jsx(Text, { dimColor: true, children: "q to quit" })] }));
21
21
  }
@@ -1,13 +1,23 @@
1
1
  import { installStatusline } from './settings.js';
2
+ import { installCursorStatusline } from './cursor.js';
2
3
  import { appendAlias } from './shellrc.js';
3
4
  export function applySetup(opts, ctx) {
4
- const report = { statuslineWritten: false, statuslineBackedUp: false, statuslineWrapped: false, aliasAppended: false };
5
+ const report = {
6
+ statuslineWritten: false, statuslineBackedUp: false, statuslineWrapped: false,
7
+ cursorWritten: false, cursorBackedUp: false, cursorWrapped: false, aliasAppended: false,
8
+ };
5
9
  if (opts.statusline) {
6
10
  const r = installStatusline(ctx.settingsPath, ctx.command, ctx.conflict);
7
11
  report.statuslineWritten = r.written;
8
12
  report.statuslineBackedUp = r.backedUp;
9
13
  report.statuslineWrapped = r.wrapped;
10
14
  }
15
+ if (opts.cursor) {
16
+ const r = installCursorStatusline(ctx.cursorPath, ctx.command);
17
+ report.cursorWritten = r.written;
18
+ report.cursorBackedUp = r.backedUp;
19
+ report.cursorWrapped = r.wrapped;
20
+ }
11
21
  if (opts.tmux) {
12
22
  report.aliasAppended = appendAlias(ctx.rcPath, ctx.shell).appended;
13
23
  }
@@ -0,0 +1,48 @@
1
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ // The Cursor CLI (cursor-agent) status line: the same `claudial --statusline`
4
+ // command as Claude Code, in ~/.cursor/cli-config.json with Cursor's own keys.
5
+ export function cursorConfigPath(home) {
6
+ return join(home, '.cursor', 'cli-config.json');
7
+ }
8
+ function block(command) {
9
+ return { type: 'command', command, padding: 0, updateIntervalMs: 1000, timeoutMs: 3000 };
10
+ }
11
+ /** Read → (wrap a foreign command) → merge → (backup) → write. Same rules as the Claude Code writer. */
12
+ export function installCursorStatusline(path, command) {
13
+ const fileExists = existsSync(path);
14
+ let existing = {};
15
+ if (fileExists) {
16
+ try {
17
+ existing = JSON.parse(readFileSync(path, 'utf8'));
18
+ }
19
+ catch {
20
+ existing = {};
21
+ }
22
+ }
23
+ const theirs = typeof existing?.statusLine?.command === 'string' ? existing.statusLine.command : '';
24
+ let final = command;
25
+ let wrapped = false;
26
+ if (theirs.includes('claudial --statusline')) {
27
+ const w = theirs.indexOf(' --wrap ');
28
+ if (w >= 0) {
29
+ final = command + theirs.slice(w);
30
+ wrapped = true;
31
+ }
32
+ }
33
+ else if (theirs) {
34
+ final = `${command} --wrap '${theirs.replace(/'/g, `'\\''`)}'`;
35
+ wrapped = true;
36
+ }
37
+ const next = block(final);
38
+ if (JSON.stringify(existing.statusLine) === JSON.stringify(next))
39
+ return { written: false, backedUp: false, wrapped };
40
+ let backedUp = false;
41
+ if (fileExists) {
42
+ copyFileSync(path, `${path}.bak`);
43
+ backedUp = true;
44
+ }
45
+ mkdirSync(dirname(path), { recursive: true });
46
+ writeFileSync(path, JSON.stringify({ ...existing, statusLine: next }, null, 2) + '\n');
47
+ return { written: true, backedUp, wrapped };
48
+ }
@@ -1,4 +1,5 @@
1
1
  import { execFileSync } from 'node:child_process';
2
+ import { existsSync } from 'node:fs';
2
3
  import { join } from 'node:path';
3
4
  export function detectShell(env = process.env) {
4
5
  const s = env.SHELL ?? '';
@@ -29,6 +30,10 @@ export function isOnPath(bin) {
29
30
  return false;
30
31
  }
31
32
  }
33
+ /** Cursor (editor or CLI) has been used on this machine. */
34
+ export function hasCursor(home) {
35
+ return existsSync(join(home, '.cursor'));
36
+ }
32
37
  export function hasTmux() {
33
38
  return isOnPath('tmux');
34
39
  }
@@ -5,10 +5,12 @@ export function parseFlags(args) {
5
5
  const shell = SHELLS.includes(shellArg) ? shellArg : null;
6
6
  const statusline = has('--statusline');
7
7
  const tmux = has('--tmux');
8
+ const cursor = has('--cursor');
8
9
  // any actionable flag (or --yes) means run without prompting
9
- const interactive = !(statusline || tmux || has('--yes'));
10
+ const interactive = !(statusline || tmux || cursor || has('--yes'));
10
11
  return {
11
12
  statusline,
13
+ cursor,
12
14
  scope: has('--project') ? 'project' : 'global',
13
15
  tmux,
14
16
  shell,
@@ -3,7 +3,8 @@ import { join } from 'node:path';
3
3
  import React from 'react';
4
4
  import { render } from 'ink';
5
5
  import { parseFlags } from './flags.js';
6
- import { detectShell, rcPathFor, isOnPath } from './detect.js';
6
+ import { detectShell, rcPathFor, isOnPath, hasCursor } from './detect.js';
7
+ import { cursorConfigPath } from './cursor.js';
7
8
  import { applySetup } from './apply.js';
8
9
  import { Wizard } from './Wizard.js';
9
10
  function commandFor() {
@@ -15,6 +16,7 @@ function contextFor(opts) {
15
16
  const settingsPath = join(homedir(), '.claude', 'settings.json');
16
17
  return {
17
18
  settingsPath,
19
+ cursorPath: cursorConfigPath(homedir()),
18
20
  rcPath: rcPathFor(shell, homedir()),
19
21
  shell,
20
22
  command: commandFor(),
@@ -33,6 +35,16 @@ function printReport(opts, ctx, report) {
33
35
  else if (opts.statusline) {
34
36
  console.log('• statusline unchanged (an existing statusLine was kept).');
35
37
  }
38
+ if (report.cursorWritten) {
39
+ console.log(`✓ Cursor CLI statusline installed → ${ctx.cursorPath}`);
40
+ if (report.cursorWrapped)
41
+ console.log(' (kept your existing status line and appended the score)');
42
+ if (report.cursorBackedUp)
43
+ console.log(` (previous config backed up to ${ctx.cursorPath}.bak)`);
44
+ }
45
+ else if (opts.cursor) {
46
+ console.log('• Cursor CLI statusline already installed.');
47
+ }
36
48
  if (report.aliasAppended) {
37
49
  console.log(`✓ tmux alias added → ${ctx.rcPath}`);
38
50
  console.log(` Open a new shell, then run: claude-mundial`);
@@ -40,7 +52,7 @@ function printReport(opts, ctx, report) {
40
52
  else if (opts.tmux) {
41
53
  console.log('• tmux alias already present — left as-is.');
42
54
  }
43
- if (!opts.statusline && !opts.tmux)
55
+ if (!opts.statusline && !opts.cursor && !opts.tmux)
44
56
  console.log('Nothing selected. Run `claudial setup` again to choose options.');
45
57
  }
46
58
  export async function runSetup(args) {
@@ -56,6 +68,7 @@ export async function runSetup(args) {
56
68
  await new Promise((resolve) => {
57
69
  const { waitUntilExit } = render(React.createElement(Wizard, {
58
70
  defaultShell: detectShell(),
71
+ cursorFound: hasCursor(homedir()),
59
72
  onDone: (final) => run(final),
60
73
  }));
61
74
  waitUntilExit().then(() => resolve());
package/dist/snapshot.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { fetchLive, fetchRecent, fetchUpcoming, followsNothing } from './api/backend.js';
2
- import { kickoffColumn } from './ui/UpcomingSection.js';
2
+ import { kickoffColumn, kickoffWidth } from './ui/kickoff.js';
3
3
  import { homeName, awayName } from './ui/flags.js';
4
- function line(m) {
4
+ function line(m, width = 22) {
5
5
  if (m.status === 'upcoming')
6
- return `o ${kickoffColumn(m.startTimestamp)}${homeName(m.home)} - ${awayName(m.away)}`;
6
+ return `o ${kickoffColumn(m.startTimestamp, Date.now(), width)}${homeName(m.home)} - ${awayName(m.away)}`;
7
7
  const label = m.status === 'finished' ? 'FT' : m.status === 'halftime' ? 'HT' : `${m.minute ?? '?'}'`;
8
8
  return `* ${label.padEnd(4)} ${homeName(m.home)} ${m.homeScore ?? '-'} - ${m.awayScore ?? '-'} ${awayName(m.away)}`;
9
9
  }
@@ -21,6 +21,8 @@ export async function printSnapshot(seasonId) {
21
21
  console.log(line(m));
22
22
  if (upcoming.length)
23
23
  console.log('UPCOMING');
24
- for (const m of upcoming.slice(0, 8))
25
- console.log(line(m));
24
+ const next = upcoming.slice(0, 8);
25
+ const width = kickoffWidth(next.map((m) => m.startTimestamp));
26
+ for (const m of next)
27
+ console.log(line(m, width));
26
28
  }
@@ -1,4 +1,4 @@
1
- import { formatKickoff } from '../ui/UpcomingSection.js';
1
+ import { formatKickoff } from '../ui/kickoff.js';
2
2
  import { homeName, awayName } from '../ui/flags.js';
3
3
  import { matchPrediction } from '../predictions/match.js';
4
4
  import { headline } from '../predictions/format.js';
@@ -1,7 +1,7 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Box, Text } from 'ink';
3
3
  import { ACCENT } from './Header.js';
4
- import { formatKickoff, kickoffColumn } from './UpcomingSection.js';
4
+ import { formatKickoff, kickoffColumn } from './kickoff.js';
5
5
  import { homeName, awayName } from './flags.js';
6
6
  /** One side's goals grouped by scorer, in order of their first goal: "43' 50' C. Gakpo · 47' D. Núñez". */
7
7
  export function scorers(goals) {
package/dist/ui/Ticker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Box, Text } from 'ink';
3
- import { formatKickoff } from './UpcomingSection.js';
3
+ import { formatKickoff } from './kickoff.js';
4
4
  import { ACCENT, RED } from './Header.js';
5
5
  import { spacedCaps } from '../banner.js';
6
6
  import { homeName, awayName } from './flags.js';
@@ -3,28 +3,14 @@ import { Box, Text } from 'ink';
3
3
  import { homeName, awayName } from './flags.js';
4
4
  import { matchPrediction } from '../predictions/match.js';
5
5
  import { fullSlate, headline } from '../predictions/format.js';
6
- export function formatKickoff(ts, now = Date.now()) {
7
- const d = new Date(ts * 1000);
8
- const time = d.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' });
9
- const sameDay = d.toDateString() === new Date(now).toDateString();
10
- if (sameDay)
11
- return time;
12
- // Within the week a weekday is enough; further out (fixtures reach ~3 weeks) add the date.
13
- const soon = ts * 1000 - now < 6 * 86_400_000;
14
- const day = d.toLocaleDateString(undefined, soon ? { weekday: 'short' } : { weekday: 'short', day: 'numeric', month: 'short' });
15
- return `${day} ${time}`;
16
- }
17
- /** The kickoff padded to `width` (default: fits the longest date format), always followed by a space. */
18
- export function kickoffColumn(ts, now = Date.now(), width = 22) {
19
- const k = formatKickoff(ts, now);
20
- return k.length >= width - 1 ? `${k} ` : k.padEnd(width);
21
- }
6
+ export { formatKickoff, kickoffColumn } from './kickoff.js';
7
+ import { formatKickoff, kickoffColumn, kickoffWidth } from './kickoff.js';
22
8
  export function UpcomingSection({ matches, compact, predictions = [], }) {
23
9
  const shown = matches.slice(0, compact ? 1 : 8);
24
10
  if (shown.length === 0)
25
11
  return null;
26
12
  // One column for the whole list: as wide as its longest kickoff, plus a gap.
27
- const width = Math.max(...shown.map((m) => formatKickoff(m.startTimestamp).length)) + 2;
13
+ const width = kickoffWidth(shown.map((m) => m.startTimestamp));
28
14
  if (compact) {
29
15
  const m = shown[0];
30
16
  const pred = matchPrediction(m, predictions);
@@ -0,0 +1,24 @@
1
+ // Kickoff times as text. Plain functions with no UI imports, so the status line
2
+ // and the editor extension can use them without pulling in Ink.
3
+ export function formatKickoff(ts, now = Date.now()) {
4
+ const d = new Date(ts * 1000);
5
+ const time = d.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' });
6
+ const sameDay = d.toDateString() === new Date(now).toDateString();
7
+ if (sameDay)
8
+ return time;
9
+ // Within the week a weekday is enough; further out (fixtures reach ~3 weeks) add the date.
10
+ const soon = ts * 1000 - now < 6 * 86_400_000;
11
+ const day = d.toLocaleDateString(undefined, soon ? { weekday: 'short' } : { weekday: 'short', day: 'numeric', month: 'short' });
12
+ return `${day} ${time}`;
13
+ }
14
+ /** The kickoff padded to `width` (default: fits the longest date format), always followed by a space. */
15
+ export function kickoffColumn(ts, now = Date.now(), width = 22) {
16
+ const k = formatKickoff(ts, now);
17
+ return k.length >= width - 1 ? `${k} ` : k.padEnd(width);
18
+ }
19
+ /** One column width for a list of kickoffs: its longest date plus a two-space gap. */
20
+ export function kickoffWidth(timestamps, now = Date.now()) {
21
+ if (timestamps.length === 0)
22
+ return 22;
23
+ return Math.max(...timestamps.map((ts) => formatKickoff(ts, now).length)) + 2;
24
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "claudial",
3
- "version": "0.7.1",
4
- "description": "Live football scores for your leagues and teams, in your terminal and Claude Code's status bar — goal and red-card takeovers included",
3
+ "version": "0.8.0",
4
+ "description": "Live football for your teams in the status bar of Claude Code and Cursor CLI, plus a terminal dashboard with goal and red-card takeovers",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "claudial": "dist/index.js"
@@ -35,10 +35,13 @@
35
35
  "worldcup",
36
36
  "tui",
37
37
  "cli",
38
- "football",
39
38
  "soccer",
40
39
  "live-scores",
41
- "ink"
40
+ "ink",
41
+ "cursor",
42
+ "vscode",
43
+ "antigravity",
44
+ "statusline"
42
45
  ],
43
46
  "license": "MIT",
44
47
  "repository": {