mlbt
mlb.com in your terminal. Gameday, scores, stats, standings, teams, and player profiles. Powered by MLB's Stats API, check today's games or dig through decades of historical information. Go beyond the broadcast and nerd out with win probability, leverage index, exit velo, and more.
Table of Contents
Installation
Cargo
Install a pre-built binary using cargo-binstall:
Or build from source:
Homebrew
To update to the latest version:
Binaries
macOS, Linux, and Windows binaries are available on the releases page.
| Platform | Target |
|---|---|
| macOS (Apple Silicon) | aarch64-apple-darwin |
| macOS (Intel) | x86_64-apple-darwin |
| Linux (x86_64) | x86_64-unknown-linux-gnu |
| Linux (x86_64, static) | x86_64-unknown-linux-musl |
| Linux (ARM64) | aarch64-unknown-linux-gnu |
| Linux (ARM64, static) | aarch64-unknown-linux-musl |
| Linux (ARMv7) | armv7-unknown-linux-gnueabihf |
| Windows (x86_64) | x86_64-pc-windows-msvc |
.deb and .rpm packages are also available for Linux x86_64 and ARM64.
Docker
mlbt publishes docker images on ghcr.
mlbt follows semver practices.
You can execute individual releases explicitly.
Alternatively build the mlbt image with:
Execute mlbt within the container with:
Features
-
scoreboard and box score
- sorted by favorite team
- full box score
- probable pitchers for upcoming games
- win probability graph
- selectable date
-
gameday
- pitch display
- batter strike zone with heat map coloring
- selectable at bats (view the pitches and outcome of any at bat in the game)
- hit stats: exit velocity, launch angle, distance
- ABS challenge information for 2026+ games
- leverage index and win probability change per at bat
-
pitching and hitting stats
- player stats
- team stats
- sorting
- fuzzy search for players and teams
- selectable date
-
standings
- sorted by favorite team
- division/league view
- selectable date
-
team page
- roster (active and 40-man)
- schedule with calendar view
- recent transactions
-
player profile
- player bio
- career stats
- recent games
-
configuration
- favorite team
- time zone
Usage
After installing, run mlbt from your terminal to open the program.
Press q to exit at any time.
Tabs
There are four main tabs.
- Scoreboard
- Gameday
- Stats
- Standings
Press f for full screen mode to hide the tab bar.
Scoreboard
Press 1 to activate this tab.
| Key | Description |
|---|---|
j / ↓ |
move down |
k / ↑ |
move up |
Enter |
view current game in Gameday |
: |
activate date picker (see Date Picker) |
w |
toggle win probability graph |
h |
switch to home team in box score |
a |
switch to away team in box score |
Shift + j/ ↓ |
scroll box score down |
Shift + k/ ↑ |
scroll box score up |
Gameday
Press 2 to activate this tab.
By default, the info and pitches panes are shown. However, each pane can be
toggled on and off using:
| Key | Description |
|---|---|
i |
info pane |
p |
pitches pane |
b |
box score pane |
w |
toggle win probability graph |
To view different at bats in the game, use:
| Key | Description |
|---|---|
j / ↓ |
move to previous at bat |
k / ↑ |
move to next at bat |
l |
move to the "live" at bat, or latest available |
s |
move to first at bat of the game |
To interact with the box score, use:
| Key | Description |
|---|---|
h |
switch to home team in box score |
a |
switch to away team in box score |
Shift + j/ ↓ |
scroll box score down |
Shift + k/ ↑ |
scroll box score up |
Stats
Press 3 to activate this tab.
Inside the stats tab there are two panes: stats table and options. The stats table is used for selecting players/teams and searching. The options pane is used for sorting the stats and toggling columns on/off.
| Key | Description |
|---|---|
← / → / Tab |
switch between stats table and options pane |
j / ↓ |
move down in active pane |
k / ↑ |
move up in active pane |
Shift + j / ↓ |
page down in stats table |
Shift + k / ↑ |
page up in stats table |
: |
activate date picker (see Date Picker) |
You can switch between pitching and hitting stats and filter based on team
or player using:
| Key | Description |
|---|---|
p |
pitching |
h |
hitting |
t |
team |
l |
player |
Search
You can fuzzy search for a player or team in the stats table using:
| Key | Description |
|---|---|
Ctrl + f |
activate fuzzy search |
Enter |
finish fuzzy search |
Esc |
clear fuzzy search results |
While the stats table is active, press Enter to view a
player profile or a team page.
Stats Options
The stats options pane can be turned on/off with o.
Within each stat group (pitching or hitting) you can toggle the display of
individual stat columns by selecting the stat with Enter. To sort the stats by
a column, you can press s. To flip the sort order from ascending to descending
or vice versa press s again.
| Key | Description |
|---|---|
Enter |
toggle stat column |
s |
sort by the currently selected column |
o |
toggle options pane |
If your terminal is too small to display all columns, they will be turned off starting from the right side.
Standings
Press 4 to activate this tab.
| Key | Description |
|---|---|
j / ↓ |
move down |
k / ↑ |
move up |
Enter |
view team page |
: |
activate date picker (see Date Picker) |
l |
toggle division/league view |
Player Profile
The player profile shows a player's career stats and recent games. It can be
opened from Stats or from a team page roster by pressing
Enter.
| Key | Description |
|---|---|
s |
toggle stat category |
j / ↓ |
scroll down |
k / ↑ |
scroll up |
Shift + j / ↓ |
page down |
Shift + k / ↑ |
page up |
Esc |
close profile |
Team Page
The team page shows a team's roster, schedule, and recent transactions. It can
be opened from Standings or from Stats by pressing
Enter.
| Key | Description |
|---|---|
← / → / Tab |
switch section |
j / ↓ |
move down |
k / ↑ |
move up |
Shift + j / ↓ |
page down |
Shift + k / ↑ |
page up |
c |
toggle calendar |
r |
toggle roster type |
Enter |
view player profile from roster |
Esc |
close team page |
Date Picker
With the date picker active, input a date in the form of YYYY-MM-DD, or use
the left/right arrow keys, and press Enter.
| Key | Description |
|---|---|
← / → |
use arrow keys to navigate date |
Enter |
confirm the selected date |
Esc |
cancel selection |
today / t |
go back to the current day |
Note that each tab has its own date, i.e. if you're viewing older stats or standings, the schedule can be the current date.
Help
Press ? from any tab to open the help page.
| Key | Description |
|---|---|
j / ↓ |
move down |
k / ↑ |
move up |
Shift + j / ↓ |
page down |
Shift + k / ↑ |
page up |
Esc |
close help box |
" |
display logs |
Config
The TUI can be configured two ways:
- TUI editor (recommended): open the help page with
?, pressTabto focus the settings panel on the right, and usej/kto pick a field. PressEnterto open the picker and thenEnteragain to save the setting. - Manually editing the config file: edit the toml file directly. Useful for timezones outside the curated options in the TUI.
The config file is located at:
- Linux:
~/.config/mlbt/mlbt.toml - Windows:
~\AppData\Roaming\mlbt\mlbt.toml - macOS:
~/Library/Application Support/mlbt/mlbt.toml
The path is also shown at the bottom of the
Helppage.
Available settings
favorite_team: team to highlight in standings and surface first in the schedule. TUI: picker shows all 30 current teams. Manually: use the full name (e.g."Chicago Cubs"). See the full list.timezone: time zone for the start time of the games in the schedule. The default isUS/Pacific. In app picker covers common zones: Pacific, Arizona, Mountain, Central, Eastern, London, Central Europe, Tokyo, Seoul, Sydney, UTC. For anything else, edit the toml file with any value from the tz database.log_level: one ofoff,error,warn,info,debug,trace. Default iserror.
Example config
# See https://github.com/mlb-rs/mlbt#config for options
= "Chicago Cubs"
= "US/Pacific"
= "error"
Shout out
This was originally built with the wonderful tui-rs. It is now using the also wonderful fork, ratatui.
These TUIs were extremely helpful: spotify-tui, tickrs, bottom.
A reference MLB stats API client by toddrob99 helped make up for the lack of API documentation.
Copyright Notice
The data used in this application is supplied by the MLB's Stats API. Use of this data is subject to the license posted here: http://gdx.mlb.com/components/copyright.txt.
This application and its author are not affiliated with the MLB.
License
This project is under the MIT License.