SSH
Connect to a box with:SSH keys
Instead of the password, you can log in with an SSH key. A key you add works for all boxes in your account or team.-
Create a key pair, if you don’t have one:
-
In the Upstash Console, go to Box → Settings → SSH Keys, click New SSH Key, and paste the contents of
~/.ssh/upstash_box.pub. -
Connect with the private key:
~/.ssh/id_ed25519, you can leave out -i.
You can also click Generate Key to have Upstash create the key pair. The private key is shown only once and isn’t stored, so save it right away.
sk-) variants, and RSA keys of at least 2048 bits. An account can have up to 20 keys.
API
Run a shell command
A shell command resolves when the command finishes and gives you back the result and status.Run a code snippet
You can execute code inside of a box:Check exit status
If the command fails, the run status will be"failed" and its result contains the stderr output.
Chain commands
Pass a full shell expression. Pipes, redirects, and chained commands all work as expected.Hold a command open
exec.command runs a command to completion. When you need to write to stdin, drive an interactive program through a terminal, or signal a process while it runs, start a live session instead.
Cancel a long-running command
You can cancel a run to abort it. The status becomes"cancelled".
Retrieve logs
After a command finishes, calllogs() to get the full timestamped output for debugging or auditing.
Examples
Install dependencies before a run
Set up the environment withbox.exec.command(), then hand off to the agent.