Shell Access
Open an interactive terminal session in a running Docker service from the CLI.
edge service shell opens a terminal session in a running Docker service. The session behaves like a normal shell, with colour output, tab completion, and automatic resize when you resize your terminal window.
Usage
edge service shell <svc-slug>Global flags
All standard global flags apply — --workspace, --project, --env, --token, --api-url. If you have already run edge link in your project directory, the workspace/project/env context is picked up automatically.
Requirements
| Requirement | Detail |
|---|---|
| Service type | docker only — managed databases do not expose a shell endpoint |
| Service status | Must be running — stopped or deploying services will return an error |
| Auth | User session token or project token |
Examples
# Shell into "api" in the currently linked environment
edge service shell api
# Explicitly target an environment
edge service shell api -w acme -p backend -e production
# Works with project tokens too
CLOUD_TOKEN=sk_proj_... edge service shell apiSession behaviour
- The CLI resolves your workspace, project, and environment context.
- The CLI connects to a running instance of the service.
- Your terminal input is forwarded to the service shell, including arrow keys,
Ctrl+C,Tab, and other control sequences. - The shell is
/bin/bash, falling back to/bin/shif Bash is not installed. - Terminal resize events are forwarded automatically so full-width output, such as
htoporvim, reflows correctly. - The session ends when you type
exit, pressCtrl+D, or interrupt withCtrl+C.
Multi-replica deployments
In services with multiple replicas, the platform connects you to one running replica. The selected replica is not guaranteed. If you need consistent access to a specific runtime instance, temporarily scale the service to one replica before opening a shell.
Non-interactive use
If stdin is not a TTY, such as when piping input, the CLI skips interactive terminal handling but still runs the command stream:
echo "ls -la /app" | edge service shell apiNon-interactive use is best-effort. Complex interactive programs (vim, htop, psql) require a real TTY and will not render correctly when piped.