KosmoKrator

productivity

Railway CLI for AI Agents

Use the Railway CLI from KosmoKrator to call Railway tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

Railway CLI Setup

Railway can be configured headlessly with `kosmokrator integrations:configure railway`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure railway --set access_token="$RAILWAY_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor railway --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token RAILWAY_ACCESS_TOKEN Secret secret yes Access Token
url RAILWAY_URL URL url no GraphQL API URL

Call Railway Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call railway.railway_list_projects '{}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:railway railway_list_projects '{}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs railway --json
kosmo integrations:docs railway.railway_list_projects --json
kosmo integrations:schema railway.railway_list_projects --json
kosmo integrations:search "Railway" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Railway.

railway.railway_list_projects

Read read

List all Railway projects the authenticated user has access to. Returns project IDs, names, descriptions, and team info.

Parameters
none

Generic CLI call

kosmo integrations:call railway.railway_list_projects '{}' --json

Provider shortcut

kosmo integrations:railway railway_list_projects '{}' --json

railway.railway_get_project

Read read

Get detailed information about a specific Railway project, including its environments and plugins.

Parameters
project_id

Generic CLI call

kosmo integrations:call railway.railway_get_project '{"project_id":"example_project_id"}' --json

Provider shortcut

kosmo integrations:railway railway_get_project '{"project_id":"example_project_id"}' --json

railway.railway_create_project

Write write

Create a new Railway project with a name and optional description.

Parameters
name, description

Generic CLI call

kosmo integrations:call railway.railway_create_project '{"name":"example_name","description":"example_description"}' --json

Provider shortcut

kosmo integrations:railway railway_create_project '{"name":"example_name","description":"example_description"}' --json

railway.railway_list_services

Read read

List all services in a Railway project. Returns service IDs, names, and repository info.

Parameters
project_id

Generic CLI call

kosmo integrations:call railway.railway_list_services '{"project_id":"example_project_id"}' --json

Provider shortcut

kosmo integrations:railway railway_list_services '{"project_id":"example_project_id"}' --json

railway.railway_get_service

Read read

Get detailed information about a specific Railway service, including its source configuration and repository details.

Parameters
service_id

Generic CLI call

kosmo integrations:call railway.railway_get_service '{"service_id":"example_service_id"}' --json

Provider shortcut

kosmo integrations:railway railway_get_service '{"service_id":"example_service_id"}' --json

railway.railway_list_deployments

Read read

List deployments for a Railway service. Returns deployment status, environment, and creator info.

Parameters
service_id, environment_id, limit

Generic CLI call

kosmo integrations:call railway.railway_list_deployments '{"service_id":"example_service_id","environment_id":"example_environment_id","limit":1}' --json

Provider shortcut

kosmo integrations:railway railway_list_deployments '{"service_id":"example_service_id","environment_id":"example_environment_id","limit":1}' --json

railway.railway_get_current_user

Read read

Get information about the currently authenticated Railway user. Useful for verifying API credentials.

Parameters
none

Generic CLI call

kosmo integrations:call railway.railway_get_current_user '{}' --json

Provider shortcut

kosmo integrations:railway railway_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

railway.railway_list_projects

List all Railway projects the authenticated user has access to. Returns project IDs, names, descriptions, and team info.

Operation
Read read
Schema command
kosmo integrations:schema railway.railway_list_projects --json
ParameterTypeRequiredDescription
No parameters.

railway.railway_get_project

Get detailed information about a specific Railway project, including its environments and plugins.

Operation
Read read
Schema command
kosmo integrations:schema railway.railway_get_project --json
ParameterTypeRequiredDescription
project_id string yes The Railway project ID.

railway.railway_create_project

Create a new Railway project with a name and optional description.

Operation
Write write
Schema command
kosmo integrations:schema railway.railway_create_project --json
ParameterTypeRequiredDescription
name string yes The name for the new Railway project.
description string no An optional description for the project.

railway.railway_list_services

List all services in a Railway project. Returns service IDs, names, and repository info.

Operation
Read read
Schema command
kosmo integrations:schema railway.railway_list_services --json
ParameterTypeRequiredDescription
project_id string yes The Railway project ID.

railway.railway_get_service

Get detailed information about a specific Railway service, including its source configuration and repository details.

Operation
Read read
Schema command
kosmo integrations:schema railway.railway_get_service --json
ParameterTypeRequiredDescription
service_id string yes The Railway service ID.

railway.railway_list_deployments

List deployments for a Railway service. Returns deployment status, environment, and creator info.

Operation
Read read
Schema command
kosmo integrations:schema railway.railway_list_deployments --json
ParameterTypeRequiredDescription
service_id string yes The Railway service ID.
environment_id string no Optional environment ID to filter deployments.
limit integer no Maximum number of deployments to return (default: 20).

railway.railway_get_current_user

Get information about the currently authenticated Railway user. Useful for verifying API credentials.

Operation
Read read
Schema command
kosmo integrations:schema railway.railway_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.