#What's the Difference Between "System Shell" and "Dagger CLI"?

1 messages · Page 1 of 1 (latest)

proper phoenix
#

While exploring the examples in the Dagger Cookbook, I noticed that each example provides multiple execution options: System Shell, Dagger Shell, and Dagger CLI.

I understand what the Dagger Shell does, but I'm unclear about the distinction between System Shell and Dagger CLI.

  • What exactly is the difference between the two?
  • When should you use one over the other, and why?

Any clarification would be appreciated!

golden schooner
#

"dagger shell" snippets can be pasted directly when you are running the dagger shell interactively

"system shell" snippets can be pasted directly into your system shell: it executes dagger then feeds the dagger shell snippet.

"dagger cli" is an alternative to dagger shell, which predates it. It uses dagger call and dagger core to execute functions directly without a shell interpreter.

Under the hood it's all the same API.

I recommend just ignoring the "dagger cli" snippet, it's a lower level syntax that is useful to know about for power users, but you can live without it.

proper phoenix
#

Ok thanks.

#

Du you have an example of where you would use the dagger cli instead of the system shell ?

golden schooner
# proper phoenix Du you have an example of where you would use the dagger cli instead of the syst...

the most common place is in the CI integrations. Since 99% of the time when your CI workflow calls Dagger, it calls a single function (no chaining). So the benefits of the shell syntax are limited.

For example our official Github Action wraps dagger call

But, you could also use dagger shell in CI and it would work fine.

A lot of it boils down to: dagger call existed first, so people who are used to it don't see a reason to change, since we support both anyway.

proper phoenix
#

What was the reason to implement another method for calling dagger functions in the first place ?

#

I'm just curious, trying to learn Dagger 🙂

lunar lark
proper phoenix
#

Thanks