RedTransporteAPI

v1.0.1

CLI tool for managing local GTFS data, querying stops, routes, real-time predictions, and planning public transit trips in Chile's Red de Transporte system.

0· 89·0 current·0 all-time
byiroaK@iiroak

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for iiroak/redtransportecl.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "RedTransporteAPI" (iiroak/redtransportecl) from ClawHub.
Skill page: https://clawhub.ai/iiroak/redtransportecl
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install redtransportecl

ClawHub CLI

Package manager switcher

npx clawhub@latest install redtransportecl
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the instructions: the SKILL.md documents running the `red-transporte` CLI to manage GTFS, query stops, predictions, routes and run an HTTP server. The metadata also declares the CLI binary requirement (red-transporte), which is appropriate for this purpose.
Instruction Scope
Instructions are focused on invoking the CLI and updating local GTFS. They include guidance to run `pip install "[.all]"` and `red-transporte gtfs update` (which will download GTFS from DTPM). This is expected, but the pip command is ambiguous (it implies running inside the package repository) and the skill allows starting a local HTTP server (exposes a local port). No instructions request unrelated files, env vars, or credentials.
Install Mechanism
Instruction-only skill with no install spec and no downloads configured. This is the lowest-risk install model. The SKILL.md suggests installing dependencies with pip but does not automatically download or execute external code as part of a formal install step.
Credentials
The skill does not declare or require any environment variables, credentials, or config paths. The runtime instructions do not ask for unrelated secrets or tokens.
Persistence & Privilege
Skill does not request always: true and has default autonomy settings. It does allow running a local HTTP server via the CLI, which is consistent with the stated purpose but may expose a local port when invoked.
Assessment
This skill appears to be what it claims: a wrapper around a local `red-transporte` CLI. Before installing or allowing the agent to use it, verify where you will get the `red-transporte` package/binary from and inspect it if possible (the SKILL.md does not provide a trusted install URL). Be aware: 1) `red-transporte gtfs update` will download GTFS data from an external source (DTPM) — ensure you trust that source; 2) `pip install "[.all]"` is ambiguous and normally expects to be run in a project repository — don't run pip commands from unknown locations; 3) the `server` command will open a local HTTP API (default localhost:8000) — only run it if you understand the network exposure; 4) although the skill requests no credentials, always confirm the CLI binary you install is from a trusted release to avoid supply-chain risks. If you need greater assurance, ask the publisher for an official homepage or a link to the project's source or release artifacts before proceeding.

Like a lobster shell, security has layers — review code before you run it.

latestvk977s20cpzy5re3b1cm1ma2rah84pskz
89downloads
0stars
2versions
Updated 2w ago
v1.0.1
MIT-0

name: redtransportecl
description: Usa la CLI red-transporte para consultar paraderos, recorridos, predicciones en tiempo real, GTFS local y utilidades geoespaciales de RED Chile.
metadata:
{
"openclaw":
{
"requires": { "bins": ["red-transporte"] }
}
}

RedTransporteAPI CLI — SKILL

Esta skill esta enfocada exclusivamente en el uso de la CLI red-transporte.

Requisitos

  • Python 3.9 o superior
  • Instalar dependencias del proyecto
  • Descargar GTFS local antes de consultas que usan datos estaticos
pip install ".[all]"
red-transporte gtfs update

Sintaxis general

red-transporte [--json] [--verbose|-v] <comando> [opciones]

Flags globales

  • --json: imprime salida JSON cruda.
  • --verbose o -v: activa logging en nivel debug.

Ejemplo:

red-transporte --json stop PA433
red-transporte -v predict PA433

Comandos CLI detallados

1) gtfs

Gestiona datos GTFS locales.

Subcomandos:

  • gtfs update [--force]
    • Descarga/actualiza el GTFS vigente desde DTPM.
    • --force: fuerza re-descarga aunque exista version local.
  • gtfs status
    • Muestra estado de los datos GTFS locales.

Ejemplos:

red-transporte gtfs update
red-transporte gtfs update --force
red-transporte --json gtfs status

2) stop

Obtiene informacion completa de un paradero.

Uso:

red-transporte stop <code>

Argumentos:

  • <code>: codigo del paradero (ejemplo: PA433).

Ejemplos:

red-transporte stop PA433
red-transporte --json stop PA433

3) search

Busca paraderos por texto.

Uso:

red-transporte search <query> [--limit N]

Argumentos y opciones:

  • <query>: texto de busqueda.
  • --limit: maximo de resultados (default: 10).

Ejemplos:

red-transporte search "providencia"
red-transporte search "macul" --limit 5

4) nearby

Lista paraderos cercanos a una coordenada.

Uso:

red-transporte nearby <lat> <lon> [--radius KM]

Argumentos y opciones:

  • <lat>: latitud (float).
  • <lon>: longitud (float).
  • --radius: radio en kilometros (default: 0.5).

Ejemplos:

red-transporte nearby -33.4372 -70.6506
red-transporte nearby -33.4372 -70.6506 --radius 1.0

5) station

Devuelve la estacion de metro/tren mas cercana.

Uso:

red-transporte station <lat> <lon>

Argumentos:

  • <lat>: latitud (float).
  • <lon>: longitud (float).

Ejemplo:

red-transporte station -33.45 -70.65

6) route

Muestra informacion de un recorrido.

Uso:

red-transporte route <route_id>

Argumentos:

  • <route_id>: ID o nombre corto del recorrido (ejemplo: 506, D12).

Ejemplos:

red-transporte route 506
red-transporte route D12

7) routes

Lista recorridos, opcionalmente filtrados por modo.

Uso:

red-transporte routes [--mode bus|metro|rail|tram]

Opciones:

  • --mode: filtra por modo de transporte.

Ejemplos:

red-transporte routes
red-transporte routes --mode metro
red-transporte routes --mode bus

8) predict

Consulta predicciones en tiempo real para un paradero.

Uso:

red-transporte predict <code>

Argumentos:

  • <code>: codigo del paradero.

Ejemplos:

red-transporte predict PA433
red-transporte --json predict PA433

9) stats

Entrega estadisticas globales del sistema.

Uso:

red-transporte stats

Ejemplo:

red-transporte --json stats

10) suggest

Sugiere recorridos entre dos puntos geograficos (basico, sin tiempos).

Uso:

red-transporte suggest <from_lat> <from_lon> <to_lat> <to_lon> [--radius KM]

Argumentos y opciones:

  • <from_lat>: latitud origen.
  • <from_lon>: longitud origen.
  • <to_lat>: latitud destino.
  • <to_lon>: longitud destino.
  • --radius: radio de busqueda en kilometros (default: 0.5).

Ejemplos:

red-transporte suggest -33.4372 -70.6506 -33.4189 -70.6024
red-transporte suggest -33.4372 -70.6506 -33.4189 -70.6024 --radius 0.8

11) server

Inicia el servidor HTTP de la API.

Uso:

red-transporte server

Salida esperada:

  • API disponible localmente (por defecto) en http://localhost:8000.
  • Documentacion Swagger en http://localhost:8000/docs.

Flujo recomendado de uso CLI

  1. Descargar GTFS: red-transporte gtfs update
  2. Verificar estado: red-transporte gtfs status
  3. Consultar paraderos/recorridos: stop, search, route, routes
  4. Consultar tiempo real: predict
  5. Consultas geoespaciales: nearby, station, suggest

Planificador de rutas RAPTOR (API)

El endpoint /routing/plan usa el algoritmo RAPTOR para calcular rutas optimas de transporte publico entre dos coordenadas. Este endpoint solo esta disponible via la API HTTP (no via CLI).

Endpoint

GET /routing/plan

Parametros

ParametroTipoDefaultDescripcion
from_latfloat(requerido)Latitud del origen
from_lonfloat(requerido)Longitud del origen
to_latfloat(requerido)Latitud del destino
to_lonfloat(requerido)Longitud del destino
departure_timestr08:00:00Hora de salida en formato HH:MM:SS
daystrLDia: L=laboral, S=sabado, D=domingo
max_resultsint3Maximo de alternativas (1-5)
max_transfersint2Maximo de transbordos (0-3)
fare_typestrnormalTipo tarifa: normal, estudiante, adulto_mayor

Ejemplo de uso

# Estacion Central a Puente Alto, laboral 09:00
curl "http://localhost:8000/routing/plan?from_lat=-33.4525&from_lon=-70.6783&to_lat=-33.586&to_lon=-70.576&departure_time=09:00:00&day=L"

# Plaza Italia a La Moneda, tarifa estudiante
curl "http://localhost:8000/routing/plan?from_lat=-33.4372&from_lon=-70.634&to_lat=-33.4422&to_lon=-70.6537&fare_type=estudiante"

# Sin transbordos (solo rutas directas)
curl "http://localhost:8000/routing/plan?from_lat=-33.4372&from_lon=-70.634&to_lat=-33.5195&to_lon=-70.598&max_transfers=0"

Respuesta

La respuesta contiene una lista de planes de viaje (plans), cada uno con:

  • total_time_secs / total_time_human: tiempo total del viaje
  • departure_time / arrival_time: hora de salida y llegada
  • walk_time_secs, ride_time_secs, wait_time_secs: desglose de tiempos
  • transfers: numero de transbordos
  • total_walk_m: metros caminados en total
  • fare: tarifa calculada con desglose
  • legs: lista de tramos del viaje (caminar, bus, metro, etc.)
  • summary: resumen legible del viaje

Cada leg tiene:

  • mode: walk, bus, metro, rail
  • route_name: nombre del recorrido (ej: L1, 506, 210)
  • board_stop_name / alight_stop_name: paradero de subida y bajada
  • num_stops: cantidad de paradas
  • duration_secs: duracion del tramo
  • wait_secs: tiempo de espera antes de abordar
  • walk_distance_m: distancia caminada (solo para legs de caminata)

RAPTOR: como funciona

RAPTOR (Round-Based Public Transit Optimized Router) busca rutas por rondas:

  • Ronda 1: mejor ruta directa (0 transbordos)
  • Ronda 2: mejor ruta con 1 transbordo
  • Ronda 3: mejor ruta con 2 transbordos

Solo devuelve una ronda si es estrictamente mas rapida que la anterior (Pareto-optimo). Ejemplo: si con 2 transbordos llegas en 1h09 pero sin transbordos en 1h20, ambas opciones se muestran.

El tiempo de espera se calcula como: headway/2 (promedio) + 30 segundos de penalizacion por abordaje. Los headways vienen de las frecuencias reales del GTFS por hora y dia.

Tarifa integrada RED

El calculo de tarifa sigue las reglas oficiales de red.cl.

Tarifas base adulto normal:

ModoPunta (07-09 / 18-20)Valle (09-18 / 20-20:44 / fds)Baja (06-07 / 20:45-23)
Bus$795$795$795
Metro/Tren$895$815$735

Reglas de transbordo:

  • Maximo 2 transbordos en ventana de 120 minutos
  • Tarifa integrada = maximo entre bus ($795) y metro (segun periodo)
  • Bus → Metro: pagas la diferencia hasta tarifa metro
  • Metro → Bus: bus incluido ($0 adicional)
  • Bus → Bus: segundo bus incluido ($0 adicional)
  • Solo el primer tramo paga completo; los demas estan incluidos

Tarifas especiales:

fare_typeTarifa
normalsegun tabla de arriba
estudiante$260 plana
adulto_mayor$390 plana

Desglose en respuesta: El campo fare.breakdown muestra por cada tramo de transporte:

  • mode: tipo de vehiculo
  • route: nombre del recorrido
  • fare_mode: tarifa teorica del modo
  • paid: monto pagado en ese tramo ($0 si es transbordo incluido)

Notas operativas CLI

  • Si no existe GTFS local, varios comandos fallaran hasta ejecutar red-transporte gtfs update.
  • predict consulta fuentes en tiempo real y puede variar entre llamadas.
  • Para integraciones de scripts, usar siempre --json.
  • El planificador RAPTOR solo esta disponible via la API HTTP (/routing/plan), no via CLI.

Comments

Loading comments...