Nz trains

From thecolab-ai/.skills · View interactive version

Nz trains is an AI agent skill from the GitHub repository thecolab-ai/.skills. Query Wellington Metlink train lines through a lightweight read-only CLI using GTFS and GTFS-RT data. Use when the task involves Johnsonville, Kapiti, Hutt Valley, Melling, or Wairarapa Line stations, arrivals, delays, alerts, or live train positions. Requires METLINK_API_KEY.

How to use this skill

Skill file

NZ Trains

Goal

Query live Wellington train data from Metlink GTFS and GTFS-RT endpoints through a small deterministic CLI with human-readable and JSON output.

Use this when

Do not use this for

Preferred workflow

  1. Set METLINK_API_KEY in the environment before running data commands
  2. Run scripts/cli.py with the narrowest subcommand that answers the task
  3. Use lines for a quick network snapshot
  4. Use arrivals or station for stop-specific next trains
  5. Use delays, vehicles, and alerts for operational status
  6. Use --json for agent chaining, comparisons, or structured reports

Setup

Requires a Metlink Open Data API key.

export METLINK_API_KEY=your_key_here

The CLI reads os.environ["METLINK_API_KEY"]. There is no fallback key.

CLI

Run with:

python3 skills/nz-trains/scripts/cli.py <command> [flags]

Commands

Examples:

python3 skills/nz-trains/scripts/cli.py lines
python3 skills/nz-trains/scripts/cli.py line WRL --json
python3 skills/nz-trains/scripts/cli.py stations --line KPL
python3 skills/nz-trains/scripts/cli.py arrivals WELL --limit 8
python3 skills/nz-trains/scripts/cli.py station Masterton --json
python3 skills/nz-trains/scripts/cli.py delays --line Wairarapa
python3 skills/nz-trains/scripts/cli.py vehicles --line KPL --json
python3 skills/nz-trains/scripts/cli.py alerts --line HVL

Resources

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.