trein for Openclaw

A comprehensive CLI tool and skill for interacting with the Dutch Railways (NS) API to plan trips and monitor train status.

joehoel
v1.0.0
Jan 26, 2026
1
2.3k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install trein

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 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?

The trein skill brings the power of the Dutch Railways (NS) API directly to your command line and AI agents. It allows for seamless querying of real-time train departures, trip planning between stations, and monitoring of service disruptions across the Netherlands. By integrating this into your collection of Openclaw Skills, you enable automated travel planning and status updates through a developer-friendly interface.

This skill focuses on speed and flexibility, offering both human-readable terminal output and structured data formats. Whether you are building a personal dashboard or an automated travel assistant, trein provides the reliable connectivity needed to navigate the Dutch rail network efficiently.

trein Use Cases

  • Checking real-time departures from specific Dutch train stations.
  • Planning complex trips between two locations in the Netherlands with specific routing.
  • Monitoring active railway disruptions to adjust travel schedules automatically.
  • Quickly finding station names and codes using fuzzy search logic.
  • Setting up location aliases like home or work for rapid, recurring queries.

How trein Works

  1. The user or agent provides a command, station name, or route to the trein skill.
  2. The skill authenticates with the official NS API using a securely stored API key.
  3. The tool processes the query, utilizing fuzzy matching to resolve station names into valid NS identifiers.
  4. Real-time data is fetched regarding departures, trip legs, or service alerts.
  5. The output is parsed and returned in either a formatted table for humans or a structured JSON object for agent consumption.

trein Setup

To get started with this skill, first install the package via npm:

npm i -g trein

Next, you must obtain an API key from the NS API Portal (https://apiportal.ns.nl/). Once obtained, set it as an environment variable to allow Openclaw Skills to authenticate:

export NS_API_KEY="your-api-key"

Alternatively, you can create a local configuration file at ~/.config/trein/trein.config.json containing your key:

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

trein Data Schema & Taxonomy

The skill manages configuration locally and provides structured outputs for automation.

Data Type Format Description
Configuration JSON Stores the NS API key and user-defined station aliases.
API Response JSON Structured data containing departure times, platforms, and delay info when using the --json flag.
Station Mapping Fuzzy Text Maps partial strings (e.g., "adam") to official station names like Amsterdam Centraal.

trein Advanced Features

  • Fuzzy matching for station names to handle typos or shorthand abbreviations effectively.
  • Full JSON output support for every command, making it compatible with other Openclaw Skills and automated workflows.
  • Alias management system to define and save frequently used stations for faster access.
  • Real-time disruption monitoring to provide immediate feedback on rail network health.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*