{"id":51381344,"url":"https://github.com/xavidop/diamond","last_synced_at":"2026-07-03T16:35:42.687Z","repository":{"id":366874825,"uuid":"1278269816","full_name":"xavidop/diamond","owner":"xavidop","description":"MLB stats in your terminal and your browser: a Go CLI + web app + DiamondGPT, all on the public MLB Stats API","archived":false,"fork":false,"pushed_at":"2026-06-30T23:20:26.000Z","size":6380,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-30T23:24:35.398Z","etag":null,"topics":["astro","cli","genk","go","mlb","react"],"latest_commit_sha":null,"homepage":"https://diamond.xavidop.me","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xavidop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-23T16:20:43.000Z","updated_at":"2026-06-30T23:20:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xavidop/diamond","commit_stats":null,"previous_names":["xavidop/diamond"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xavidop/diamond","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fdiamond","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fdiamond/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fdiamond/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fdiamond/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xavidop","download_url":"https://codeload.github.com/xavidop/diamond/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xavidop%2Fdiamond/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35094074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","cli","genk","go","mlb","react"],"created_at":"2026-07-03T16:35:39.216Z","updated_at":"2026-07-03T16:35:42.664Z","avatar_url":"https://github.com/xavidop.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚾ Diamond — MLB Stats, Everywhere\n\nExplore the public **MLB Stats API** (`statsapi.mlb.com`) from a beautiful terminal\napp or a full-featured web app — both backed by **DiamondGPT**, an MLB-aware AI\nassistant with live data tool-calling.\n\nThis is a monorepo with two front ends sharing the same idea:\n\n- **[`cli/`](cli/)** — a Go terminal app (`diamond`) built with Bubble Tea.\n- **[`web/`](web/)** — a Vite + React web app with a Genkit (Node) backend.\n\nNo API key is required for MLB data — the MLB Stats API is public and CORS-friendly.\n\n**🌐 [diamond.xavidop.me](https://diamond.xavidop.me)** — landing page  ·  **🖥️ [diamondapp.xavidop.me](https://diamondapp.xavidop.me)** — live web app  ·  **📦 `brew install xavidop/tap/diamond`** — CLI\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/web-home.png\" alt=\"Diamond web app — Today dashboard\"\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/cli-home.png\" alt=\"Diamond CLI — interactive TUI\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eWeb app\u003c/em\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eTerminal app\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Table of Contents\n\n- [⚾ Diamond — MLB Stats, Everywhere](#-diamond--mlb-stats-everywhere)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Screenshots](#screenshots)\n    - [Web](#web)\n    - [CLI](#cli)\n  - [Installation](#installation)\n    - [CLI — Homebrew](#cli--homebrew)\n    - [CLI — Docker](#cli--docker)\n    - [CLI — go install](#cli--go-install)\n    - [CLI — from source](#cli--from-source)\n    - [Web — Docker](#web--docker)\n    - [Web — from source](#web--from-source)\n  - [CLI](#cli-1)\n    - [Commands](#commands)\n    - [Interactive TUI](#interactive-tui)\n    - [Favorites](#favorites)\n    - [MCP server](#mcp-server)\n  - [Web](#web-1)\n  - [DiamondGPT](#diamondgpt)\n  - [Releases](#releases)\n  - [Notes \\\u0026 disclaimer](#notes--disclaimer)\n\n## Features\n\n- **Live scoreboard** — live \u0026 scheduled games with auto-refresh, date picker, linescores, probable pitchers.\n- **Standings** — division and wild-card standings by league and season.\n- **Teams** — every club with logos, league/division, roster, and season stats.\n- **Player profiles** — bio, headshot, career totals, year-by-year tables, AVG/ERA trend charts, splits, and game logs.\n- **Game detail** — live linescore, batter/pitcher boxscores, and auto-refreshing play-by-play.\n- **Stat leaders** — hitting \u0026 pitching leaders for any season with a category switcher.\n- **More in the TUI** — streaks, player/team comparisons, postseason, awards, transactions, history, draft, venues, and a stats glossary.\n- **API Explorer** (web) — call every MLB Stats API endpoint with a dynamic UI and raw JSON viewer.\n- **DiamondGPT** — chat with an AI that calls 18 live MLB data tools (Gemini, Claude, or OpenAI).\n\n## Screenshots\n\n### Web\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/web-home.png\" alt=\"Today dashboard\"\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/web-standings.png\" alt=\"Standings with division tables\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eToday dashboard\u003c/em\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eStandings\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/web-leaders.png\" alt=\"Stat leaders\"\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/web-explorer.png\" alt=\"API Explorer\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eStat leaders\u003c/em\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eAPI Explorer\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003cimg src=\"docs/screenshots/web-diamondgpt.png\" alt=\"DiamondGPT — AI chat answering with live MLB data\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\" align=\"center\"\u003e\u003cem\u003eDiamondGPT — ask in plain English, answered with live data\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### CLI\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/cli-home.png\" alt=\"Interactive TUI menu\"\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/cli-scores.png\" alt=\"Scoreboard\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eInteractive menu\u003c/em\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eScoreboard (\u003ccode\u003ediamond scores\u003c/code\u003e)\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/cli-standings.png\" alt=\"Division standings\"\u003e\u003c/td\u003e\n    \u003ctd width=\"50%\"\u003e\u003cimg src=\"docs/screenshots/cli-leaders.png\" alt=\"Stat leaders bar chart\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eStandings (\u003ccode\u003ediamond standings\u003c/code\u003e)\u003c/em\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cem\u003eLeaders (\u003ccode\u003ediamond leaders\u003c/code\u003e)\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\"\u003e\u003cimg src=\"docs/screenshots/cli-diamondgpt.png\" alt=\"DiamondGPT in the terminal answering with live MLB data\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"2\" align=\"center\"\u003e\u003cem\u003eDiamondGPT ✨ in the terminal — live data, in your shell\u003c/em\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Installation\n\n### CLI — Homebrew\n\n```bash\nbrew install xavidop/tap/diamond\ndiamond\n```\n\n### CLI — Docker\n\n```bash\ndocker run --rm -it ghcr.io/xavidop/diamond:latest\n# or a specific subcommand:\ndocker run --rm -it ghcr.io/xavidop/diamond:latest scores\n```\n\n### CLI — go install\n\n```bash\ngo install github.com/xavidop/diamond/cli@latest\n```\n\n### CLI — from source\n\n```bash\ncd cli\ngo build -o diamond .\n./diamond\n```\n\n### Web — Docker\n\n```bash\ndocker run --rm -p 8080:8080 \\\n  -e ANTHROPIC_API_KEY=sk-... \\\n  ghcr.io/xavidop/diamond-web:latest\n# open http://localhost:8080\n```\n\nThe web image bundles the built frontend and the Genkit/Express server. A\nDiamondGPT API key is optional — you can also paste a provider key in the UI.\n\n### Web — from source\n\n```bash\ncd web\nnpm install\nnpm run dev         # frontend only        → http://localhost:5173\nnpm run dev:server  # DiamondGPT backend    → http://localhost:8080\n```\n\n## CLI\n\nThe Go CLI (`diamond`) renders everything as a rich Bubble Tea TUI. Running it\nwith no arguments opens the interactive menu; the subcommands jump straight to a\nspecific view.\n\n### Commands\n\n| Command | Description | Flags / args |\n| --- | --- | --- |\n| `diamond` | Interactive TUI menu | — |\n| `diamond scores` | Today's scoreboard | `--date YYYY-MM-DD` |\n| `diamond game \u003cgamePk\u003e` | Live game detail | `\u003cgamePk\u003e` (required) |\n| `diamond standings` | Division standings | `--season YYYY` |\n| `diamond leaders` | Stat leaders | `--group hitting\\|pitching` |\n| `diamond team [name]` | Team roster and stats | `[name]` (optional search) |\n| `diamond player [name]` | Player profile and stats | `[name]` (optional search) |\n| `diamond mcp` | Run an MCP server exposing the MLB tools | `--name`, `--server-version` |\n| `diamond --version` | Print version, commit, and build date | — |\n\n### Interactive TUI\n\nRun `diamond` with no arguments to launch the menu. The sidebar (with a live-game\ncount that refreshes every 30s) gives you: Home, Scores, Standings, Leaders,\nStreaks, Compare, Team Compare, Teams, Players, Postseason, Awards, Transactions,\nHistory, Draft, Venues, Favorites, Glossary, and **DiamondGPT ✨**. Navigate with\nthe arrow keys, `Enter` to drill in, and `r` to refresh.\n\n### Favorites\n\nFavorite teams and players are persisted to\n`$XDG_CONFIG_HOME/diamond/favorites.json` (defaults to\n`~/.config/diamond/favorites.json`) and managed from the **Favorites** view.\n\n### MCP server\n\n`diamond mcp` runs a [Model Context Protocol](https://modelcontextprotocol.io)\nstdio server exposing all 18 MLB data tools to any MCP-capable client.\n\n```bash\ndiamond mcp --name diamond-mlb --server-version 1.0.0\n```\n\n## Web\n\nThe web app is built with **Vite + React + TypeScript + Tailwind + TanStack Query\n+ Recharts**, with a **Genkit (Node) + Express** backend that powers DiamondGPT.\nHighlights:\n\n- **Scoreboard** with auto-refresh, date picker, linescores, and probable pitchers.\n- **Standings**, **Teams** (with roster + season stats), and **Player profiles**\n  (career totals, year-by-year tables, AVG/ERA trend charts).\n- **Game detail** with live linescore, boxscores, and auto-refreshing play-by-play.\n- **Stat Leaders** with a category switcher.\n- **API Explorer** — a dynamic UI to call every MLB Stats API endpoint, with\n  path/query params, a raw JSON viewer, copy button, and open-in-tab link.\n- **Player search** in the header.\n\nSee [`web/README.md`](web/README.md) for more.\n\n## DiamondGPT\n\nDiamondGPT is an MLB-aware AI assistant (built with [Genkit](https://genkit.dev))\nthat answers baseball questions by calling 18 live MLB data tools — schedules,\nstandings, leaders, player/team stats, splits, game logs, awards, postseason,\ndraft, venues, win probability, and more.\n\nIt runs in both front ends (the **DiamondGPT ✨** view in the CLI, and in the web\napp). Pick any one provider by setting its API key:\n\n| Provider | Env var | Default model |\n| --- | --- | --- |\n| Google Gemini | `GEMINI_API_KEY` | `googleai/gemini-flash-latest` |\n| Anthropic Claude | `ANTHROPIC_API_KEY` | `anthropic/claude-sonnet-4-6` |\n| OpenAI | `OPENAI_API_KEY` | `openai/gpt-4.1-mini` |\n\nIn the web UI you can also paste a key directly. In the CLI chat, use `/model`,\n`/provider`, or `/switch` to change providers mid-conversation.\n\n## Website\n\nThe landing page lives in [`site/`](site/) — an [Astro](https://astro.build) site\ndeployed to **[diamond.xavidop.me](https://diamond.xavidop.me)** via GitHub Pages\n([`.github/workflows/deploy-site.yml`](.github/workflows/deploy-site.yml)). It pulls\nits screenshots from [`docs/screenshots/`](docs/screenshots/) at build time.\n\n```bash\ncd site\nnpm install\nnpm run dev      # http://localhost:4321\nnpm run build    # static output in site/dist\n```\n\n\u003e First-time setup: in the repo **Settings → Pages**, set the build source to\n\u003e **GitHub Actions**, and point the `diamond.xavidop.me` DNS record at GitHub Pages.\n\n## Releases\n\nReleases are automated with **conventional commits → semantic-release → GoReleaser**:\n\n- Merging a `feat:`/`fix:` commit to `main` cuts a new version (`vX.Y.Z`),\n  updates `CHANGELOG.md`, and tags the release.\n- GoReleaser then builds the CLI for linux/darwin/windows × amd64/arm64,\n  publishes the Homebrew cask to [`xavidop/homebrew-tap`](https://github.com/xavidop/homebrew-tap),\n  and pushes Docker images:\n  - CLI → `ghcr.io/xavidop/diamond`\n  - Web → `ghcr.io/xavidop/diamond-web`\n\nSee [docs/superpowers/specs/2026-06-23-release-pipeline-design.md](docs/superpowers/specs/2026-06-23-release-pipeline-design.md)\nfor the pipeline design.\n\n## Notes \u0026 disclaimer\n\nThe MLB Stats API is **public** and CORS-friendly — no API key is required for\nstats. This project is not affiliated with MLB. All data © MLB Advanced Media.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavidop%2Fdiamond","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxavidop%2Fdiamond","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavidop%2Fdiamond/lists"}