Skip to main content

CLI Reference

dagger

A tool to run CI/CD pipelines in containers, anywhere

Options

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

dagger call

Call one or more functions, interconnected into a pipeline

dagger call [options]

Options

  -j, --json            Present result as JSON
-m, --mod string Path to the module directory. Either local path or a remote git repo
-o, --output string Save the result to a local file or directory

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger config

Get or set module configuration

Synopsis

Get or set the configuration of a Dagger module. By default, print the configuration of the specified module.

dagger config [options]

Examples

dagger config -m /path/to/some/dir
dagger config -m github.com/dagger/hello-dagger

Options

      --json         output in JSON format
-m, --mod string Path to the module directory. Either local path or a remote git repo

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger develop

Prepare a local module for development

Synopsis

Ensure that a module's SDK is installed, configured, and all its files re-generated.

It has different uses in different contexts:

  • In a module without SDK: install an SDK and start an implementation
  • In a fresh checkout of a module repository: make sure IDE auto-complete is up-to-date
  • In a module with local dependencies: re-generate bindings for all dependencies
  • In a module after upgrading the engine: upgrade the target engine version, and check for breaking changes

This command is idempotent: you can run it at any time, any number of times. It will:

  1. Ensure that an SDK is installed
  2. Ensure that custom SDK configuration is applied
  3. Update the target engine version if needed
  4. Ensure that a module implementation exists, and create a starter template if not
  5. Generate the latest client bindings for the Dagger API and installed dependencies
dagger develop [options]

Options

      --compat string[="skip"]   Engine API version to target (default "latest")
--license string License identifier to generate. See https://spdx.org/licenses/ (default "Apache-2.0")
-m, --mod string Path to the module directory. Either local path or a remote git repo
--sdk string Install the given Dagger SDK. Can be builtin (go, python, typescript) or a module address
--source string Source directory used by the installed SDK. Defaults to module root

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger functions

List available functions

Synopsis

List available functions in a module.

This is similar to dagger call --help, but only focused on showing the available functions.

dagger functions [options] [function]...

Options

  -m, --mod string   Path to the module directory. Either local path or a remote git repo

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger init

Initialize a new module

Synopsis

Initialize a new module at the given path.

This creates a dagger.json file at the specified directory, making it the root of the new module.

If --sdk is specified, the given SDK is installed in the module. You can do this later with "dagger develop".

dagger init [options] [path]

Examples

dagger init --sdk=python

Options

      --license string   License identifier to generate. See https://spdx.org/licenses/ (default "Apache-2.0")
--name string Name of the new module (defaults to parent directory name)
--sdk string Optionally install a Dagger SDK
--source string Source directory used by the installed SDK. Defaults to module root

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger install

Install a dependency

Synopsis

Install another module as a dependency to the current module. The target module must be local.

dagger install [options] <module>

Examples

dagger install github.com/shykes/hello@v0.1.0

Options

  -m, --mod string    Path to the module directory. Either local path or a remote git repo
-n, --name string Name to use for the dependency in the module. Defaults to the name of the module being installed.

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger login

Log in to Dagger Cloud

dagger login [options] [org]

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger logout

Log out from Dagger Cloud

dagger logout

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger query

Send API queries to a dagger engine

Synopsis

Send API queries to a dagger engine.

When no document file is provided, reads query from standard input.

Can optionally provide the GraphQL operation name if there are multiple queries in the document.

dagger query [options] [operation]

Examples

dagger query <<EOF
{
container {
from(address:"hello-world") {
withExec(args:["/hello"]) {
stdout
}
}
}
}
EOF

Options

      --doc string        Read query from file (defaults to reading from stdin)
-m, --mod string Path to the module directory. Either local path or a remote git repo
--var strings List of query variables, in key=value format
--var-json string Query variables in JSON format (overrides --var)

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger run

Run a command in a Dagger session

Synopsis

Executes the specified command in a Dagger Session and displays live progress in a TUI.

DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN will be conveniently injected automatically.

For example:

jq -n '{query:"{container{id}}"}' | \
dagger run sh -c 'curl -s \
-u $DAGGER_SESSION_TOKEN: \
-H "content-type:application/json" \
-d @- \
http://127.0.0.1:$DAGGER_SESSION_PORT/query'
dagger run [options] <command>...

Examples

dagger run go run main.go
dagger run node index.mjs
dagger run python main.py

Options

      --cleanup-timeout duration   max duration to wait between SIGTERM and SIGKILL on interrupt (default 10s)
--focus Only show output for focused commands.

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere

dagger version

Print dagger version

dagger version

Options inherited from parent commands

  -d, --debug             Show debug logs and full verbosity
-i, --interactive Spawn a terminal on container exec failure
--progress string Progress output format (auto, plain, tty) (default "auto")
-q, --quiet count Reduce verbosity (show progress, but clean up at the end)
-s, --silent Do not show progress at all
-v, --verbose count Increase verbosity (use -vv or -vvv for more)
-w, --web Open trace URL in a web browser

SEE ALSO

  • dagger - A tool to run CI/CD pipelines in containers, anywhere