dagger
БесплатноБез исполняемых скриптовНе проверенWrite CI/CD pipelines as code with Dagger — portable, cacheable, container-based pipelines that run locally and in any CI system. Use when someone asks to…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Dagger
Overview
Dagger lets you write CI/CD pipelines in TypeScript, Python, or Go instead of YAML. Pipelines run in containers, are fully cacheable, and work identically on your laptop and in GitHub Actions/GitLab CI/Jenkins. No more "works in CI but not locally" — test your entire pipeline before pushing.
When to Use
- Tired of debugging YAML-based CI configs by pushing commits
- Need to run the exact same pipeline locally and in CI
- Complex build pipelines that benefit from TypeScript/Python logic (conditionals, loops)
- Want container-level caching for build steps
- Multi-language monorepo where different projects need different pipelines
Instructions
Setup
# macOS / Linux with Homebrew
brew install dagger/tap/dagger
# Linux without Homebrew: download the release and verify its checksum first
VER=0.21.10
curl -fsSLO https://dl.dagger.io/dagger/releases/$VER/dagger_v${VER}_linux_amd64.tar.gz
curl -fsSL https://dl.dagger.io/dagger/releases/$VER/checksums.txt | grep linux_amd64 | sha256sum -c -
tar -xzf dagger_v${VER}_linux_amd64.tar.gz dagger && mv dagger ~/.local/bin/
dagger version
# Create a module in your project (code goes to .dagger/)
dagger init --sdk=typescript --name=ci
dagger functions # list what the module exposes
The CLI starts a Dagger Engine container on first use, so Docker (or another supported container runtime) must be running. Latest release checked: v0.21.10 (2026-09-30). Docs also describe a 1.0 beta line; the code below targets the 0.21 TypeScript SDK.
Basic Pipeline
// .dagger/src/index.ts - CI pipeline for a Node.js project
import { dag, Container, Directory, Secret, argument, check, object, func } from "@dagger.io/dagger";
@object()
export class Ci {
/** Base container with dependencies installed; the npm cache persists between runs. */
@func()
base(
@argument({ defaultPath: "/", ignore: ["node_modules", ".git", "dist"] })
source: Directory,
): Container {
return dag
.container()
.from("node:22-slim")
.withDirectory("/app", source)
.withWorkdir("/app")
.withMountedCache("/root/.npm", dag.cacheVolume("npm-cache"))
.withExec(["npm", "ci"]);
}
/** Lint, test and build; `dagger check` runs every @check function. */
@func()
@check()
async lint(
@argument({ defaultPath: "/", ignore: ["node_modules", ".git", "dist"] })
source: Directory,
): Promise<void> {
await this.base(source).withExec(["npm", "run", "lint"]).sync();
}
@func()
@check()
async test(
@argument({ defaultPath: "/", ignore: ["node_modules", ".git", "dist"] })
source: Directory,
): Promise<void> {
await this.base(source).withExec(["npm", "test"]).sync();
}
@func()
build(
@argument({ defaultPath: "/", ignore: ["node_modules", ".git", "dist"] })
source: Directory,
): Directory {
return this.base(source).withExec(["npm", "run", "build"]).directory("/app/dist");
}
/** Build and push a runtime image; returns the pushed reference. */
@func()
async publish(
@argument({ defaultPath: "/", ignore: ["node_modules", ".git", "dist"] })
source: Directory,
address: string,
): Promise<string> {
return dag
.container()
.from("node:22-slim")
.withDirectory("/app", this.build(source))
.withWorkdir("/app")
.withEntrypoint(["node", "index.js"])
.publish(address);
}
}
defaultPath: "/" makes the project root the default, so --source can be omitted. Functions with no required arguments marked @check() are what dagger check runs (check support is in the 0.21 SDK; see the quickstart if your engine is older).
Run Locally
dagger check # run every @check function (lint + test)
dagger check -l # list the checks
dagger call test # run one function
dagger call build export --path=./dist
dagger call publish --address=ghcr.io/acme-labs/storefront:1.4.2
Registry credentials for publish come from container.withRegistryAuth(address, username, secret); pass the token as a Secret argument, not a string.
Pipeline with Services (Database)
@func()
async integrationTest(
@argument({ defaultPath: "/", ignore: ["node_modules", ".git"] })
source: Directory,
): Promise<string> {
const db = dag
.container()
.from("postgres:16")
.withEnvVariable("POSTGRES_PASSWORD", "ci-only-password")
.withEnvVariable("POSTGRES_DB", "storefront_test")
.withExposedPort(5432)
.asService({ useEntrypoint: true }); // run the image's own entrypoint
return this.base(source)
.withServiceBinding("db", db) // reachable as host "db"
.withEnvVariable("DATABASE_URL", "postgresql://postgres:ci-only-password@db:5432/storefront_test")
.withExec(["npm", "run", "db:migrate"])
.withExec(["npm", "run", "test:integration"])
.stdout();
}
Secrets
// The Secret type keeps value
Установить dagger в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dagger?
Write CI/CD pipelines as code with Dagger — portable, cacheable, container-based pipelines that run locally and in any CI system. Use when someone asks to "write CI pipeline in TypeScript", "portable CI/CD", "run GitHub Actions locally", "Dagger pipeline", "CI as code", "containerized build pipeline", or "test my CI locally before pushing". Covers Dagger SDK (TypeScript/Python), pipeline composition, caching, secrets, and multi-stage builds.
Как установить скилл dagger?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dagger запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic