@claudinho/cli 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -0
  3. package/dist/index.js +3459 -0
  4. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arturo Garrido
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # @claudinho/cli ⚽
2
+
3
+ **The 2026 men's football tournament, right in your terminal.** Live scores, fixtures, and group tables — TZ-aware, localized, scriptable.
4
+
5
+ > ⚠️ **Not affiliated with, endorsed by, or connected to FIFA or Anthropic.**
6
+ > Claudinho is an independent, open-source fan project. It shows factual match
7
+ > data (scores, fixtures, standings) with emoji flags only — no logos, crests,
8
+ > kits, broadcast footage, or player likenesses.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm i -g @claudinho/cli # installs the `claudinho` binary
14
+ # or run without installing:
15
+ npx @claudinho/cli today
16
+ ```
17
+
18
+ ## Commands
19
+
20
+ ```bash
21
+ claudinho today [date] # a day's fixtures (default: today), live scores inline
22
+ claudinho live # matches in play right now
23
+ claudinho next <TEAM> # a team's next fixture + countdown (e.g. next MEX)
24
+ claudinho table [GROUP] # group standings (default: all groups)
25
+ claudinho match <id> # a single match's detail
26
+ claudinho prompt # one compact status line (for statusline/tmux/Starship)
27
+ claudinho init-statusline # wire it into the Claude Code statusline
28
+ claudinho hook # live-score context for a Claude Code hook (silent off-match)
29
+ claudinho init-hook # make Claude itself score-aware (UserPromptSubmit)
30
+ ```
31
+
32
+ ### Examples
33
+
34
+ ```bash
35
+ claudinho today --tz America/Mexico_City --lang es
36
+ claudinho next BRA --tz America/Sao_Paulo --lang pt
37
+ claudinho table A
38
+ claudinho live --json | jq '.matches[].status'
39
+ ```
40
+
41
+ ## Global options
42
+
43
+ | Flag | Description |
44
+ |---|---|
45
+ | `--lang <code>` | `en`, `es`, `pt`, `fr` (also via `CLAUDINHO_LANG`; falls back to `$LANG`) |
46
+ | `--tz <zone>` | IANA timezone, e.g. `America/Mexico_City` (also `CLAUDINHO_TZ`; default: system) |
47
+ | `--json` | machine-readable output for scripting |
48
+ | `--no-color` | disable ANSI color (also honors `NO_COLOR`; auto-off when piped) |
49
+ | `--source <name>` | data source (default: `espn`) |
50
+
51
+ Team codes are 3-letter (FIFA/IOC-style): `MEX`, `BRA`, `USA`, `ENG`, …
52
+
53
+ ## Statusline (Claude Code)
54
+
55
+ ```bash
56
+ claudinho init-statusline # patches ~/.claude/settings.json (backs up first)
57
+ claudinho init-statusline --print # just print the snippet
58
+ ```
59
+
60
+ The statusline reads from a local micro-cache and **never blocks on the
61
+ network** (<150ms). When several matches are live it shows them all inline:
62
+ `⚽ 🇪🇸 1–1 🇮🇶 87' · 🇫🇷 1–2 🇨🇮 86'`. Customize via env:
63
+
64
+ - `CLAUDINHO_TEAM=MEX` — show only your team's match
65
+ - `CLAUDINHO_MAX=2` — cap how many live matches show inline (rest collapse to `+N`; default: all)
66
+ - `CLAUDINHO_COMPACT=0` — show 3-letter codes alongside flags
67
+
68
+ Use the same `claudinho prompt` in **tmux** (`set -g status-right '#(claudinho prompt)'`)
69
+ or a **Starship** custom command — it works in any shell.
70
+
71
+ ### Score-aware Claude (hook)
72
+
73
+ ```bash
74
+ claudinho init-hook # patches ~/.claude/settings.json (backs up first)
75
+ ```
76
+
77
+ Wires `claudinho hook` into Claude Code's `UserPromptSubmit`. During a match,
78
+ the live score is injected into Claude's context so it can mention it naturally;
79
+ off-match it's silent (zero added tokens). Restart Claude Code to activate.
80
+
81
+ ## Other competitions
82
+
83
+ By default Claudinho follows the 2026 World Cup. To follow a different ESPN
84
+ competition (e.g. international friendlies before the tournament starts):
85
+
86
+ ```bash
87
+ export CLAUDINHO_COMPETITION=fifa.friendly
88
+ claudinho live # live friendlies
89
+ unset CLAUDINHO_COMPETITION # back to the World Cup
90
+ ```
91
+
92
+ Only the live fetch changes; the bundled schedule is always the World Cup.
93
+
94
+ ## How it works
95
+
96
+ The full fixture list (104 matches, groups, venues, kickoffs) ships **bundled**
97
+ in the package, so the common path is offline and instant. Only live match
98
+ state hits the network. Scores come from a swappable data adapter (ESPN by
99
+ default); attribution and rate limits are respected.
100
+
101
+ ## License
102
+
103
+ MIT © 2026 Arturo Garrido · [source & issues](https://github.com/arturogarrido/claudinho)