← 返回命令列表

Linux command

dagger 命令

网络

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Initialize

dagger init --sdk=[go|python|typescript]

Call

dagger call [function_name] --[arg]=[value]

Develop

dagger develop

Install

dagger install [github.com/owner/repo@version]

Open

dagger

Run

dagger run -- [go test ./...]

Query

dagger query < [query.graphql]

说明

dagger is a CLI for a portable build engine that executes pipelines as code rather than YAML. Each pipeline is expressed as a function in Go, Python, TypeScript, Java, PHP, or Elixir using the matching Dagger SDK. Functions take typed inputs (directories, secrets, services, primitives), describe a graph of containerized operations, and return typed outputs. The engine runs locally on Docker, Podman, or any OCI-compatible runtime, and identically inside any CI (GitHub Actions, GitLab CI, Jenkins, CircleCI, Azure Pipelines, Buildkite). Because every step is content-addressed and cached, repeated calls reuse prior results, making local iteration as fast as the CI run. dagger call is the primary entry point: it locates the module (defined by dagger.json), invokes the requested function with the provided flags, and streams the result. Modules can compose other modules from local paths or Git URLs, enabling reusable building blocks across projects and organizations.

参数

call
Invoke a function from the current module; arguments are passed as --flag=value pairs and outputs are streamed back.
init
Scaffold a new module in the current directory. Requires --sdk to choose the language.
develop
Regenerate code bindings after editing dagger.json or adding dependencies.
install
Add a module reference (local path or remote Git URL) as a dependency.
run
Execute an arbitrary command with a transient Dagger engine session, exposing the engine on DAGGER_SESSION_PORT.
query
Send raw GraphQL queries to the Dagger engine (read from a file or stdin).
login / logout
Authenticate against Dagger Cloud for pipeline traces and caching.
-m, --mod _REF_
Use a remote module instead of the local one (e.g. github.com/dagger/dagger/ci).
--progress _MODE_
Progress UI: auto, plain, or tty.
--silent
Suppress progress output entirely.
-v, --debug
Verbose / debug logging.

FAQ

What is the dagger command used for?

dagger is a CLI for a portable build engine that executes pipelines as code rather than YAML. Each pipeline is expressed as a function in Go, Python, TypeScript, Java, PHP, or Elixir using the matching Dagger SDK. Functions take typed inputs (directories, secrets, services, primitives), describe a graph of containerized operations, and return typed outputs. The engine runs locally on Docker, Podman, or any OCI-compatible runtime, and identically inside any CI (GitHub Actions, GitLab CI, Jenkins, CircleCI, Azure Pipelines, Buildkite). Because every step is content-addressed and cached, repeated calls reuse prior results, making local iteration as fast as the CI run. dagger call is the primary entry point: it locates the module (defined by dagger.json), invokes the requested function with the provided flags, and streams the result. Modules can compose other modules from local paths or Git URLs, enabling reusable building blocks across projects and organizations.

How do I run a basic dagger example?

Run `dagger init --sdk=[go|python|typescript]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does call do in dagger?

Invoke a function from the current module; arguments are passed as --flag=value pairs and outputs are streamed back.