Modules
dagger init --sdk=<go|python|typescript>
Create a module in this directory
Writes dagger.json. Without --sdk, run dagger develop --sdk
later.
dagger init --name <name>
Name the module
dagger develop
Regenerate SDK code and bindings
Run after installing a dependency or upgrading the engine.
dagger install <module>
Add a module as dependency
Example: github.com/shykes/daggerverse/hello@v0.3.0
dagger install -n <name> <module>
Install under another name
dagger update <module>
Update a dependency
dagger uninstall <module>
Remove a dependency
dagger toolchain install <module>
Add a toolchain to the module
dagger toolchain list
List installed toolchains
dagger init --blueprint=<module>
Start from a blueprint module
dagger develop --recursive
Develop local dependencies too
dagger config
View or edit module config
Call functions
dagger functions
List the module's functions
dagger functions <fn>
List a function's sub-functions
dagger call <fn>
Run a function
dagger call <fn> --help
Show a function's arguments
dagger call <fn> --<arg> <value>
Pass an argument
Argument names are kebab-case versions of the code parameter
names.
dagger call <fn> <next-fn>
Chain functions
dagger call <fn> --source=.
Pass a local directory
A Directory argument accepts a local path or a git URL.
dagger call <fn> stdout
Print a container's output
dagger call <fn> -o <path>
Save the result to a file or directory
dagger call <fn> --json
Print result as JSON
dagger call <fn> terminal
Open a shell in the result container
dagger call <fn> export --path <path>
Export a File or Directory
dagger call -m <ref> <fn>
Call a module by path or git ref
Example: -m github.com/shykes/daggerverse/hello
dagger call -M <fn>
Do not load the current module
Shell and API
dagger
Open the interactive Dagger shell
Pipe-like syntax, such as container | from alpine | terminal.
dagger -c "<script>"
Run a Dagger shell script
dagger <file.dsh>
Run a Dagger shell file
dagger core container from <image>
Call the core API directly
dagger core --help
List core API objects
dagger query < <file.graphql>
Send a GraphQL query
dagger query --var <k>=<v>
Pass query variables
dagger run <command>
Run any program inside a Dagger session
Sets DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN for the
program.
Shell, call or run?
| Command |
Use for |
dagger call |
functions in a module |
dagger (shell) |
exploring, ad-hoc pipelines |
dagger run |
your own SDK script |
Output and debug
dagger call -i <fn>
Shell into a failing exec
Opens a terminal at the step that failed.
dagger call -v <fn>
More detail (-vv, -vvv for more)
dagger call -q <fn>
Less noise, keep progress
dagger call -s <fn>
Hide progress entirely
dagger call --progress=plain <fn>
Plain log output for CI
Others: auto, tty, dots, logs.
dagger call -w <fn>
Open the trace in a browser
dagger call -E <fn>
Keep the TUI open after finish
dagger call -d <fn>
Debug logs and full verbosity
dagger call -y <fn>
Auto-apply returned changesets
Changesets modify your local files, so review them first.
dagger login
Log in to Dagger Cloud
dagger logout
Log out of Dagger Cloud