Skip to content

1.0: better SDK UX #13912

Closed

Description

@shykes

Context

In 1.0-beta, you manage Dagger SDKs directly from the command line. They are modules under the hood, but they have extra capabilities, so the CLI exposes them both as regular modules, and also in special commands.

Installing a module as an SDK also writes to dagger.toml. It goes inside the module's own entry, in an as-sdk sub-table. The SDK name, the modules it claims, and the clients it generates all live in there.

Problem

The split between "SDK is a regular module" and "SDK has its own native commands" creates some confusion in the CLI. Specifically:

SDK name vs. module name

# Accept a "SDK name", translate to a different "regular module name" under the hood
$ dagger sdk install go

# Don't accept the SDK name. User must guess the regular module name on their own
$ dagger settings dagger-go-sdk

Round-trip of death

First-time users must survive a round-trip from dagger module ("why can't I do anything") to dagger sdk ("what is a SDK and how do I get one") back to dagger module ("how do I use my SDK").

Then later, another round-trip: dagger client -> dagger sdk -> dagger client

# 1. Why can't I do anything?
$ dagger module init --help
<WALL OF TEXT>
<NO AVAILABLE COMMAND>

# 2. What is a SDK and how do I get one
$ dagger sdk search
$ dagger sdk install FOO

# 3. How do I use my SDK
$ dagger module init FOO

dagger.toml: SDKs are hidden

There's a top-level table for modules, and one for environments. There's none for SDKs. To find out which SDKs a workspace has, you read every module entry and check for an as-sdk sub-table. The SDK name is a value, not a key, so it doesn't show up where names normally show up.

# A module. Is it an SDK? Keep reading.
[modules.dagger-go-sdk]
source = "github.com/dagger/go-sdk"

# ...110 lines later
[modules.dagger-go-sdk.as-sdk]
name = "go"

dagger.toml: death by array-of-tables

Each claimed path takes three lines: a [[...]] header, a path, and a blank line. In dagger/dagger that's 86 lines for 2 SDKs and 27 claimed modules — a third of the file, for what is really two lists of strings. And TOML won't let you re-open a table, so they can't sit next to the module they belong to. They end up in a pile at the bottom of the file.

[[modules.dagger-go-sdk.as-sdk.modules]]
path = "modules/alpine"

[[modules.dagger-go-sdk.as-sdk.modules]]
path = "modules/git-releaser"

[[modules.dagger-go-sdk.as-sdk.modules]]
path = "modules/wolfi"

# ...13 more

Solution

  1. Group all module operations under dagger module: no more round trips
  2. Harmonize SDK-managed modules and clients under the umbrella term "scopes"
  3. Simplify configuration model around scopes

Implementation

Activity

  1. added this to the v1.0.0 milestone on Aug 18, 2026
  2. added theissue type on Aug 18, 2026
  3. TomChv commented on Aug 18, 2026

    @TomChv
    Member

    Few questions

    1. dagger sdk <SDK> module remove

    So that means we also uninstall the module from the dagger.toml and remove the sources?
    Should we remove the module directory or only the generated files + dagger-module.toml? Technically there could be other files in the module's directory, specially if the module's source path is outside .dagger/modules.

    1. dagger sdk <SDK> client/module claimed

    Why not just -l?

    1. dagger sdk <SDK> module claimable

    Do we have a use case for that? I'm not sure I understand in which scenario this would be used.
    Except maybe after a dagger setup but the setup will already migrate the existing modules so I don't know if that make sense.

    1. dagger sdk <SDK> info

    What info exactly should we displayed? I understand the capabilities but should we also display the module description or something else?

  4. shykes commented on Aug 18, 2026

    @shykes
    ContributorAuthor
    1. dagger sdk <SDK> module remove

    So that means we also uninstall the module from the dagger.toml and remove the sources?

    Yes, it would:

    1. Unclaim (same as dagger sdk <SDK> unclaim)
    2. Uninstall (same as dagger uninstall)
    3. Remove the files (same as rm -fr)

    Should we remove the module directory or only the generated files + dagger-module.toml? Technically there could be other files in the module's directory, specially if the module's source path is outside .dagger/modules.

    I was assuming just remove the contents of the directory, but you're right that in some cases it would remove too much.

    For now I will just drop dagger sdk <SDK> remove

    1. dagger sdk <SDK> client/module claimed

    Why not just -l?

    More consistent with dagger install / dagger installed, and more precise since it distinguishes claimed modules from existing-but-unclaimed modules.

    1. dagger sdk <SDK> module claimable

    Do we have a use case for that? I'm not sure I understand in which scenario this would be used. Except maybe after a dagger setup but the setup will already migrate the existing modules so I don't know if that make sense.

    I actually had this problem. When we migrated this repo to 1.0, we forgot to claim .dagger/modules/go. So, dagger generate was silently failing to re-generate that module, since no SDK was managing it. I only discovered the issue by chance. dagger sdk <SDK> claimable would help surface that information.

    1. dagger sdk <SDK> info

    What info exactly should we displayed? I understand the capabilities but should we also display the module description or something else?

    I think for now, something like:

    $ dagger sdk go info
    sdk-name: go
    module-name: dagger-go-sdk
    module-source: github.com/dagger/go-sdk
    claimed-modules: 6

    Really the only information we really need right now, is the module name

  5. shykes commented on Aug 18, 2026

    @shykes
    ContributorAuthor

    @TomChv I'm starting to think you're right on dagger sdk <SDK> module list. More predictable. Maybe the "claimable" concept is overkill. If I'm in this situation I can just call list and check if everything is in there. Makes everything simpler.

  6. 5 remaining items

  7. marked 1.0: better SDK config #13944 as a duplicate of this issue on Aug 31, 2026
  8. marcosnils commented on Sep 3, 2026

    @marcosnils
    Contributor

    next steps are to add support for Go SDK and dang SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions