ScriptsApr 7, 2026·2 min read

Dagger — CI/CD Pipelines as Code in Any Language

Run CI/CD pipelines locally and in the cloud with the same code. Write pipelines in TypeScript, Python, or Go instead of YAML. Containerized execution ensures identical results everywhere. 12,000+ stars.

AG
Agent Toolkit · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

# Install
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh

# Initialize in your project
dagger init --sdk=typescript
// dagger/src/index.ts
import { dag, Container, Directory, object, func } from "@dagger.io/dagger";

@object()
class MyPipeline {
  @func()
  async build(source: Directory): Promise<string> {
    return await dag
      .container()
      .from("node:22")
      .withDirectory("/app", source)
      .withWorkdir("/app")
      .withExec(["npm", "install"])
      .withExec(["npm", "run", "build"])
      .stdout();
  }

  @func()
  async test(source: Directory): Promise<string> {
    return await dag
      .container()
      .from("node:22")
      .withDirectory("/app", source)
      .withExec(["npm", "test"])
      .stdout();
  }
}
dagger call build --source=.
dagger call test --source=.

Intro

Dagger is a CI/CD engine that lets you write pipelines as code in TypeScript, Python, or Go instead of YAML with 12,000+ GitHub stars. Every step runs in a container, so pipelines produce identical results on your laptop and in CI. Debug locally before pushing — no more "works on my machine but fails in CI" problems. Best for teams tired of YAML-based CI and wanting testable, type-safe pipelines. Works with: GitHub Actions, GitLab CI, CircleCI, Jenkins, or standalone. Setup time: under 5 minutes.


Why Code Over YAML

YAML CI Dagger
Trial-and-error debugging Debug locally first
No type checking Full IDE support
Copy-paste reuse Functions and modules
Vendor lock-in Run anywhere
Different local vs CI Identical everywhere

Local = CI

# Same pipeline, same results
dagger call test --source=.     # On your laptop
dagger call test --source=.     # In GitHub Actions
# Containerized execution ensures identical behavior

Multi-Language SDKs

TypeScript:

@func()
async deploy(image: string): Promise<string> {
  return await dag.container().from(image).withExec(["deploy.sh"]).stdout();
}

Python:

@function
async def deploy(self, image: str) -> str:
    return await dag.container().from_(image).with_exec(["deploy.sh"]).stdout()

Go:

func (m *MyPipeline) Deploy(ctx context.Context, image string) (string, error) {
    return dag.Container().From(image).WithExec([]string{"deploy.sh"}).Stdout(ctx)
}

Caching

Built-in layer caching — unchanged steps skip instantly:

@func()
async build(source: Directory): Promise<Container> {
  return dag.container()
    .from("node:22")
    .withDirectory("/app", source)
    .withExec(["npm", "ci"])        // Cached if package-lock unchanged
    .withExec(["npm", "run", "build"]);
}

CI Integration

# .github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dagger/dagger-for-github@v6
        with:
          verb: call
          args: build --source=.

Key Stats

  • 12,000+ GitHub stars
  • TypeScript, Python, Go SDKs
  • Containerized execution
  • Local = CI (identical results)
  • Built-in caching

FAQ

Q: What is Dagger? A: A CI/CD engine where you write pipelines as code (TypeScript/Python/Go) instead of YAML, with containerized execution ensuring identical results locally and in CI.

Q: Is Dagger free? A: Yes, open-source under Apache 2.0. Dagger Cloud (caching service) has a free tier.

Q: Can I use Dagger with GitHub Actions? A: Yes, Dagger runs inside any CI system. It replaces the pipeline logic, not the CI runner.


🙏

Source & Thanks

Created by Dagger. Licensed under Apache 2.0.

dagger — stars 12,000+

Thanks for making CI/CD pipelines real code instead of YAML.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets