跳到正文
Skillpedia
部署与云(DevOps)33k · #8906

railway-domain

它能做什么

这项技能管理 Railway 服务的网址。适合希望为服务指定公开网址或自有域名的开发者。

适用场景

  • ✓当你想为服务生成一个 Railway 网址时。
  • ✓当你想绑定自己的自定义域名时。
  • ✓当你想查看或删除某个服务已设置的域名的时候。

技能链接

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/railway/domain/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/railway/domain/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请为我的 API 服务生成一个 Railway 域名,并告诉我自定义域名 example.com 需要的 DNS 记录。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会创建 Railway 提供的域名,或添加自定义域名,返回你需要在域名服务商处添加的 DNS 记录,并可以列出或删除现有域名。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Railway Domain Management

Add, view, or remove domains for Railway services.

When to Use

  • User asks to "add a domain", "generate a domain", "get a URL"
  • User wants to add a custom domain
  • User asks "what's the URL for my service"
  • User wants to remove a domain

Add Railway Domain

Generate a railway-provided domain (max 1 per service):

railway domain --json

For a specific service:

railway domain --json --service backend

Response

Returns the generated domain URL. Service must have a deployment.

Add Custom Domain

railway domain example.com --json

Response

Returns required DNS records:

{
  "domain": "example.com",
  "dnsRecords": [
    { "type": "CNAME", "host": "@", "value": "..." }
  ]
}

Tell user to add these records to their DNS provider.

Read Current Domains

Use railway-environment skill to see configured domains, or query directly:

query domains($envId: String!) {
  environment(id: $envId) {
    config(decryptVariables: false)
  }
}

Domains are in config.services.<serviceId>.networking:

  • serviceDomains - Railway-provided domains
  • customDomains - User-provided domains

Remove Domain

Use railway-environment skill to remove domains:

Remove custom domain

{
  "services": {
    "<serviceId>": {
      "networking": {
        "customDomains": { "<domainId>": null }
      }
    }
  }
}

Remove railway domain

{
  "services": {
    "<serviceId>": {
      "networking": {
        "serviceDomains": { "<domainId>": null }
      }
    }
  }
}

Then use railway-environment skill to apply and commit the change.

CLI Options

Flag Description
[DOMAIN] Custom domain to add (omit for railway domain)
-p, --port <PORT> Port to connect
-s, --service <NAME> Target service (defaults to linked)
--json JSON output

Composability

  • Read domains: Use railway-environment skill
  • Remove domains: Use railway-environment skill
  • Apply removal: Use railway-environment skill
  • Check service: Use railway-service skill

Error Handling

No Service Linked

No service linked. Use --service flag or run `railway service` to select one.

Domain Already Exists

Service already has a railway-provided domain. Maximum 1 per service.

No Deployment

Service has no deployment. Deploy first with `railway up`.

Invalid Domain

Invalid domain format. Use a valid domain like "example.com" or "api.example.com".
常见问题

每个服务可以有几个 Railway 域名?

根据这项技能的说明,每个服务只有一个 Railway 生成的域名。

DNS 记录怎么处理?

在你的 DNS 服务商处添加,使自定义域名指向你的服务。

服务需要先部署吗?

需要。服务必须先有一次部署,才能生成域名。

详情

作者的原始描述

Add, view, or remove domains for Railway services. Use when user wants to add a domain, generate a railway domain, check current domains, get the URL for a service, or remove a domain.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8906
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能