diff --git a/box/guides/crabbox-setup.mdx b/box/guides/crabbox-setup.mdx new file mode 100644 index 000000000..404412166 --- /dev/null +++ b/box/guides/crabbox-setup.mdx @@ -0,0 +1,66 @@ +--- +title: "Running Tests with Crabbox" +--- + +[Crabbox](https://crabbox.sh) 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 + +```bash +brew install openclaw/tap/crabbox +``` + +--- + +## 2. Get Your API Key + +Go to the [Upstash Console](https://console.upstash.com) and create a Box API key. Then export it in your terminal: + +```bash +export UPSTASH_BOX_API_KEY=your_api_key_here +``` + +--- + +## 3. 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. + +```bash +crabbox warmup --provider upstash-box --upstash-box-runtime node --upstash-box-size small +``` + +You 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. + +```bash +crabbox run --provider upstash-box --env-from-profile .env -- pnpm test +``` + +You can use any package manager or test runner: + +```bash +# npm +crabbox run --provider upstash-box --env-from-profile .env -- npm test + +# bun +crabbox run --provider upstash-box --env-from-profile .env -- bun test +``` + +--- + +For the full list of commands and options, see the [Upstash Box provider reference](https://crabbox.sh/providers/upstash-box.html). diff --git a/docs.json b/docs.json index f707a5b42..a6f0bcc99 100644 --- a/docs.json +++ b/docs.json @@ -1654,7 +1654,7 @@ }, { "group": "Guides", - "pages": ["box/guides/remote-development", "box/guides/code-review-agent", "box/guides/openclaw-setup", "box/guides/hermes-setup"] + "pages": ["box/guides/remote-development", "box/guides/code-review-agent", "box/guides/openclaw-setup", "box/guides/hermes-setup", "box/guides/crabbox-setup"] } ] }, diff --git a/llms-full.txt b/llms-full.txt index e1ff9b910..274a7c5f4 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -854,6 +854,72 @@ if (result.verdict === "changes_requested") { This gives you an automated gate similar to CodeRabbit or Greptile, running inside an isolated, durable Box. +# Running Tests with Crabbox +Source: https://upstash.com/docs/box/guides/crabbox-setup + +[Crabbox](https://crabbox.sh) 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 + +```bash +brew install openclaw/tap/crabbox +``` + +*** + +## 2. Get Your API Key + +Go to the [Upstash Console](https://console.upstash.com) and create a Box API key. Then export it in your terminal: + +```bash +export UPSTASH_BOX_API_KEY=your_api_key_here +``` + +*** + +## 3. 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. + +```bash +crabbox warmup --provider upstash-box --upstash-box-runtime node --upstash-box-size small +``` + +You 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. + +```bash +crabbox run --provider upstash-box --env-from-profile .env -- pnpm test +``` + +You can use any package manager or test runner: + +```bash +# npm +crabbox run --provider upstash-box --env-from-profile .env -- npm test + +# bun +crabbox run --provider upstash-box --env-from-profile .env -- bun test +``` + +*** + +For the full list of commands and options, see the [Upstash Box provider reference](https://crabbox.sh/providers/upstash-box.html). + # Hermes Setup Source: https://upstash.com/docs/box/guides/hermes-setup diff --git a/llms.txt b/llms.txt index 963ba43c8..042188c0d 100644 --- a/llms.txt +++ b/llms.txt @@ -33,6 +33,7 @@ - [Get Index Stats](https://upstash.com/docs/api-reference/vector/get-index-stats.md): Retrieves statistics and metrics for a specific vector index - [Get Vector Stats](https://upstash.com/docs/api-reference/vector/get-vector-stats.md): Get vector statistics for all the vector indices associated with the authenticated user - [Build a Code Review Agent](https://upstash.com/docs/box/guides/code-review-agent.md) +- [Running Tests with Crabbox](https://upstash.com/docs/box/guides/crabbox-setup.md) - [Hermes Setup](https://upstash.com/docs/box/guides/hermes-setup.md) - [OpenClaw Setup](https://upstash.com/docs/box/guides/openclaw-setup.md) - [Remote Development](https://upstash.com/docs/box/guides/remote-development.md)