Dev shells
dagger shell opens a shell in any container that your workspace provides, such as a dev environment, a build container or the container that your tests run in. dagger check -i opens a shell in the exact state where a command failed. Your shell, your CI and your coding agents can share one environment.
Give it the name of a container, or a DAG link. With a DAG link, you can open a shell in a container from another workspace, for example a remote Git repository. Because checks use the same containers, you do not keep a separate dev environment the same as CI. To list the shells that you can open, run dagger shell -l.
You can also use dagger shell without interaction, for example in a script or from a coding agent:
-cruns one command, then stops.--copycopies a directory into the container before the command runs.--initruns a setup command before the shell starts.
This command was dagger terminal. Before 1.0, dagger shell started Dagger Shell, the bash-style language for pipelines. That language still works: use dagger -c '...', or run a script file with dagger <file>.
dagger shell -l # list the shells you can open
dagger shell <name> # open an interactive shell
dagger shell <name> -c 'go test ./...' # run one command
dagger shell <name> --copy /src=. --init 'cd /src && go mod download'