KosmoKrator

data

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.

Railway CLI Setup

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

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

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

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call railway.railway_list_projects '{}' --json
Provider shortcut
kosmo integrations:railway railway_list_projects '{}' --json

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

railway.railway_list_projects

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

Read read
Parameters
none
Generic call
kosmo integrations:call railway.railway_list_projects '{}' --json
Shortcut
kosmo integrations:railway railway_list_projects '{}' --json

railway.railway_get_project

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

Read read
Parameters
project_id
Generic call
kosmo integrations:call railway.railway_get_project '{"project_id":"example_project_id"}' --json
Shortcut
kosmo integrations:railway railway_get_project '{"project_id":"example_project_id"}' --json

railway.railway_create_project

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

Write write
Parameters
name, description
Generic call
kosmo integrations:call railway.railway_create_project '{"name":"example_name","description":"example_description"}' --json
Shortcut
kosmo integrations:railway railway_create_project '{"name":"example_name","description":"example_description"}' --json

railway.railway_list_services

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

Read read
Parameters
project_id
Generic call
kosmo integrations:call railway.railway_list_services '{"project_id":"example_project_id"}' --json
Shortcut
kosmo integrations:railway railway_list_services '{"project_id":"example_project_id"}' --json

railway.railway_get_service

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

Read read
Parameters
service_id
Generic call
kosmo integrations:call railway.railway_get_service '{"service_id":"example_service_id"}' --json
Shortcut
kosmo integrations:railway railway_get_service '{"service_id":"example_service_id"}' --json

railway.railway_list_deployments

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

Read read
Parameters
service_id, environment_id, limit
Generic call
kosmo integrations:call railway.railway_list_deployments '{"service_id":"example_service_id","environment_id":"example_environment_id","limit":1}' --json
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

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

Read read
Parameters
none
Generic call
kosmo integrations:call railway.railway_get_current_user '{}' --json
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 0 parameters
Schema command
kosmo integrations:schema railway.railway_list_projects --json
ParameterTypeRequiredDescription
No parameters.
railway.railway_get_project 1 parameters
Schema command
kosmo integrations:schema railway.railway_get_project --json
ParameterTypeRequiredDescription
project_id string yes The Railway project ID.
railway.railway_create_project 2 parameters
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 1 parameters
Schema command
kosmo integrations:schema railway.railway_list_services --json
ParameterTypeRequiredDescription
project_id string yes The Railway project ID.
railway.railway_get_service 1 parameters
Schema command
kosmo integrations:schema railway.railway_get_service --json
ParameterTypeRequiredDescription
service_id string yes The Railway service ID.
railway.railway_list_deployments 3 parameters
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 0 parameters
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.