railway-service by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill railway-service检查状态、更新属性和高级服务创建。
注意: 对于使用本地代码创建服务(常见情况),建议使用 railway-new 技能,它同时处理项目设置、脚手架搭建和服务创建。
对于 GitHub 仓库源: 使用 railway-new 技能创建空服务,然后使用 railway-environment 技能通过暂存更改 API 配置 source.repo。
通过 GraphQL API 创建新服务。没有对应的 CLI 命令。
railway status --json
提取:
project.id - 用于创建服务environment.id - 用于暂存实例配置mutation serviceCreate($input: ServiceCreateInput!) {
serviceCreate(input: $input) {
id
name
}
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 字段 | 类型 | 描述 |
|---|---|---|
projectId | String! | 项目 ID(必需) |
name | String | 服务名称(如果省略则自动生成) |
source.image | String | Docker 镜像(例如,nginx:latest) |
source.repo | String | GitHub 仓库(例如,user/repo) |
branch | String | 仓库源的 Git 分支 |
environmentId | String | 如果设置且是分支环境,则仅在该环境中创建 |
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'mutation createService($input: ServiceCreateInput!) {
serviceCreate(input: $input) { id name }
}' \
'{"input": {"projectId": "PROJECT_ID"}}'
SCRIPT
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'mutation createService($input: ServiceCreateInput!) {
serviceCreate(input: $input) { id name }
}' \
'{"input": {"projectId": "PROJECT_ID", "name": "my-service", "source": {"image": "nginx:latest"}}}'
SCRIPT
请勿使用带有 source.repo 的 serviceCreate - 请改用暂存更改 API。
流程:
serviceCreate(input: {projectId: "...", name: "my-service"})使用 railway-environment 技能配置服务实例:
{
"services": {
"<serviceId>": {
"isCreated": true,
"source": { "image": "nginx:latest" },
"variables": {
"PORT": { "value": "8080" }
}
}
}
}
关键: 对于新的服务实例,始终包含 isCreated: true。
然后使用 railway-environment 技能进行应用和部署。
railway service status --json
返回链接服务的当前部署状态。
railway deployment list --json --limit 5
显示:
| 状态 | 含义 |
|---|---|
| SUCCESS | 已部署并正在运行 |
| FAILED | 构建或部署失败 |
| DEPLOYING | 正在部署 |
| BUILDING | 构建进行中 |
| CRASHED | 运行时崩溃 |
| REMOVED | 部署已移除 |
通过 GraphQL API 更新服务名称或图标。
railway status --json
从响应中提取 service.id。
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'mutation updateService($id: String!, $input: ServiceUpdateInput!) {
serviceUpdate(id: $id, input: $input) { id name }
}' \
'{"id": "SERVICE_ID", "input": {"name": "new-name"}}'
SCRIPT
图标可以是图片 URL 或动画 GIF。
| 类型 | 示例 |
|---|---|
| 图片 URL | "icon": "https://example.com/logo.png" |
| 动画 GIF | "icon": "https://example.com/animated.gif" |
| 开发图标 | "icon": "https://devicons.railway.app/github" |
Railway 开发图标: 查询 https://devicons.railway.app/{query} 获取常见的开发者图标(例如,github、postgres、redis、nodejs)。在 https://devicons.railway.app 浏览所有图标
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/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
| 字段 | 类型 | 描述 |
|---|---|---|
name | String | 服务名称 |
icon | String | 表情符号或图片 URL(包括动画 GIF) |
切换当前目录链接的服务:
railway service link
或直接指定:
railway service link <service-name>
isDeleted: trueNo service linked. Run `railway service link` to link a service.
Service exists but has no deployments yet. Deploy with `railway up`.
Service "foo" not found. Check available services with `railway status`.
用户可能未在链接的项目中。检查 railway status。
用户需要至少 DEVELOPER 角色才能创建服务。
Docker 镜像必须可访问(公开或具有注册表凭据)。
每周安装次数
136
仓库
GitHub 星标数
22.6K
首次出现
2026年1月21日
安全审计
安装于
claude-code115
opencode104
gemini-cli102
cursor96
antigravity92
codex88
Check status, update properties, and advanced service creation.
Note: For creating services with local code (the common case), prefer the railway-new skill which handles project setup, scaffolding, and service creation together.
For GitHub repo sources: Use railway-new skill to create empty service, then railway-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) |
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/railway-api.sh \
'mutation createService($input: ServiceCreateInput!) {
serviceCreate(input: $input) { id name }
}' \
'{"input": {"projectId": "PROJECT_ID"}}'
SCRIPT
bash <<'SCRIPT'
${CLAUDE_PLUGIN_ROOT}/skills/lib/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"})Use railway-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 railway-environment skill to apply and deploy.
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'
${CLAUDE_PLUGIN_ROOT}/skills/lib/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'
${CLAUDE_PLUGIN_ROOT}/skills/lib/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) |
Switch the linked service for the current directory:
railway service link
Or specify directly:
railway service link <service-name>
isDeleted: trueNo service linked. Run `railway service link` to link a service.
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).
Weekly Installs
136
Repository
GitHub Stars
22.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code115
opencode104
gemini-cli102
cursor96
antigravity92
codex88
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
125,100 周安装
branch | String | Git branch for repo source |
environmentId | String | If set and is a fork, only creates in that env |