# Installation

> Install the Runnel SDK for TypeScript, Python or Go, the runnel CLI, and set the environment variables a worker needs.

Source: https://galley.themes.dev/docs/getting-started/installation/

Runnel has an SDK for TypeScript, Python and Go, and a CLI that works with all three. Install the SDK in the project that defines your jobs. Install the CLI wherever you run `runnel dev` and `runnel deploy`, usually your laptop and your CI.

## Requirements

| SDK | Package | Runtime |
|---|---|---|
| TypeScript | `@runnel/sdk` | Node 18 or later, Bun 1.1, Deno 2 |
| Python | `runnel` | Python 3.10 or later |
| Go | `github.example/runnel/runnel-go` | Go 1.22 or later |

All three SDKs follow the same version numbers as Runnel itself. This documentation describes 2.8.

## Install the SDK

### TypeScript

```bash
npm install @runnel/sdk
# or: pnpm add @runnel/sdk, yarn add @runnel/sdk, bun add @runnel/sdk
```

The package ships its own types and the CLI, so `npx runnel --version` works straight away. It is ESM and CommonJS.

### Python

```bash
pip install runnel
# or: uv add runnel, poetry add runnel
```

The Python SDK is async-first and works with any asyncio application. Synchronous functions are run in a thread pool, so you can decorate them as well.

```python title="jobs.py"
from runnel import Runnel, Retries

runnel = Runnel()

@runnel.job(name="send-welcome", retries=Retries(attempts=3))
async def send_welcome(payload: dict, ctx) -> dict:
    ctx.log.info("sending welcome email", email=payload["email"])
    return {"sent": True}
```

### Go

```bash
go get github.example/runnel/runnel-go@v2.8.0
```

```go title="jobs.go"
client := runnel.New() // reads RUNNEL_API_KEY

sendWelcome := runnel.NewJob("send-welcome",
	func(ctx runnel.Context, p Welcome) error {
		ctx.Log().Info("sending welcome email", "email", p.Email)
		return nil
	},
	runnel.WithRetries(3, runnel.Exponential),
)
```

## The CLI

The TypeScript SDK includes the CLI. For Python and Go projects, or to have `runnel` on your path everywhere, install it on its own:

```bash
brew install runnel/tap/runnel
# Linux and Windows: curl -fsSL https://runnel.example/install.sh | sh
runnel --version
# runnel 2.8.0
```

Then sign in once per machine with `runnel login`. In CI, skip the login and set `RUNNEL_API_KEY` instead.

## Environment variables

| Variable | Used by | Description |
|---|---|---|
| `RUNNEL_API_KEY` | SDK, CLI | A key for one environment, from **Settings › API keys**. `rk_dev_…` or `rk_live_…`. |
| `RUNNEL_ENV` | SDK, CLI | The environment name. Defaults to the key's environment. |
| `RUNNEL_URL` | SDK, CLI | Only for a self-hosted Runnel Server, such as `https://runnel.internal.example`. |
| `RUNNEL_WEBHOOK_SECRET` | your app | The signing secret of a webhook endpoint, if you receive [webhooks](/docs/reference/webhooks/). |

> **Note** Under `runnel dev` none of these are needed: the SDK detects the local server and uses it.

## Check the installation

```bash
runnel whoami
# Signed in as maya@example.com · project acme-billing · environment development
```

If that works, continue with the [Quickstart](/docs/getting-started/quickstart/) or [Defining jobs](/docs/guides/defining-jobs/).
