Installation
Install the Runnel SDK for TypeScript, Python or Go, the runnel CLI, and set the environment variables a worker needs.
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
npm install @runnel/sdk
# or: pnpm add @runnel/sdk, yarn add @runnel/sdk, bun add @runnel/sdkThe package ships its own types and the CLI, so npx runnel --version works straight away. It is ESM and CommonJS.
Python
pip install runnel
# or: uv add runnel, poetry add runnelThe 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.
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
go get github.example/runnel/runnel-go@v2.8.0client := 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:
brew install runnel/tap/runnel
# Linux and Windows: curl -fsSL https://runnel.example/install.sh | sh
runnel --version
# runnel 2.8.0Then 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. |
Note Under
runnel devnone of these are needed: the SDK detects the local server and uses it.
Check the installation
runnel whoami
# Signed in as maya@example.com · project acme-billing · environment developmentIf that works, continue with the Quickstart or Defining jobs.