跳到正文
cccskills
免费在 GitHub 公开

railway

Manage Railway projects, services, deployments, environments, variables, and deployment logs via Railway's public GraphQL API — one endpoint, relay-style pagination, two token flavors (account vs project), typed mutations for deploys and env vars. Use when the user wants to deploy, check service status, manage env vars, or read deployment logs programmatically without the Railway MCP installed.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md7.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Railway

Operates Railway via its public GraphQL API. Covers projects, environments, services, deployments, variables, logs. Prefer over railway CLI for typed, filterable reads pipeable through jq.

Usage

  • Use for: Listing projects/services/deploy status, tailing deployment logs, upserting env vars, triggering redeploys from scripts.
  • Skip for: New-account setup, billing/plan changes, first-time GitHub OAuth, short interactive sessions where railway CLI is faster.

Credentials check

[ -n "$RAILWAY_TOKEN" ] && echo "RAILWAY_TOKEN: PRESENT" || echo "RAILWAY_TOKEN: MISSING"

Never echo the variable directly.

If MISSING, respond to the user with EXACTLY this message (do NOT paraphrase, do NOT suggest manual JSON edits):

I need your railway credential. Run this in another terminal — it'll open the signup page, validate format, and save it safely with masked input:

teleport-setup add-key railway

Then restart Claude Code (/exit, then claude) and ask me again.

Do NOT suggest editing ~/.claude/settings.local.json manually. The teleport-setup add-key command handles it with backup, validation, and masked input. Stop execution until the user has run the command and restarted.

API

  • Endpoint: https://backboard.railway.com/graphql/v2 — single endpoint, POST only, Content-Type: application/json.
  • Auth: Authorization: Bearer $RAILWAY_TOKEN (account/workspace/OAuth tokens).
  • Token flavors: account/workspace/OAuth use Authorization: Bearer; project tokens use Project-Access-Token: <TOKEN> (NOT Bearer) and see only one project+env. This skill assumes $RAILWAY_TOKEN is an account token.
  • Rate limits: 100/1000/10000 RPH (Free/Hobby/Pro), 10/50 RPS (Hobby/Pro). Inspect X-RateLimit-Remaining, Retry-After.
  • GraphQL envelope: { "data":{...}, "errors":[...] }. HTTP 200 even on failure — always check .errors. Variables go in top-level variables, not interpolated. Relay-style { edges:[{node}], pageInfo } on lists.
  • Introspection enabled; GraphiQL at https://railway.com/graphiql.

Entity hierarchy

Workspace → Project → Environment + Service → Deployment. Variables scoped by triple (projectId, environmentId, serviceId); omit serviceId for project-shared.

Queries & mutations

OperationKindOne-liner
mequeryCurrent user; auth smoke test.
projects / project(id:) / environments(projectId:)queryList/fetch projects + their envs and services.
deployments(input:, first:) / deployment(id:)queryRecent deploys for (projectId, serviceId); single {status,url,createdAt}.
deploymentLogs(deploymentId:, limit:)queryLog lines {timestamp,message,severity} — limit required.
variables(projectId:, environmentId:, serviceId:)queryVariables for a scope.
projectCreate / serviceCreate / environmentCreatemutationCreate primitives.
serviceInstanceDeploy / serviceInstanceUpdatemutationTrigger build+deploy; change start/build cmd, replicas, region.
variableCollectionUpsert / deploymentRollback(id:)mutationBulk-upsert env vars; roll a deployment back.
<!-- unverified: older guides mention `deploymentRestart`, `deploymentRemove`, `deploymentTriggerCreate`; current cookbook lists `serviceInstanceDeploy` and `deploymentRollback`. `serviceInstanceDeployV2` also seen in some deployments. Check docs for current mutation name. -->

Primary workflows

All calls: POST to $URL=https://backboard.railway.com/graphql/v2 with $H = -H "Authorization: Bearer $RAILWAY_TOKEN" -H "Content-Type: application/json".

1. List projects, environments, services

curl -sL -X POST $H "$URL" \
  -d '{"query":"query Me { me { projects(first:20){ edges{ node{ id name environments{ edges{ node{ id name } } } services{ edges{ node{ id name } } } } } } } }"}' \
  | jq '.data.me.projects.edges[].node | {id, name, envs:[.environments.edges[].node.name], services:[.services.edges[].node.name]}'

Save each environment.id / service.id — every mutation needs them; IDs are opaque UUIDs.

2. Upsert env vars (bulk)

curl -sL -X POST $H "$URL" \
  -d '{"query":"mutation($input:VariableCollectionUpsertInput!){ variableCollectionUpsert(input:$input) }","variables":{"input":{"projectId":"proj_xxx","environmentId":"env_xxx","serviceId":"svc_xxx","variables":{"LOG_LEVEL":"debug"},"replace":false,"skipDeploys":false}}}'

replace:true wipes vars not in payload; skipDeploys:true upserts without redeploying.

3. Trigger a deploy

curl -sL -X POST $H "$URL" \
  -d '{"query":"mutation($s:String!,$e:String!){ serviceInstanceDeploy(serviceId:$s, environmentId:$e) }","variables":{"s":"svc_xxx","e":"env_xxx"}}'

Confirm via deployments(input:{serviceId:$s}, first:1). Status: Initializing → Building → Deploying → Active/Completed (or Failed/Crashed). Poll ≥5s.

Gotchas

  • GraphQL errors return HTTP 200. Always check .errors before trusting .data; curl -f won't save you.
  • Account vs project tokens silently mismatch. Different header names and different scopes. A project token used as Bearer, or cross-project queries on a project token, fail with opaque auth errors.
  • Variable scope is a triple (projectId, environmentId, serviceId). Omitting serviceId creates a project-shared var; per-service inheritance depends on settings — don't assume propagation.
  • Mutation names drift. Railway has renamed deployment mutations (older deploymentTriggerCreate → current serviceInstanceDeploy). "Field not found" → re-check the cookbook. <!-- unverified -->
  • Log rate limits are tight. Don't poll deploymentLogs in a tight loop; one read per 5–10s, increase limit instead.
  • Relay cursor pagination. List fields return { edges:[{node}], pageInfo:{endCursor, hasNextPage} }. Use first:N, after:"<cursor>"; always pass first explicitly.
  • Use introspection. Point GraphiQL at the endpoint with your token and auto-complete the schema instead of guessing.

Attribution

Used skill: Railway (from teleport catalog).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

{{One-sentence what-it-does + when to use it. Mention it bypasses the MCP via the REST API with {{ENV_VAR}}. Use when the user wants X, Y, Z programmatically without the {{service}} MCP installed.}}

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

Manage Cloudflare DNS zones, Workers, Pages, R2, KV, D1, and analytics via REST API. Use when the user wants to query DNS, deploy a Worker, list R2 buckets, manage KV namespaces, run D1 queries, or check analytics without the Cloudflare MCP installed.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

context7

免费

Fetch up-to-date library, framework, and SDK documentation via Context7's search and docs endpoints. Use when the user asks about a library/API (React, Next.js, Prisma, Supabase, Tailwind, Django, Vue, etc.) and you need current docs, not Claude's training-time knowledge. Skip this skill for generic programming questions that don't require library-specific docs.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

discord

免费

Operate Discord via its REST API — post/read channel messages, manage guilds + roles, fire webhooks, register slash commands. Use when the user wants a bot to post to a channel, read recent history, run a community admin task, or ship one-way notifications via webhook URL without running a bot process.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

exa

免费

AI-first web search via Exa — semantic/neural ranking, category-scoped results, fresh content retrieval, and one-shot answer synthesis with citations. Use when the user needs current web information better ranked than general web search, or a grounded answer with sources.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

figma

免费

Read Figma files, component libraries, styles, comments, and export rendered assets (PNG / SVG / JPG / PDF) via Figma's REST API. Use when the user needs programmatic access to design files, to pull node data into code generation, or to export assets without opening the Figma desktop app.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

查看 mnlt 的全部技能

报告此技能的问题