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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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 domainscustomDomains- 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.
热度
- GitHub 星标
- 33k
- 排名
- #8906
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。