service
Original:🇺🇸 English
Not Translated
1 scripts
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.
1installs
Sourceartivilla/agents-config
Added on
NPX Install
npx skill4agent add artivilla/agents-config serviceSKILL.md Content
Service Management
Check status, update properties, and advanced service creation.
When to Use
- User asks about service status, health, or deployments
- User asks "is my service deployed?"
- User wants to rename a service or change service icon
- User wants to link a different service
- User wants to deploy a Docker image as a new service (advanced)
Note: For creating services with local code (the common case), prefer the skill which handles project setup, scaffolding, and service creation together.
newFor GitHub repo sources: Use skill to create empty service, then skill to configure source.repo via staged changes API.
newenvironmentCreate Service
Create a new service via GraphQL API. There is no CLI command for this.
Get Context
bash
railway status --jsonExtract:
- - for creating the service
project.id - - for staging the instance config
environment.id
Create Service Mutation
graphql
mutation serviceCreate($input: ServiceCreateInput!) {
serviceCreate(input: $input) {
id
name
}
}ServiceCreateInput Fields
| Field | Type | Description |
|---|---|---|
| String! | Project ID (required) |
| String | Service name (auto-generated if omitted) |
| String | Docker image (e.g., |
| String | GitHub repo (e.g., |
| String | Git branch for repo source |
| String | If set and is a fork, only creates in that env |
Example: Create empty service
bash
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation createService($input: ServiceCreateInput!) {
serviceCreate(input: $input) { id name }
}' \
'{"input": {"projectId": "PROJECT_ID"}}'
SCRIPTExample: Create service with image
bash
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"}}}'
SCRIPTConnecting a GitHub Repo
Do NOT use serviceCreate with source.repo - use staged changes API instead.
Flow:
- Create empty service:
serviceCreate(input: {projectId: "...", name: "my-service"}) - Use skill to configure source via staged changes API
environment - Apply to trigger deployment
After Creating: Configure Instance
Use skill to configure the service instance:
environmentjson
{
"services": {
"<serviceId>": {
"isCreated": true,
"source": { "image": "nginx:latest" },
"variables": {
"PORT": { "value": "8080" }
}
}
}
}Critical: Always include for new service instances.
isCreated: trueThen use skill to apply and deploy.
environmentFor variable references, see reference/variables.md.
Check Service Status
bash
railway service status --jsonReturns current deployment status for the linked service.
Deployment History
bash
railway deployment list --json --limit 5Present Status
Show:
- Service: name and current status
- Latest Deployment: status (SUCCESS, FAILED, DEPLOYING, CRASHED, etc.)
- Deployed At: when the current deployment went live
- Recent Deployments: last 3-5 with status and timestamps
Deployment Statuses
| 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
Update service name or icon via GraphQL API.
Get Service ID
bash
railway status --jsonExtract from the response.
service.idUpdate Name
bash
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"}}'
SCRIPTUpdate Icon
Icons can be image URLs or animated GIFs.
| Type | Example |
|---|---|
| Image URL | |
| Animated GIF | |
| Devicons | |
Railway Devicons: Query for common developer icons (e.g., , , , ). Browse all at https://devicons.railway.app
https://devicons.railway.app/{query}githubpostgresredisnodejsbash
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"}}'
SCRIPTServiceUpdateInput Fields
| Field | Type | Description |
|---|---|---|
| String | Service name |
| String | Emoji or image URL (including animated GIFs) |
Link Service
Switch the linked service for the current directory:
bash
railway service linkOr specify directly:
bash
railway service link <service-name>Composability
- Create service with local code: Use skill (handles scaffolding + creation)
new - Configure service: Use skill (variables, commands, image, etc.)
environment - Delete service: Use skill with
environmentisDeleted: true - Apply changes: Use skill
environment - View logs: Use skill
deployment - Deploy local code: Use skill
deploy
Error Handling
No Service Linked
No service linked. Run `railway service link` to link a service.No Deployments
Service exists but has no deployments yet. Deploy with `railway up`.Service Not Found
Service "foo" not found. Check available services with `railway status`.Project Not Found
User may not be in a linked project. Check .
railway statusPermission Denied
User needs at least DEVELOPER role to create services.
Invalid Image
Docker image must be accessible (public or with registry credentials).