Add domain management commands to Railway CLI#968
Open
m-abdelwahab wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Domain Management MVP to the Railway CLI and local MCP server. Users and agents can now create, list, inspect, update, retry certificates for, and delete Railway service domains and custom domains from the CLI.
What Changed
railway domain list/lsrailway domain status <domain-or-id>railway domain update <domain-or-id>railway domain certificate retry <domain-or-id>railway domain delete <domain-or-id>/remove/rmrailway domain [DOMAIN]create behavior with--port.railway domain --jsonoutput shapes.customDomainAvailablepreflight and relying oncustomDomainCreate, matching dashboard behavior.CLI Commands
Notes:
<DOMAIN_OR_ID>accepts a domain ID, domain name, or full URL.--portmust be in the range1-65535.--domainrenames Railway-provided service domains only. Custom domains cannot be renamed.domain certificate retrysupports custom domains only.--yesmakes deletion non-interactive.JSON Output Contracts
Legacy create/list behavior remains compatible:
{ "domain": "https://example.up.railway.app" }{ "domains": ["https://example.up.railway.app"] }railway domain list --json:{ "domains": [ { "id": "0240ae9b-453b-4885-abcc-30c79ecdaab1", "domain": "example.up.railway.app", "type": "service", "targetPort": 8080, "syncStatus": "ACTIVE", "createdAt": "2026-06-14T13:01:36.312+00:00", "updatedAt": "2026-06-14T13:01:36.866+00:00" } ] }railway domain status --json,railway domain update --json, andrailway domain certificate retry --json:{ "domain": { "id": "c310f34c-0276-4eba-a6fa-9c85e07fe518", "domain": "custom.example.com", "type": "custom", "targetPort": 8080, "syncStatus": "ACTIVE", "createdAt": "2026-06-14T13:00:14.183+00:00", "updatedAt": "2026-06-14T13:00:49.926+00:00", "dnsRecords": [ { "recordType": "DNS_RECORD_TYPE_CNAME", "name": "custom", "fqdn": "custom.example.com", "requiredValue": "example.up.railway.app", "currentValue": "", "status": "DNS_RECORD_STATUS_REQUIRES_UPDATE", "zone": "example.com", "purpose": "DNS_RECORD_PURPOSE_TRAFFIC_ROUTE" } ], "verification": { "verified": false, "dnsHost": "_railway-verify.custom", "token": "railway-verify=..." }, "certificate": { "status": "CERTIFICATE_STATUS_TYPE_VALIDATING_OWNERSHIP" } } }railway domain delete --json:{ "deleted": true, "domain": { "id": "c310f34c-0276-4eba-a6fa-9c85e07fe518", "domain": "custom.example.com", "type": "custom", "targetPort": 8080, "syncStatus": "ACTIVE", "createdAt": "2026-06-14T13:00:14.183+00:00", "updatedAt": "2026-06-14T13:00:49.926+00:00" } }Custom-domain creation keeps the existing mutation-shaped output:
{ "customDomainCreate": { "id": "c310f34c-0276-4eba-a6fa-9c85e07fe518", "domain": "custom.example.com", "targetPort": 3000, "syncStatus": "CREATING", "status": { "dnsRecords": [], "certificateStatus": "CERTIFICATE_STATUS_TYPE_VALIDATING_OWNERSHIP", "verified": false } } }MCP Tools
generate_domainlist_domainsdomain_statusupdate_domainretry_domain_certificatedelete_domainNotes
customDomainIssueCertificatemutation with token auth.targetPortdirectly toserviceDomainCreate, avoiding create-then-update sync races.Testing
cargo build --quietcargo test --quiet322 passedgit diff --checkLive Smoke Test
Ran a full end-to-end smoke test against a new Railway project:
SUCCESS.3000to8080.Final smoke project was intentionally left running for inspection.