Dagger — Programmable CI/CD Engine
Run CI/CD pipelines as code — locally, in CI, or in the cloud. Replace YAML with real programming languages. Cacheable, portable, testable. 15.6K+ stars.
What it is
Dagger is a programmable CI/CD engine that replaces YAML-based pipeline configurations with real programming languages. You write pipelines in Python, Go, TypeScript, or any language with an SDK, and run them locally on your laptop, in any CI system, or in the cloud. Every step runs in a container with automatic caching.
DevOps engineers and platform teams frustrated with debugging YAML indentation and vendor-specific CI syntax use Dagger to bring software engineering practices (testing, modularity, type safety) to their build pipelines.
How it saves time or tokens
YAML-based CI systems (GitHub Actions, GitLab CI, Jenkins) are hard to test locally and impossible to debug without pushing to the CI server. Dagger pipelines run identically on your laptop and in CI, eliminating the push-and-pray debugging cycle. The built-in content-addressed cache means unchanged steps are skipped on subsequent runs.
Dagger functions are composable and shareable. Instead of copying YAML snippets between repositories, you publish reusable functions that other teams import with type-checked interfaces.
How to use
- Install the Dagger CLI:
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh
- Run a function from a module:
dagger -m github.com/dagger/dagger/dev/go call build --source=.
- Or use the Python SDK:
import dagger
import anyio
async def main():
async with dagger.Connection() as client:
out = await (
client.container()
.from_('python:3.12')
.with_exec(['python', '-c', 'print("hello")'])
.stdout()
)
print(out)
anyio.run(main)
Example
A Dagger pipeline that builds and tests a Go project:
import dagger
import anyio
async def ci():
async with dagger.Connection() as client:
src = client.host().directory('.')
golang = (
client.container()
.from_('golang:1.22')
.with_directory('/app', src)
.with_workdir('/app')
)
await golang.with_exec(['go', 'test', './...']).stdout()
await golang.with_exec(['go', 'build', '-o', 'app']).stdout()
anyio.run(ci)
Related on TokRepo
- DevOps Tools -- Infrastructure and deployment automation tools
- Automation Tools -- CI/CD and build pipeline tools
Common pitfalls
- Dagger requires a running Docker daemon. Rootless Docker works but needs explicit configuration for the Dagger engine socket.
- First-run cold cache is slow because every container layer must be pulled. Subsequent runs with the same dependencies are fast due to content-addressed caching.
- SDK version mismatches between the CLI and language SDK cause cryptic errors. Pin both to the same version in your project.
Frequently Asked Questions
Dagger has official SDKs for Python, Go, and TypeScript. The engine exposes a GraphQL API, so any language that can make GraphQL calls can theoretically drive Dagger pipelines. Community SDKs exist for other languages.
Yes. Dagger runs inside any CI system (GitHub Actions, GitLab CI, Jenkins, CircleCI) as a single CLI call. Your CI config becomes a thin wrapper that invokes `dagger call`, and the actual pipeline logic lives in your codebase as testable code.
Dagger uses content-addressed caching at the operation level. Each container step is cached by its inputs (base image, files, commands). If the inputs have not changed, the cached result is reused. This works identically locally and in CI.
A Dagger Module is a reusable package of functions that others can call. You publish modules to any Git repository and consumers import them by URL. Modules have typed interfaces, so callers get documentation and validation automatically.
No. Dagger uses Docker (or compatible container runtimes) under the hood. It replaces YAML-based CI configurations, not the container runtime itself. You still write Dockerfiles for your application images; Dagger orchestrates the build pipeline.
Citations (3)
- Dagger GitHub— Dagger is a programmable CI/CD engine with content-addressed caching
- Dagger Documentation— Dagger SDKs for Python, Go, and TypeScript
- Dagger Modules Docs— Dagger Modules for reusable CI/CD functions
Related on TokRepo
Source & Thanks
Created by Dagger. Licensed under Apache 2.0. dagger/dagger — 15,600+ GitHub stars
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.