trein for Openclaw

A specialized CLI tool for querying real-time Dutch Railways (NS) train schedules, trip planning, and network disruptions.

timvandervoord
v1.0.0
Feb 4, 2026
1
2.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install trein-plus

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install trein-plus using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is trein?

trein is a robust command-line interface designed to interface directly with the Dutch Railways (NS) API. It provides real-time access to train-specific travel data across the Netherlands, allowing developers and AI agents to fetch live departures, plan complex journeys, and stay updated on track maintenance. As part of the ecosystem of Openclaw Skills, this tool streamlines transit data retrieval for users who need reliable rail information without navigating a web interface.

The skill is strictly focused on rail transport, ensuring high-quality data for intercity, sprinter, and international train services operating within the Dutch rail network. By integrating this into your workflow, you gain the ability to automate travel logistics and monitor platform changes in real-time.

trein Use Cases

  • Planning train journeys between Dutch stations with specific arrival or departure times.
  • Checking real-time train departures and platform assignments for a specific station.
  • Monitoring the rail network for active maintenance, delays, or unplanned disruptions.
  • Resolving ambiguous station names using fuzzy search to find correct station codes.
  • Creating custom aliases for frequently used routes like home to work commutes.

How trein Works

  1. The user or agent initiates a command such as trip, departures, or disruptions via the CLI.
  2. The tool authenticates with the Dutch Railways (NS) API using a pre-configured API key.
  3. Station names are resolved using fuzzy matching to ensure the correct transit hubs are targeted.
  4. The tool fetches the requested real-time data, including live delays and platform changes.
  5. Results are returned in a structured format, often as JSON, to be interpreted by the user or integrated into wider Openclaw Skills workflows.

trein Setup

Install the tool globally using npm:

npm i -g trein

To use the skill, you must obtain an API key from the NS API Portal. Once obtained, set it as an environment variable:

export NS_API_KEY="your-api-key"

Alternatively, you can save your credentials in a configuration file at ~/.config/trein/trein.config.json:

{ "apiKey": "your-api-key" }

trein Data Schema & Taxonomy

The trein skill provides structured data to ensure compatibility with other Openclaw Skills and automated agents.

Feature Data Type Description
Departures JSON Array Includes departure time, delay, destination, platform, and train type.
Trip Planning JSON Object Contains trip legs, total duration, transfer count, and real-time status.
Disruptions JSON Array Details maintenance or alerts, affected routes, and expected resolution times.
Stations JSON Array Lists matching station names and their unique identification codes.

trein Advanced Features

  • Direct JSON output support via the --json flag for seamless automation.
  • Advanced time-based planning using --arrive-by or --depart-at constraints.
  • Intermediate route control using the --via parameter to specify transfer stations.
  • Future travel planning with the --date flag supporting YYYY-MM-DD formatting.
  • Localized alias system to store and recall favorite stations quickly.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*