Native SSH Access
Shells, SCP, SFTP, rsync, port forwarding and git push, using the SSH tools you already have.
On this page
What it is
Every Sprite accepts SSH connections. Anything that works over SSH works with a Sprite: interactive shells, scp, sftp, rsync, port forwarding, and git push.
Why it matters: you can connect, move files and automate with tools you already know. No special client needed.
The two SSH addresses
| Address | Use it for |
|---|---|
my-org@sprites.dev | Control plane: managing Sprites (sprite create, checkpoint…) |
NAME--CLUSTER--my-org@sprites.dev | Direct guest: a shell or file transfer inside one Sprite |
The direct address joins the Sprite’s name, its cluster, and your organization slug with double dashes. For a Sprite named dev in the default cluster:
dev--default--my-org@sprites.dev
Add a host alias to ~/.ssh/config to save typing:
Host dev
HostName sprites.dev
User dev--default--my-org
Then ssh dev, scp file dev:/tmp/, and git remote add sprites dev:/home/sprite/app all work.
Step by step: get a shell
1. Make sure the Sprite exists
ssh my-org@sprites.dev sprite create dev
2. Connect
ssh dev--default--my-org@sprites.dev
You’re now in a shell inside the Sprite. If it was asleep, connecting wakes it, and the open session keeps it awake until you log out.
3. Or run a single command
ssh dev--default--my-org@sprites.dev 'uname -a'
Copying files
SCP
# Upload a file
scp ./app.tar dev--default--my-org@sprites.dev:/tmp/app.tar
# Upload a directory
scp -r ./src dev--default--my-org@sprites.dev:/home/sprite/src
# Download a file
scp dev--default--my-org@sprites.dev:/home/sprite/output.log ./
SFTP
sftp dev--default--my-org@sprites.dev
rsync
rsync runs over SSH too. The default base image already includes rsync; with a custom image, install it in the Sprite as well as locally:
rsync -avz ./site/ dev--default--my-org@sprites.dev:/home/sprite/site/
Without SSH
If you’re working from a program, the HTTP API can write a file:
curl -sS -X PUT "https://api.sprites.dev/v1/sprites/dev/fs/write?path=/tmp/app.tar" \
-H "Authorization: Bearer $SPRITES_TOKEN" \
-H "Content-Type: application/octet-stream" --data-binary @app.tar
The hard limit is 16 MiB, but in practice files over about 4 MiB hit the per-Sprite rate limit and fail with 429 rate_limited. A failed upload also uses up that minute’s budget, so even small writes can get 429 for about a minute afterwards. Use scp or rsync for anything larger than a few MiB.
There’s no read endpoint; use scp, sftp, or exec with cat or base64 to get files out.
Deploying with git push
Add a directory inside the Sprite as a Git remote and push. There’s nothing to set up first.
1. Add the remote
git remote add sprites dev--default--my-org@sprites.dev:/home/sprite/app
2. Push
git push sprites main
The first push creates the repository. Every push checks the pushed branch out into /home/sprite/app (main when you push main), so the code is ready to run.
/home/sprite/app holds plain files, not a Git working copy, so git status there reports “not a git repository”. Sprites keeps the repository itself elsewhere. If you want to run Git commands inside the Sprite, use a bare repository instead.
The Sprite’s image needs git installed. The default base image has it.
Prefer a bare repository?
Use a path ending in .git. Git uses it as-is and checks nothing out. Create it first, because pushing to a .git path that doesn’t exist fails:
ssh dev--default--my-org@sprites.dev 'git init --bare /home/sprite/app.git'
git remote add sprites dev--default--my-org@sprites.dev:/home/sprite/app.git
Port forwarding
Reach a service running inside the Sprite as if it were on your laptop. This forwards your local port 8080 to port 3000 inside dev:
ssh -N -L 8080:127.0.0.1:3000 dev--default--my-org@sprites.dev
Now open http://localhost:8080. This uses your SSH key, so there’s no API token involved.
The target must be exactly 127.0.0.1. localhost, other addresses, and remote (-R) forwarding are refused.
Running commands from scripts
For automation, the control plane’s sprite exec is often a better fit than a direct shell, because it returns structured output:
ssh my-org@sprites.dev sprite exec dev 'cd /home/sprite && ls -la'
The command runs as
/bin/sh -lcin the user’s home directory.It’s killed after 30 seconds unless you pass
--timeout-ms(up to 600000, 10 minutes) before the command:ssh my-org@sprites.dev sprite exec dev --timeout-ms 300000 'npm test'Output is NDJSON: an
exec_statusevent, thenstdout/stderrevents, then a finalexecevent withexit_status.--no-streamleaves out thestdout/stderrevents and prints onlyexec_statusand the finalexecevent.If the command times out, the output ends with
{"type":"error","error":{"code":"exec_timeout",...}}, and the SSH exit status is still 0.A zero SSH exit status means the exec ran. Check
exit_statusin the final event to see if your command succeeded:ssh -T my-org@sprites.dev sprite exec dev --no-stream 'test -f /home/sprite/app/package.json' \ | tail -n1 | jq '.exit_status'
Rule of thumb: use sprite exec for bounded automation, and direct SSH for interactive shells, file transfer, and Git.
Managing SSH keys
List and revoke the SSH keys registered with your organization:
ssh my-org@sprites.dev ssh-key list
ssh my-org@sprites.dev ssh-key revoke FINGERPRINT
Viewing logs
ssh my-org@sprites.dev logs dev --no-follow # everything so far
ssh my-org@sprites.dev logs dev --service web # follow one service