Skip to content

feat: add service source command to configure repo source#783

Open
ndneighbor wants to merge 3 commits intomasterfrom
feature/service-source-command
Open

feat: add service source command to configure repo source#783
ndneighbor wants to merge 3 commits intomasterfrom
feature/service-source-command

Conversation

@ndneighbor
Copy link
Contributor

@ndneighbor ndneighbor commented Feb 4, 2026

Summary

Adds a new railway service source command that allows configuring a service's repo source directly from the CLI, eliminating the need to use the dashboard for this operation.

Features

  • Connect a GitHub repo to a service
  • Set the branch (defaults to repo's default branch)
  • Set root directory path within the repo
  • Set watch paths/patterns to trigger deployments

Usage

railway service source --repo owner/repo [OPTIONS]

Options

Option Description
--repo, -r GitHub repo to connect (format: owner/repo) - required
--branch, -b Branch name (optional, defaults to repo's default branch)
--root-directory Root directory path within the repo
--watch-paths Watch paths/patterns to trigger deployments
--service, -s Service name or ID (defaults to linked service)
--environment, -e Environment (defaults to linked environment)

Example

# Connect a service to a monorepo with root directory and watch paths
railway service source \
  --repo railwayapp/mono \
  --root-directory packages/central-station/apps/claude-code-runner \
  --watch-paths "packages/central-station/apps/claude-code-runner/**"

Changes

  • Added ServiceConnect.graphql mutation for connecting a service to a source
  • Added ServiceInstanceUpdateSource.graphql mutation for updating root directory and watch paths
  • Added Source subcommand to service.rs with full implementation

ndneighbor and others added 2 commits February 4, 2026 02:15
Adds a new `railway service source` command that allows configuring
a service's repo source directly from the CLI:

- Connect a GitHub repo to a service
- Set the branch (defaults to repo's default branch)
- Set root directory path
- Set watch paths/patterns

Usage:
  railway service source --repo owner/repo [OPTIONS]

Options:
  --repo, -r         GitHub repo (required)
  --branch, -b       Branch name
  --root-directory   Root directory path within the repo
  --watch-paths      Watch paths/patterns to trigger deployments
  --service, -s      Service name or ID (defaults to linked)
  --environment, -e  Environment (defaults to linked)

Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
@ndneighbor ndneighbor added the release/minor Author minor release label Feb 4, 2026
Co-Authored-By: Warp <agent@warp.dev>
@Milo123459
Copy link
Collaborator

You can already do this though the environment edit command, is it worth adding another command to do the same thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants