u/Delicious_Syrup_6766

If you use mac, you can get subway data on your terminal
▲ 89 r/nycrail+1 crossposts

If you use mac, you can get subway data on your terminal

Lived in NYC for years before moving away. Never got over the specific brand of platform rage, close laptop, walk over, tap in, doors close in your face, next one's in 14 minutes, Always 14.

So I built a tiny tool for Mac users who already live in the terminal. You type in the station, and it shows the next trains in both directions, for every line, color-coded by how panicked you should be. Can also plan an end-to-end route with transfers like the MTA Trip Planner, but on the terminal.

How to Install:

brew tap itsashishupadhyay/mta
brew install mta

Some Commands to try:

mta -s "Times Sq"         # next trains at every line, both directions
mta -s "bedfrod avr"      # fuzzy match, misspell, similar stations
mta -s "bay prkwy"        # 3 stations called Bay Pkwy. picker tells you which is which
mta -s "Penn Station" -d "DeKalb Av"           # end-to-end route plan with         transfers
mta -s "Times Sq" -d "Bedford Av" -v           # same but verbose. per-stop diagram, the prettiest output
mta -s "Bay Ridge-95" -d "Forest Hills" -t 10  # only show trains leaving 10+ min from now
mta -s "14 St-Union Sq" -l L                   # filter to one line. less scrolling
mta --help                                     # everything else

Repo + screenshots: https://github.com/itsashishupadhyay/NYC_MTA_Timetable

Please try it on your home/work/regular station, and please reply with what's wrong, missing, or weird.

A NYC subway arrivals board for the terminal because reaching for my phone felt little too much (C++, single binary, no API key)

MTA subway rail Demo

Hi r/commandline 👋 long-time lurker, first-time poster :)

Quick story: I once lived in NYC, I work in Terminal, and the workflow of "leave desk → walk to station → realize I don't know when the next train is → unlock phone → wait for MTA app → squint → miss train" got old around year two. So I wrote a thing.

So I wrote mta, a single C++ binary that hits the MTA's GTFS-realtime feeds and prints next-train times the way the actual station signs render them: official line bullets, color-coded ETAs (bold red = now, green = catchable, yellow = soon, dim = far), grouped by direction so a busy hub like Times Square fits on one screen.

How to Install:

brew tap itsashishupadhyay/mta
brew install mta
mta -s "Times Sq"

Some Commands to try:

mta -s "Times Sq"         # next trains at every line, both directions
mta -s "bedfrod avr"      # fuzzy match, misspell, similar stations
mta -s "bay prkwy"        # 3 stations called Bay Pkwy. picker tells you which is which
mta -s "Penn Station" -d "DeKalb Av"           # end-to-end route plan with         transfers
mta -s "Times Sq" -d "Bedford Av" -v           # same but verbose. per-stop diagram, the prettiest output
mta -s "Bay Ridge-95" -d "Forest Hills" -t 10  # only show trains leaving 10+ min from now
mta -s "14 St-Union Sq" -l L                   # filter to one line. less scrolling
mta --help                                     # everything else

A few things I'm weirdly proud of:

- No API key MTA dropped the auth requirement in 2020, and apparently nobody told anyone.

- No daemon, no TUI loop It prints and exits, so it composes with tmux panes, shell pipes, Hammerspoon menubar scripts, whatever.

- Connected-complex resolution Searching `Times Sq` automatically pulls in the A/C/E platforms over at 42 St-Port Authority and labels them so you know where to walk.

- Routing too mta -s "Times Sq" -d "Bedford Av" runs Dijkstra over the live transfer graph and gives you 5 ranked options.

It's MIT, written in C++17, builds in ~30 seconds from source (on my Mac M3) if you don't want to brew it, or cross compile

Repo + screenshots: https://github.com/itsashishupadhyay/NYC_MTA_Timetable

Would genuinely love feedback, especially on the rendering at narrow terminal widths, and from anyone who knows GTFS-realtime well enough to tell me what I got wrong. Critique welcome; this is my first real OSS release, and I'd rather hear it now.

If you're in NYC: Please try it on your home/work/regular station, and please reply with what's wrong, missing, or weird.

Station data for Times Square

reddit.com
u/Delicious_Syrup_6766 — 2 days ago
▲ 24 r/cpp

A NYC subway arrivals board for the terminal because reaching for my phone felt little too much (C++, single binary, no API key)

Hi r/cpp 👋 long-time lurker, first-time poster :)

Quick story: I once lived in NYC, I work in Terminal, and the workflow of "leave desk → walk to station → realize I don't know when the next train is → unlock phone → wait for MTA app → squint → miss train" got old around year two. So I wrote a thing.

So I wrote mta, a single C++ binary that hits the MTA's GTFS-realtime feeds and prints next-train times the way the actual station signs render them: official line bullets, color-coded ETAs (bold red = now, green = catchable, yellow = soon, dim = far), grouped by direction so a busy hub like Times Square fits on one screen.

How to Install:

brew tap itsashishupadhyay/mta
brew install mta

Some Commands to try:

mta -s "Times Sq"         # next trains at every line, both directions
mta -s "bedfrod avr"      # fuzzy match, misspell, similar stations
mta -s "bay prkwy"        # 3 stations called Bay Pkwy. picker tells you which is which
mta -s "Penn Station" -d "DeKalb Av"           # end-to-end route plan with         transfers
mta -s "Times Sq" -d "Bedford Av" -v           # same but verbose. per-stop diagram, the prettiest output
mta -s "Bay Ridge-95" -d "Forest Hills" -t 10  # only show trains leaving 10+ min from now
mta -s "14 St-Union Sq" -l L                   # filter to one line. less scrolling
mta --help                                     # everything else

A few things I'm weirdly proud of:

- No API key MTA dropped the auth requirement in 2020, and apparently nobody told anyone.

- No daemon, no TUI loop It prints and exits, so it composes with tmux panes, shell pipes, Hammerspoon menubar scripts, whatever.

- Connected-complex resolution Searching `Times Sq` automatically pulls in the A/C/E platforms over at 42 St-Port Authority and labels them so you know where to walk.

- Routing too `mta -s "Times Sq" -d "Bedford Av"` runs Dijkstra over the live transfer graph and gives you 5 ranked options.

It's MIT, written in C++17, builds in ~30 seconds from source (on my Mac M3) if you don't want to `brew` it, or cross compile

Repo + screenshots: https://github.com/itsashishupadhyay/NYC_MTA_Timetable

I would appreciate feedback, especially on the rendering at narrow terminal widths, and from anyone who knows GTFS-realtime well enough to tell me what I got wrong. Critique welcome; this is my first real OSS release, and I'd rather hear it now.

If you're in NYC: Please try it on your home/work/regular station, and please reply with what's wrong, missing, or weird.

u/Delicious_Syrup_6766 — 3 days ago