在你的终端里观看MLB比赛。
Playball – Watch MLB games from a terminal

原始链接: https://github.com/paaatrick/playball

## Playball: MLB 在你的终端 **Playball** 让你在终端内直接跟踪 MLB 比赛。它提供了一种不显眼的方式来替代 MLB Gameday 或 MLB.tv,提供实时比分和比赛事件的文本视图。 **安装:** 需要 Node.js 和 Docker。使用 `npm install -g playball` 全局安装,并使用 `docker build -t playball . && docker run -it --rm --name playball playball:latest` 运行。 **导航:** 使用箭头键浏览赛程和排名,使用 'Enter' 查看特定比赛。在比赛中,使用箭头键滚动浏览比赛进程。主要命令包括 'q' 退出,'p' 查看前一天,'n' 查看后一天。 **自定义:** Playball 可高度配置!使用 `playball config` 调整颜色(球、好球、出局等)并突出显示你喜欢的球队。你可以查看当前设置,获取单个设置的值,更改设置,或使用 `--unset` 标志恢复默认设置。 该项目是开源的,欢迎贡献 – 在 GitHub 上找到它:[https://github.com/paaatrick/playball](https://github.com/paaatrick/playball)。

一个新项目允许用户使用基于React的文本用户界面(TUI)**直接从终端观看MLB比赛**。该项目利用MLB令人惊讶的易于访问的API来提供实时比赛更新。 Hacker News上的公告引起了轰动,评论者赞扬了其巧妙的设计,并提出了潜在的集成方案,例如与Plex集成。一些人开玩笑地讨论了使用AI根据更新生成视频的可能性,而另一些人则警告不要公开分享可能导致MLB关闭API的想法。 该项目可在GitHub上找到(github.com/paaatrick),并引发了关于创新与保护有价值API访问之间平衡的讨论。最后,帖子还提醒YC冬季2026批次的申请现已开放。
相关文章

原文

Watch MLB games from the comfort of your own terminal

screenshot

MLB Gameday and MLB.tv are great, but sometimes you want to keep an eye on a game a bit more discreetly. playball puts the game in a terminal window.

Just want to try it out?

Ready for the big leagues? Install the package globally

$ npm install -g playball

Then run it

$ docker build -t playball .
$ docker run -it --rm --name playball playball:latest
key action
q quit
c go to schedule view
s go to standings view
key action
/j, /k, /h, /l change highlighted game
enter view highlighted game
p show previous day's schedule/results
n show next day's schedule
t return to today's schedule
key action
/j, /k scroll list of all plays

Playball can be configured using the config subcommand. To list the current configuration values run the subcommand with no additional arguments:

You should see output similar to:

color.ball = green
color.favorite-star = yellow
color.in-play-no-out = blue
color.in-play-out = white
color.in-play-runs-bg = white
color.in-play-runs-fg = black
color.on-base = yellow
color.other-event = white
color.out = red
color.strike = red
color.strike-out = red
color.walk = green
favorites = 

To get the value of a single setting pass the key as an additional argument:

playball config color.strike

To change a setting pass the key and value as arguments:

playball config color.strike blue

To revert a setting to its default value provide the key and the --unset flag:

playball config color.strike --unset

This table summarizes the available settings:

key description default allowed values
color.ball Color of dots representing balls in top row of game view green One of the following: black, red, green, yellow, blue, magenta, cyan, white, grey. Any of those colors may be prefixed by bright- or light- (for example bright-green). The exact color used will depend on your terminal settings. The value default may be used to specify the default text color for your terminal. Finally hex colors (e.g #FFA500) can be specified. If your terminal does not support true color, the closest supported color may be used.
color.favorite-star Color of star indiciating favorite team in schedule and standing views yellow See above
color.in-play-no-out Color of result where ball was put in play and no out was made (single, double, etc) in list of plays in game view blue See above
color.in-play-out Color of result where ball was put in play and an out was made (flyout, fielder's choice, etc) in list of plays in game view white See above
color.in-play-runs-bg Background color for score update in list of plays in game view white See above
color.in-play-runs-fg Foreground color for score update in list of plays in game view black See above
color.on-base Color of diamonds representing runners on base in top row of game view yellow See above
color.other-event Color of other events (mound visit, injury delay, etc) in list of plays in game view white See above
color.out Color of dots representing outs in top row of game view red See above
color.strike Color of dots representing strikes in top row of game view red See above
color.strike-out Color of result where play ends on a strike (strike out) in list of plays in game view red See above
color.walk Color of result where play ends on a ball (walk, hit by pitch) in list of plays in game view green See above
favorites Teams to highlight in schedule and standings views Any one of the following: ATL, AZ, BAL, BOS, CHC, CIN, CLE, COL, CWS, DET, HOU, KC, LAA, LAD, MIA, MIL, MIN, NYM, NYY, OAK, PHI, PIT, SD, SEA, SF, STL, TB, TEX, TOR, WSH. Or a comma-separated list of multiple (e.g. SEA,MIL)
git clone https://github.com/paaatrick/playball.git
cd playball
npm install
npm start

Contributions are welcome!

联系我们 contact @ memedata.com