Running Tests with Crabbox
Crabbox is a CLI tool that runs commands inside a remote box from your local machine. This guide shows how to use it with Upstash Box to run your test suite in a clean cloud environment without touching your local setup.
1. Install Crabbox
brew install openclaw/tap/crabbox2. Get Your API Key
Go to the Upstash Console and create a Box API key. Then export it in your terminal:
export UPSTASH_BOX_API_KEY=your_api_key_here3. Warm Up a Box
Create a box with the warmup command. This provisions the box ahead of time so it's ready when you need it.
crabbox warmup --provider upstash-box --upstash-box-runtime node --upstash-box-size smallYou can customize the box to match your project's needs:
| Flag | Description | Values |
|---|---|---|
--upstash-box-runtime | Runtime environment | node, python, golang, ruby, rust (or -alpine variants) |
--upstash-box-size | Box size | small, medium, large |
--upstash-box-workdir | Working directory inside the box | Any path (default: /workspace/home/crabbox) |
--upstash-box-keep-alive | Keep the box up and running at all times | true / false |
4. Run Your Tests
Run your test command inside the box. Use --env-from-profile to load environment variables from a local .env file — they'll be injected into the box without being stored anywhere.
crabbox run --provider upstash-box --env-from-profile .env -- pnpm testYou can use any package manager or test runner:
# npmcrabbox run --provider upstash-box --env-from-profile .env -- npm test# buncrabbox run --provider upstash-box --env-from-profile .env -- bun testFor the full list of commands and options, see the Upstash Box provider reference.