> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bead.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Portable CI jobs

> Run portable CI jobs with the bead CLI to execute bounded builds and tests while preserving the remote exit status.

Run portable CI jobs for bounded builds or tests from any CI provider with the bead CLI. `bead run` uploads source, executes the command, reports observed cost and requests machine deletion.

## Authenticate

Create a CI key from an authorized account:

```bash theme={null}
bead api-key create buildkite --preset ci --ttl 7d
```

Store the returned secret in your provider's secret store. The preset can create machines and access or delete only its own machines. It cannot access credential profiles, billing administration or other machines.

In your CI job:

```bash theme={null}
printf '%s' "$BEAD_CI_KEY" | bead login --key-stdin
bead run --from ci-4x8 --size medium --push . -- sh -lc 'cargo test'
```

Choose an available template with the tools your build needs. The example assumes `ci-4x8` is available to your account.

## Source and execution

`--push` selects the local checkout. The CLI uploads tracked and unignored Git files, with a 32 MiB compressed maximum. Materialize submodules explicitly. Commands run in `/root/repo`.

Arguments after `--` are literal argv. Use `sh -lc` for shell syntax. The default command timeout is 900 seconds; `--timeout` accepts 1–21600 seconds. A nonzero remote exit becomes the CLI exit status.

## Cleanup and limits

The CLI requests deletion on success, failure, timeout, SIGINT and SIGTERM. While active, it renews a 15-minute server deletion deadline. If the caller disappears, that deadline remains as a backstop. If deletion is unconfirmed, inspect the printed machine ID.

Normal prepaid credit and admission limits apply. Cost can lag final meter ingestion. Use [workload estimates](https://docs.bead.run/platform/estimates.md) before starting a job. Run `bead pricing` or call `GET /v1/pricing` for current rates.

For a persistent development workspace with artifact pulls, use [worktrees](https://docs.bead.run/worktrees/overview.md). For GitHub job assignment, use [GitHub Actions runners](https://docs.bead.run/ci/github-runners.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.