npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

trimet-cli

v0.1.0

Published

Unofficial CLI for TriMet Portland transit data

Readme

trimet-cli

⚠️ Unofficial CLI for TriMet
Not affiliated with or endorsed by TriMet.

A command-line interface for TriMet Portland transit data. Check arrivals, plan trips, and view service alerts.

Installation

npm install -g trimet-cli

Or run directly with npx:

npx trimet-cli --help

Setup

Get a free API key from the TriMet Developer Portal, then set it:

export TRIMET_APP_ID="your-api-key"

Add this to your shell profile (~/.zshrc, ~/.bashrc, etc.) to persist it.

Commands

Arrivals

Get real-time arrivals at a stop:

trimet arrivals 8383                    # Arrivals at stop 8383
trimet arrivals 8383 --line 90          # Only MAX Red Line
trimet arrivals 8383 --json             # Output as JSON

Trip Planning

Plan a trip between two locations:

trimet trip -f 8383 -t 9969                          # Basic trip
trimet trip -f 8383 -t 9969 --arrive-by "5:30 PM"    # Arrive by time
trimet trip -f 8383 -t 9969 --depart-at "2:00 PM"    # Depart at time
trimet trip -f 8383 -t 9969 --json                   # Output as JSON

You can also use addresses:

trimet trip -f "Pioneer Square, Portland" -t "PDX Airport"

Next Departures

Simplified view of next departures:

trimet next -f 8383 -t 9969             # Next 3 options
trimet next -f 8383 -t 9969 -c 5        # Next 5 options
trimet next -f 8383 -t 9969 --line 90   # Only MAX Red Line

Service Alerts

Get current service alerts:

trimet alerts                # All alerts
trimet alerts --route 90     # Alerts for route 90
trimet alerts --json         # Output as JSON

Options

Global flags available on all commands:

| Flag | Description | |------|-------------| | -h, --help | Show help | | -V, --version | Show version number | | --no-color | Disable colored output | | --json | Output as JSON (where applicable) |

Environment Variables

| Variable | Description | |----------|-------------| | TRIMET_APP_ID | Required. Your TriMet API key | | NO_COLOR | Disable colored output (any value) |

Exit Codes

| Code | Meaning | |------|---------| | 0 | Success | | 1 | Generic failure | | 2 | Invalid usage (bad arguments) | | 3 | Authentication failure (missing API key) |

Finding Stop IDs

Stop IDs are displayed at TriMet stops, or you can find them:

Common Portland stops:

  • Pioneer Courthouse Square: 8383 (westbound), 8384 (eastbound)
  • PDX Airport: 10579
  • Portland Union Station: 7787

Examples

Check arrivals at a stop

$ trimet arrivals 8383

Upcoming Arrivals:

90     Beaverton TC                        3 min
190    Blue to Hillsboro                   8 min
90     Beaverton TC                       18 min ⚠️  DELAYED

Plan a trip

$ trimet trip -f 8383 -t 9969

Found 3 trip option(s):

Option 1: 5:15 PM → 5:45 PM (30 min)
  🚶 Walk from Pioneer Square to MAX Station
  5:18 PM - Blue Line to Beaverton TC

Option 2: 5:25 PM → 5:55 PM (30 min)
  5:25 PM - Red Line to Beaverton TC

Option 3: 5:35 PM → 6:05 PM (30 min)
  5:35 PM - Blue Line to Beaverton TC

Quick view of next departures

$ trimet next -f 8383 -t 9969 -c 3

Next Departures:

5:15 PM → 5:45 PM (30 min) - Blue Line
5:25 PM → 5:55 PM (30 min) - Red Line
5:35 PM → 6:05 PM (30 min) - Blue Line

Check service alerts

$ trimet alerts --route 90

2 Active Alert(s):

[12345] MAX Red Line Delay
Routes: 90
Expect 10-15 minute delays due to signal issues near Gateway.

[12346] Weekend Service Changes
Routes: 90, 190
Reduced frequency on weekends through January.

Script: Get arrivals as JSON

trimet arrivals 8383 --json | jq '.[] | select(.minutes < 10)'

API Client

This package also exports a TypeScript client for programmatic use:

import { TriMetAPI } from 'trimet-cli';

const api = new TriMetAPI(process.env.TRIMET_APP_ID);

const arrivals = await api.getArrivals('8383');
const trip = await api.planTrip('8383', '9969');
const alerts = await api.getAlerts();

Development

git clone https://github.com/mjrussell/trimet-cli
cd trimet-cli
npm install
npm run build
TRIMET_APP_ID="your-key" node dist/cli.js arrivals 8383

License

MIT © Matt Russell

Disclaimer

This is an unofficial tool created by the community. TriMet is a trademark of the Tri-County Metropolitan Transportation District of Oregon. This project is not affiliated with, endorsed by, or connected to TriMet in any way.