This skill should be used when the user asks about service status, wants to rename a service, change service icons, link services, or create services with Docker images. For creating services with local code, prefer the `new` skill. For GitHub repo sources, use `new` skill to create empty service then `environment` skill to configure source.
Check status, update properties, and advanced service creation.
Note: For creating services with local code (the common case), prefer the new skill which handles project setup, scaffolding, and service creation together.
For GitHub repo sources: Use new skill to create empty service, then environment skill to configure source.repo via staged changes API.
Create a new service via GraphQL API. There is no CLI command for this.
railway status --json
Extract:
project.id - for creating the serviceenvironment.id - for staging the instance configmutation serviceCreate($input: ServiceCreateInput!) {
serviceCreate(input: $input) {
id
name
}
}
| Field | Type | Description |
|---|---|---|
projectId | String! | Project ID (required) |
name | String | Service name (auto-generated if omitted) |
source.image | String | Docker image (e.g., nginx:latest) |
source.repo | String | GitHub repo (e.g., user/repo) |
branch | String | Git branch for repo source |
environmentId | String | If set and is a fork, only creates in that env |
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation createService($input: ServiceCreateInput!) {
serviceCreate(input: $input) { id name }
}' \
'{"input": {"projectId": "PROJECT_ID"}}'
SCRIPT
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation createService($input: ServiceCreateInput!) {
serviceCreate(input: $input) { id name }
}' \
'{"input": {"projectId": "PROJECT_ID", "name": "my-service", "source": {"image": "nginx:latest"}}}'
SCRIPT
Do NOT use serviceCreate with source.repo - use staged changes API instead.
Flow:
serviceCreate(input: {projectId: "...", name: "my-service"})environment skill to configure source via staged changes APIUse environment skill to configure the service instance:
{
"services": {
"<serviceId>": {
"isCreated": true,
"source": { "image": "nginx:latest" },
"variables": {
"PORT": { "value": "8080" }
}
}
}
}
Critical: Always include isCreated: true for new service instances.
Then use environment skill to apply and deploy.
For variable references, see reference/variables.md.
railway service status --json
Returns current deployment status for the linked service.
railway deployment list --json --limit 5
Show:
| Status | Meaning |
|---|---|
| SUCCESS | Deployed and running |
| FAILED | Build or deploy failed |
| DEPLOYING | Currently deploying |
| BUILDING | Build in progress |
| CRASHED | Runtime crash |
| REMOVED | Deployment removed |
Update service name or icon via GraphQL API.
railway status --json
Extract service.id from the response.
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation updateService($id: String!, $input: ServiceUpdateInput!) {
serviceUpdate(id: $id, input: $input) { id name }
}' \
'{"id": "SERVICE_ID", "input": {"name": "new-name"}}'
SCRIPT
Icons can be image URLs or animated GIFs.
| Type | Example |
|---|---|
| Image URL | "icon": "https://example.com/logo.png" |
| Animated GIF | "icon": "https://example.com/animated.gif" |
| Devicons | "icon": "https://devicons.railway.app/github" |
Railway Devicons: Query https://devicons.railway.app/{query} for common developer icons (e.g., github, postgres, redis, nodejs). Browse all at https://devicons.railway.app
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation updateService($id: String!, $input: ServiceUpdateInput!) {
serviceUpdate(id: $id, input: $input) { id icon }
}' \
'{"id": "SERVICE_ID", "input": {"icon": "https://devicons.railway.app/github"}}'
SCRIPT
| Field | Type | Description |
|---|---|---|
name | String | Service name |
icon | String | Emoji or image URL (including animated GIFs) |
For agent automation, prefer explicit railway run -p/-e/-s -- ... or a script wrapper with explicit context. Treat interactive linking as a human/manual flow, not the default agent path.
Switch the linked service for the current directory:
railway service link
Or specify directly:
railway service link <service-name>
Fully non-interactive linking is acceptable only when all required flags are provided:
railway link --project <project-id> --environment <env> --service <service> --json
Automation-safe alternatives:
railway run -p <project-id> -e <env> -s <service> -- env | grep RAILWAY_SERVICE
~/agent-skills/scripts/dx-load-railway-auth.sh -- \
~/agent-skills/scripts/dx-railway-run.sh -- \
env | grep RAILWAY_SERVICE
new skill (handles scaffolding + creation)environment skill (variables, commands, image, etc.)environment skill with isDeleted: trueenvironment skilldeployment skilldeploy skillNo service linked.
Human/manual flow:
railway service link
Agent automation:
railway run -p <project-id> -e <env> -s <service> -- <command>
Service exists but has no deployments yet. Deploy with `railway up`.
Service "foo" not found. Check available services with `railway status`.
User may not be in a linked project. Check railway status.
User needs at least DEVELOPER role to create services.
Docker image must be accessible (public or with registry credentials).