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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call railway.railway_list_projects '{}' --json 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.
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 - Parameters
- none
kosmo integrations:call railway.railway_list_projects '{}' --json 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 - Parameters
- project_id
kosmo integrations:call railway.railway_get_project '{"project_id":"example_project_id"}' --json 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 - Parameters
- name, description
kosmo integrations:call railway.railway_create_project '{"name":"example_name","description":"example_description"}' --json 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 - Parameters
- project_id
kosmo integrations:call railway.railway_list_services '{"project_id":"example_project_id"}' --json 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 - Parameters
- service_id
kosmo integrations:call railway.railway_get_service '{"service_id":"example_service_id"}' --json 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 - Parameters
- service_id, environment_id, limit
kosmo integrations:call railway.railway_list_deployments '{"service_id":"example_service_id","environment_id":"example_environment_id","limit":1}' --json 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 - Parameters
- none
kosmo integrations:call railway.railway_get_current_user '{}' --json 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
kosmo integrations:schema railway.railway_list_projects --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
railway.railway_get_project 1 parameters
kosmo integrations:schema railway.railway_get_project --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The Railway project ID. |
railway.railway_create_project 2 parameters
kosmo integrations:schema railway.railway_create_project --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema railway.railway_list_services --json | Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | yes | The Railway project ID. |
railway.railway_get_service 1 parameters
kosmo integrations:schema railway.railway_get_service --json | Parameter | Type | Required | Description |
|---|---|---|---|
service_id | string | yes | The Railway service ID. |
railway.railway_list_deployments 3 parameters
kosmo integrations:schema railway.railway_list_deployments --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema railway.railway_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.