feat(sandbox): railway sandbox commands (create/list/ssh/exec/destroy)#925
Merged
Conversation
…estroy) Adds a `railway sandbox` command group for Project Sandboxes (gated by the PROJECT_SANDBOXES backend flag; backend already shipped — this is CLI-only): - create: provision a sandbox; interactive workspace -> project -> environment picker when nothing is linked (Esc steps back), or --project/--environment for non-interactive use. Stored locally as the active sandbox. - list: sandboxes in the environment (CREATED column, active marked *). - ssh (alias connect): connect over the native SSH relay using the sbx:<env>:<id> target; defaults to the active sandbox or --id (environment recovered from the local store). Reuses the railway ssh key flow and auto-selects the registered key; sends periodic sandboxHeartbeats. - exec: one-shot command via sandboxExec. - destroy (alias rm/delete): tear down a sandbox. Local store in ~/.railway/config.json (sandboxes id->env cache + active_sandbox) lets ssh/exec/destroy run without re-specifying the environment. A rotating-cube spinner covers the create/destroy waits. schema.json: additively adds the Sandbox* types + sandbox query/mutation fields. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- create/destroy now use an animated single-line "shimmer" spinner: a rotating half-shaded cube, a light gradient sweeping across the label, and trailing dots that build up one at a time (precomputed as indicatif tick frames; degrades to plain text off-TTY). - selection menus (workspace → project → environment) are indented ~2 columns via a dedicated render config so they read as running "under" the command. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…link`) Drop the bespoke indented render config; the workspace → project → environment picker now uses the same `prompt_options`/`prompt_options_skippable` helpers (and default render config) as the rest of the CLI, so its look is consistent with `railway link` et al. The shimmer spinner is unchanged. The picker still stops at environment (sandboxes are environment-scoped — no service selection). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced May 31, 2026
codyde
added a commit
that referenced
this pull request
Jun 4, 2026
…-browser-login * origin/master: (28 commits) chore: Release railwayapp version 5.0.0 feat(sandbox): fork, templates, and `--variable`/`--env-file` on create (#933) chore: Release railwayapp version 4.68.0 feat(volume): include modified time in files JSON (#931) chore: Release railwayapp version 4.67.0 Add service source connection support (#934) chore: Release railwayapp version 4.66.2 Make GraphQL HTTP timeout configurable via RAILWAY_HTTP_TIMEOUT (#932) chore: Release railwayapp version 4.66.1 feat(volume): show status and scheduled deletion date in volume list (#928) SSH Command: Handle Identity Files (#926) chore: Release railwayapp version 4.66.0 feat(sandbox): `railway sandbox` commands (create/list/ssh/exec/destroy) (#925) chore: Release railwayapp version 4.65.0 SSH Agent Support, `russh` edition. (#915) chore: Release railwayapp version 4.64.0 chore: Release railwayapp version 4.63.0 Rephrase agent advisory and gate by CLI version (#919) Forward --remote to setup agent in cli.new installer (#918) chore: Release railwayapp version 4.62.0 ... # Conflicts: # src/consts.rs # src/util/mod.rs
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.
What
Adds a
railway sandboxcommand group for Project Sandboxes (gated by thePROJECT_SANDBOXESbackend flag). The backend is already shipped — this is CLI-only.Commands
railway sandbox create— provisions a sandbox and remembers it as the active one. Interactive workspace → project → environment picker when no project is linked (Esc steps back a level);--project/--environmentfor non-interactive use.railway sandbox list(ls) — sandboxes in the environment, with aCREATEDcolumn; the active sandbox is marked*.railway sandbox ssh(connect) — connects over the native SSH relay (sbx:<env>:<id>@ssh.railway.com). Defaults to the active sandbox, or--id <id>(environment recovered from the local store). Reuses the existingrailway sshkey-registration flow and auto-selects the registered key; sends periodicsandboxHeartbeats to keep the session alive.railway sandbox exec -- <cmd>— one-shot command viasandboxExec.railway sandbox destroy(rm/delete) — tears down a sandbox.Notes
~/.railway/config.jsongainssandboxes(id→environment cache) +active_sandbox, sossh/exec/destroywork without re-specifying--environment.RAILWAY_PROJECT_ID/ENVIRONMENT_ID/SANDBOX_IDcontext vars are present.railway login(user OAuth) is sufficient;RAILWAY_API_TOKENis not required.schema.json: additively adds only theSandbox*types + the sandbox query/mutation fields (no reformat/reorder of the existing schema).Testing
Verified end-to-end against production:
create → list → ssh → exec → destroy, the active-sandbox default,--idresolution, the interactive picker's data path, and the no-injection behavior.🤖 Generated with Claude Code