TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25171 12
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
mta -s "Times Sq"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

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.




https://redd.it/1t9sq14
@r_cpp
GitHub GitHub - itsashishupadhyay/NYC_MTA_Timetable: Get station time table, and/or trip planning between source and destination Get station time table, and/or trip planning between source and destination - itsashishupadhyay/NYC_MTA_Timetable
More from @r_cpp
  1. Oct 3, 2026Arno Lepisk: Linux shared libraries https://youtu.be/IJASMkkGco8 https://redd.it/1wuvxmh @…
  2. Oct 3, 2026Lets explore the stack https://meetingcpp.com/blog/items/Lets-explore-the-stack.html https…
  3. Oct 3, 2026C++ Show and Tell - October 2026 Use this thread to share anything you've written in C++.…
  4. Oct 3, 2026C++ future at Adobe So if anyone was still curious what happened to Hylo, or where Adobe s…
  5. Oct 3, 2026C++ Jobs - Q4 2026 Rules For Individuals --------------------- * **Don't** create top-leve…
  6. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →