Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

use-railway使用铁路

Agent Skill

use-railway 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

72,720

周安装

2,961

GitHub Stars

253

下载量

23,760
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:use-railway(使用铁路)
来源仓库:https://github.com/railwayapp/railway-skills
仓库路径:skills/use-railway
安装命令:
npx skills add https://github.com/railwayapp/railway-skills --skill use-railway
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/railwayapp/railway-skills --skill use-railway

简介

完整的铁路基础设施管理:项目、服务、数据库、部署、环境、对象存储和故障排除。

  • 通过 CLI 上下文管理跨 Railway 的资源层次结构进行操作:工作区、项目、环境、服务、存储桶和部署
  • 涵盖五个操作领域:资源设置、代码部署、配置管理、健康监控和 API/文档访问
  • 包括预检身份验证检查、上下文解析和常见工作流程(例如首次部署、添加对象存储和故障恢复)的多步骤组合模式
  • 支持 CLI 命令和 GraphQL API 回退,以执行 CLI 未公开的操作;所有输出都使用 --json
  • 为了可靠的解析

SKILL.md

Use Railway

Railway resource model

Railway organizes infrastructure in a hierarchy:

  • Workspace is the billing and team scope. A user belongs to one or more workspaces.
  • Project is a collection of services under one workspace. It maps to one deployable unit of work.
  • Environment is an isolated configuration plane inside a project (for example, production, staging). Each environment has its own variables, config, and deployment history.
  • Service is a single deployable unit inside a project. It can be an app from a repo, a Docker image, or a managed database.
  • Bucket is an S3-compatible object storage resource inside a project. Buckets are created at the project level and deployed to environments. Each bucket has credentials (endpoint, access key, secret key) for S3-compatible access.
  • Deployment is a point-in-time release of a service in an environment. It has build logs, runtime logs, and a status lifecycle.

Most CLI commands operate on the linked project/environment/service context. Use railway status --json to see the context, and --project, --environment, --service flags to override.

Parsing Railway URLs

Users often paste Railway dashboard URLs. Extract IDs before doing anything else:

https://railway.com/project/<PROJECT_ID>/service/<SERVICE_ID>?environmentId=<ENV_ID>
https://railway.com/project/<PROJECT_ID>/service/<SERVICE_ID>

The URL always contains projectId and serviceId. It may contain environmentId as a query parameter. If the environment ID is missing and the user specifies an environment by name (e.g., "production"), resolve it:

scripts/railway-api.sh \
  'query getProject($id: String!) {
    project(id: $id) {
      environments { edges { node { id name } } }
    }
  }' \
  '{"id": "<PROJECT_ID>"}'

Match the environment name (case-insensitive) to get the environmentId.

Prefer passing explicit IDs to CLI commands (--project, --environment, --service) and scripts (--project-id, --environment-id, --service-id) instead of running railway link. This avoids modifying global state and is faster.

Preflight

Before any mutation, verify context:

command -v railway                # CLI installed
railway whoami --json             # authenticated
railway --version                 # check CLI version

Context resolution — URL IDs always win:

  • If the user provides a Railway URL, extract IDs from it. Do NOT run railway status --json — it returns the locally linked project, which is usually unrelated.
  • If no URL is given, fall back to railway status --json for the linked project/environment/service.

If the CLI is missing, guide the user to install it.

bash <(curl -fsSL cli.new) # Shell script (macOS, Linux, Windows via WSL)
brew install railway # Homebrew (macOS)
npm i -g @railway/cli # npm (macOS, Linux, Windows). Requires Node.js version 16 or higher.

If not authenticated, run railway login. If not linked and no URL was provided, run railway link --project <id-or-name>.

If a command is not recognized (for example, railway environment edit), the CLI may be outdated. Upgrade with:

railway upgrade

Common quick operations

These are frequent enough to handle without loading a reference:

railway status --json                                    # current context
railway whoami --json                                    # auth and workspace info
railway project list --json                              # list projects
railway service status --all --json                      # all services in current context
railway variable list --service <svc> --json             # list variables
railway variable set KEY=value --service <svc>           # set a variable
railway logs --service <svc> --lines 200 --json          # recent logs
railway up --detach -m "<summary>"                       # deploy current directory
railway bucket list --json                               # list buckets in current environment
railway bucket info --bucket <name> --json               # bucket storage and object count
railway bucket credentials --bucket <name> --json        # S3-compatible credentials

Routing

For anything beyond quick operations, load the reference that matches the user's intent. Load only what you need, one reference is usually enough, two at most.

IntentReferenceUse for
Analyze a database ("analyze <url>", "analyze db", "analyze database", "analyze service", "introspect", "check my postgres/redis/mysql/mongo")analyze-db.mdDatabase introspection and performance analysis. analyze-db.md directs you to the DB-specific reference. This takes priority over the status/operate routes when a Railway URL to a database service is provided alongside "analyze".
Create or connect resourcessetup.mdProjects, services, databases, buckets, templates, workspaces
Ship code or manage releasesdeploy.mdDeploy, redeploy, restart, build config, monorepo, Dockerfile
Change configurationconfigure.mdEnvironments, variables, config patches, domains, networking
Check health or debug failuresoperate.mdStatus, logs, metrics, build/runtime triage, recovery
Request from API, docs, or communityrequest.mdRailway GraphQL API queries/mutations, metrics queries, Central Station, official docs

If the request spans two areas (for example, "deploy and then check if it's healthy"), load both references and compose one response.

Execution rules

  1. Prefer Railway CLI. Fall back to scripts/railway-api.sh for operations the CLI doesn't expose.
  2. Use --json output where available for reliable parsing.
  3. Resolve context before mutation. Know which project, environment, and service you're acting on.
  4. For destructive actions (delete service, remove deployment, drop database), confirm intent and state impact before executing.
  5. After mutations, verify the result with a read-back command.

User-only commands (NEVER execute directly)

These commands modify database state and require the user to run them directly in their terminal. Do NOT execute these with Bash. Instead, show the command and ask the user to run it.

CommandWhy user-only
python3 scripts/enable-pg-stats.py --service <name>Modifies shared_preload_libraries, may restart database
python3 scripts/pg-extensions.py --service <name> install <ext>Installs database extension
python3 scripts/pg-extensions.py --service <name> uninstall <ext>Removes database extension
ALTER SYSTEM SET...Changes PostgreSQL configuration
DROP EXTENSION...Removes database extension
CREATE EXTENSION...Installs database extension

When these operations are needed:

  1. Explain what the command does and any side effects (e.g., restart required)
  2. Show the exact command the user should run
  3. Wait for user confirmation that they ran it
  4. Verify the result with a read-only query

Composition patterns

Multi-step workflows follow natural chains:

  • Add object storage: setup (create bucket), setup (get credentials), configure (set S3 variables on app service)
  • First deploy: setup (create project + service), configure (set variables and source), deploy, operate (verify healthy)
  • Fix a failure: operate (triage logs), configure (fix config/variables), deploy (redeploy), operate (verify recovery)
  • Add a domain: configure (add domain + set port), operate (verify DNS and service health)
  • Docs to action: request (fetch docs answer), route to the relevant operational reference

When composing, return one unified response covering all steps. Don't ask the user to invoke each step separately.

Setup decision flow

When the user wants to create or deploy something, determine the right action from current context:

  1. Run railway status --json in the current directory.
  2. If linked: add a service to the existing project (railway add --service <name>). Do not create a new project unless the user explicitly says "new project" or "separate project".
  3. If not linked: check the parent directory (cd.. && railway status --json).

- Parent linked: this is likely a monorepo sub-app. Add a service and set rootDirectory to the sub-app path. - Parent not linked: run railway list --json and look for a project matching the directory name. - Match found: link to it (railway link --project <name>). - No match: create a new project (railway init --name <name>).

  1. When multiple workspaces exist, match by name from railway whoami --json.

Naming heuristic: app names like "flappy-bird" or "my-api" are service names, not project names. Use the directory or repo name for the project.

Response format

For all operational responses, return:

  1. What was done (action and scope).
  2. The result (IDs, status, key output).
  3. What to do next (or confirmation that the task is complete).

Keep output concise. Include command evidence only when it helps the user understand what happened.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.18%
按下载量换算8,596

Claude

29.66%
按下载量换算7,047

Cursor

16.31%
按下载量换算3,875

Gemini CLI

9.2%
按下载量换算2,186

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills