Repository navigation
CLI 1.0: top-level command surface (design + implementation) - #13392
Conversation
The old --mod flag carried two unrelated meanings: "load a module for this invocation" (consumer) and "select a module to operate on" (author). This conflation is what caused PR #13226's deps/engine commands to be rolled back before merge. --load-module names the flag's actual job. Short form -m is preserved for muscle memory. The mutually-exclusive --no-mod/-M is also renamed to --no-load-module/-M. Authoring commands will be added under a separate dagger module group in a follow-up phase; they take no module-targeting flag (operate on the dagger.json in cwd). Part of the CLI 1.0 redesign — see future/cli-1.0.md (#13392). Changes: - cmd/dagger/module.go: rename in moduleAddFlags funnel + error message - cmd/dagger/shell.go: update comment referencing --no-mod - cmd/dagger/cloud_test.go: --mod -> --load-module in test args - cmd/dagger/workspace_test.go: Lookup("mod") -> Lookup("load-module") - core/integration/workspace_modules_test.go: update flag + error text - core/integration/module_call_test.go: update flag-conflict subtest to reflect that the global flag no longer collides with function args named "mod" - docs/current_docs/reference/cli/index.mdx: update help-text snippets
The old --mod flag carried two unrelated meanings: "load a module for this invocation" (consumer) and "select a module to operate on" (author). This conflation is what caused PR dagger#13226's deps/engine commands to be rolled back before merge. --load-module names the flag's actual job. Short form -m is preserved for muscle memory. The mutually-exclusive --no-mod/-M is also renamed to --no-load-module/-M. Authoring commands will be added under a separate dagger module group in a follow-up phase; they take no module-targeting flag (operate on the dagger.json in cwd). Part of the CLI 1.0 redesign — see future/cli-1.0.md (dagger#13392). Changes: - cmd/dagger/module.go: rename in moduleAddFlags funnel + error message - cmd/dagger/shell.go: update comment referencing --no-mod - cmd/dagger/cloud_test.go: --mod -> --load-module in test args - cmd/dagger/workspace_test.go: Lookup("mod") -> Lookup("load-module") - core/integration/workspace_modules_test.go: update flag + error text - core/integration/module_call_test.go: update flag-conflict subtest to reflect that the global flag no longer collides with function args named "mod" - docs/current_docs/reference/cli/index.mdx: update help-text snippets Signed-off-by: Solomon Hykes <[email protected]>
The old --mod flag carried two unrelated meanings: "load a module for this invocation" (consumer) and "select a module to operate on" (author). This conflation is what caused PR dagger#13226's deps/engine commands to be rolled back before merge. --load-module names the flag's actual job. Short form -m is preserved for muscle memory. The mutually-exclusive --no-mod/-M is also renamed to --no-load-module/-M. Authoring commands will be added under a separate dagger module group in a follow-up phase; they take no module-targeting flag (operate on the dagger.json in cwd). Part of the CLI 1.0 redesign — see future/cli-1.0.md (dagger#13392). Changes: - cmd/dagger/module.go: rename in moduleAddFlags funnel + error message - cmd/dagger/shell.go: update comment referencing --no-mod - cmd/dagger/cloud_test.go: --mod -> --load-module in test args - cmd/dagger/workspace_test.go: Lookup("mod") -> Lookup("load-module") - core/integration/workspace_modules_test.go: update flag + error text - core/integration/module_call_test.go: update flag-conflict subtest to reflect that the global flag no longer collides with function args named "mod" - docs/current_docs/reference/cli/index.mdx: update help-text snippets Signed-off-by: Solomon Hykes <[email protected]>
PR #13392 reworks the top-level CLI surface. Update the integration tests that invoke the renamed verbs so they exercise the new commands: - `dagger functions` -> `dagger api functions` (the daggerFunctions and moduleLoadingDaggerFunctions helpers plus the direct host/exec call sites in cacert, gitcredential, legacy, mcp, module_java, module_terminal, module_tui and module_up tests) - `dagger mod install|uninstall` -> top-level `dagger install|uninstall` - raw `dagger config` -> `dagger workspace config` (including the --env overlay reads/writes) The `dagger env {create,list,rm}` lifecycle group was removed (an env is now just an env.<name>.* prefix in workspace config), so drop the lifecycle test and document the replacement in the suite header. Signed-off-by: Yves Brissaud <[email protected]>
The old --mod flag carried two unrelated meanings: "load a module for this invocation" (consumer) and "select a module to operate on" (author). This conflation is what caused PR #13226's deps/engine commands to be rolled back before merge. --load-module names the flag's actual job. Short form -m is preserved for muscle memory. The mutually-exclusive --no-mod/-M is also renamed to --no-load-module/-M. Authoring commands will be added under a separate dagger module group in a follow-up phase; they take no module-targeting flag (operate on the dagger.json in cwd). Part of the CLI 1.0 redesign — see future/cli-1.0.md (#13392). Changes: - cmd/dagger/module.go: rename in moduleAddFlags funnel + error message - cmd/dagger/shell.go: update comment referencing --no-mod - cmd/dagger/cloud_test.go: --mod -> --load-module in test args - cmd/dagger/workspace_test.go: Lookup("mod") -> Lookup("load-module") - core/integration/workspace_modules_test.go: update flag + error text - core/integration/module_call_test.go: update flag-conflict subtest to reflect that the global flag no longer collides with function args named "mod" - docs/current_docs/reference/cli/index.mdx: update help-text snippets Signed-off-by: Solomon Hykes <[email protected]>
PR #13392 reworks the top-level CLI surface. Update the integration tests that invoke the renamed verbs so they exercise the new commands: - `dagger functions` -> `dagger api functions` (the daggerFunctions and moduleLoadingDaggerFunctions helpers plus the direct host/exec call sites in cacert, gitcredential, legacy, mcp, module_java, module_terminal, module_tui and module_up tests) - `dagger mod install|uninstall` -> top-level `dagger install|uninstall` - raw `dagger config` -> `dagger workspace config` (including the --env overlay reads/writes) The `dagger env {create,list,rm}` lifecycle group was removed (an env is now just an env.<name>.* prefix in workspace config), so drop the lifecycle test and document the replacement in the suite header. Signed-off-by: Yves Brissaud <[email protected]>
PR dagger#13392 reworked the top-level CLI surface, and commit acab805 migrated most integration tests to the renamed verbs. Two call sites in the engine suite were missed and still invoked removed top-level commands, so their withExec calls exited 1: - TestDaggerRun used `dagger run` -> now `dagger api exec` - TestDagqlCacheEntriesNoLeak used `dagger functions` -> now `dagger api functions` Update both (and the suite header comment) so they exercise the new commands. Signed-off-by: Quack <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
PR #13392 reworked the top-level CLI surface, and commit acab805 migrated most integration tests to the renamed verbs. Two call sites in the engine suite were missed and still invoked removed top-level commands, so their withExec calls exited 1: - TestDaggerRun used `dagger run` -> now `dagger api exec` - TestDagqlCacheEntriesNoLeak used `dagger functions` -> now `dagger api functions` Update both (and the suite header comment) so they exercise the new commands. Signed-off-by: Quack <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
|
Just to note some tests are skipped behind a todo until the corresponding code is implemented. $ rg "TODO\(api-client-init"
core/integration/client_generator_test.go
28: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
573: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
913: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
988: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1139: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1192: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1287: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1457: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1557: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1642: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1698: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1784: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
1971: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
2001: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install/list/uninstall/update' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>' (and top-level 'dagger run' -> 'dagger api run'); blocked on SDK initClient impls — see future/cli-1.0.md task #129")
core/integration/module_source_maps_test.go
113: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>'; blocked on SDK initClient impls — see future/cli-1.0.md task #129")
132: t.Skip("TODO(api-client-init #129): rewrite 'dagger client install' to 'dagger sdk install' + 'dagger api client init <sdk> <path> <module>'; blocked on SDK initClient impls — see future/cli-1.0.md task #129") |
|
We migrated the straightforward generated-client tests to the CLI 1.0 flow: Three legacy client-generator behaviors are still skipped because they need CLI 1.0 semantics before we can honestly migrate the tests:
|
There is no separate concept of a "generator", it's just a SDK (so a module) which may or may not implement client initialization. |
The old --mod flag carried two unrelated meanings: "load a module for this invocation" (consumer) and "select a module to operate on" (author). This conflation is what caused PR #13226's deps/engine commands to be rolled back before merge. --load-module names the flag's actual job. Short form -m is preserved for muscle memory. The mutually-exclusive --no-mod/-M is also renamed to --no-load-module/-M. Authoring commands will be added under a separate dagger module group in a follow-up phase; they take no module-targeting flag (operate on the dagger.json in cwd). Part of the CLI 1.0 redesign — see future/cli-1.0.md (#13392). Changes: - cmd/dagger/module.go: rename in moduleAddFlags funnel + error message - cmd/dagger/shell.go: update comment referencing --no-mod - cmd/dagger/cloud_test.go: --mod -> --load-module in test args - cmd/dagger/workspace_test.go: Lookup("mod") -> Lookup("load-module") - core/integration/workspace_modules_test.go: update flag + error text - core/integration/module_call_test.go: update flag-conflict subtest to reflect that the global flag no longer collides with function args named "mod" - docs/current_docs/reference/cli/index.mdx: update help-text snippets Signed-off-by: Solomon Hykes <[email protected]>
PR #13392 reworked the top-level CLI surface, and commit acab805 migrated most integration tests to the renamed verbs. Two call sites in the engine suite were missed and still invoked removed top-level commands, so their withExec calls exited 1: - TestDaggerRun used `dagger run` -> now `dagger api exec` - TestDagqlCacheEntriesNoLeak used `dagger functions` -> now `dagger api functions` Update both (and the suite header comment) so they exercise the new commands. Signed-off-by: Quack <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
The old --mod flag carried two unrelated meanings: "load a module for this invocation" (consumer) and "select a module to operate on" (author). This conflation is what caused PR #13226's deps/engine commands to be rolled back before merge. --load-module names the flag's actual job. Short form -m is preserved for muscle memory. The mutually-exclusive --no-mod/-M is also renamed to --no-load-module/-M. Authoring commands will be added under a separate dagger module group in a follow-up phase; they take no module-targeting flag (operate on the dagger.json in cwd). Part of the CLI 1.0 redesign — see future/cli-1.0.md (#13392). Changes: - cmd/dagger/module.go: rename in moduleAddFlags funnel + error message - cmd/dagger/shell.go: update comment referencing --no-mod - cmd/dagger/cloud_test.go: --mod -> --load-module in test args - cmd/dagger/workspace_test.go: Lookup("mod") -> Lookup("load-module") - core/integration/workspace_modules_test.go: update flag + error text - core/integration/module_call_test.go: update flag-conflict subtest to reflect that the global flag no longer collides with function args named "mod" - docs/current_docs/reference/cli/index.mdx: update help-text snippets Signed-off-by: Solomon Hykes <[email protected]>
a4716e1 to
1dc3e21
Compare
PR #13392 reworks the top-level CLI surface. Update the integration tests that invoke the renamed verbs so they exercise the new commands: - `dagger functions` -> `dagger api functions` (the daggerFunctions and moduleLoadingDaggerFunctions helpers plus the direct host/exec call sites in cacert, gitcredential, legacy, mcp, module_java, module_terminal, module_tui and module_up tests) - `dagger mod install|uninstall` -> top-level `dagger install|uninstall` - raw `dagger config` -> `dagger workspace config` (including the --env overlay reads/writes) The `dagger env {create,list,rm}` lifecycle group was removed (an env is now just an env.<name>.* prefix in workspace config), so drop the lifecycle test and document the replacement in the suite header. Signed-off-by: Yves Brissaud <[email protected]>
PR #13392 reworked the top-level CLI surface, and commit acab805 migrated most integration tests to the renamed verbs. Two call sites in the engine suite were missed and still invoked removed top-level commands, so their withExec calls exited 1: - TestDaggerRun used `dagger run` -> now `dagger api exec` - TestDagqlCacheEntriesNoLeak used `dagger functions` -> now `dagger api functions` Update both (and the suite header comment) so they exercise the new commands. Signed-off-by: Quack <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
8d6d9ad to
9e7344c
Compare
`Workspace.moduleInit` built the engine's changeset via
`generatedContextDirectory`, which runs a full SDK codegen pass and emits
the module config *plus* all the starter source and managed/generated
files (package.json, src/index.ts, tsconfig.json for TS; pyproject.toml,
.gitignore, .gitattributes, main.py, __init__.py for Python; main.go for
Go). The SDK's own `initModule` Changeset emits the same files, so the
merge failed with "path added in both changesets".
Per the CLI-1.0 contract the engine owns only the config files (the
workspace dagger.toml and the module dagger-module.toml); the SDK's
`initModule` owns everything else in the module directory. Switch the
init path from `generatedContextDirectory` to the existing
`updatedConfigDirectory` field, which writes byte-identical config
content but skips codegen. The engine changeset is now exactly
{dagger.toml, <path>/dagger-module.toml} and the SDK changeset owns the
rest, so the two are disjoint by construction and can never collide --
for every SDK, not just Go. This generalizes the per-file main.go skip
from dagger#13392 and drops the redundant codegen pass at init.
Signed-off-by: Yves Brissaud <[email protected]>
`Workspace.moduleInit` built the engine's changeset via
`generatedContextDirectory`, which runs a full SDK codegen pass and emits
the module config *plus* all the starter source and managed/generated
files (package.json, src/index.ts, tsconfig.json for TS; pyproject.toml,
.gitignore, .gitattributes, main.py, __init__.py for Python; main.go for
Go). The SDK's own `initModule` Changeset emits the same files, so the
merge failed with "path added in both changesets".
Per the CLI-1.0 contract the engine owns only the config files (the
workspace dagger.toml and the module dagger-module.toml); the SDK's
`initModule` owns everything else in the module directory. Switch the
init path from `generatedContextDirectory` to the existing
`updatedConfigDirectory` field, which writes byte-identical config
content but skips codegen. The engine changeset is now exactly
{dagger.toml, <path>/dagger-module.toml} and the SDK changeset owns the
rest, so the two are disjoint by construction and can never collide --
for every SDK, not just Go. This generalizes the per-file main.go skip
from #13392 and drops the redundant codegen pass at init.
Signed-off-by: Yves Brissaud <[email protected]>
efb6023 to
2cddbd3
Compare
Define the top-level command surface, runtime/SDK split, and shipped versus follow-up scope for the 1.0 CLI redesign. Keep the design record close to the implementation so reviewers can read the intent before the code. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Separate engine runtime config from SDK authoring state. Module config now carries runtime data; workspace config records SDK installs, aliases, authored modules, and generated clients under [modules.*.as-sdk]. Keep settings on the module entry so regular modules and SDKs share one settings namespace. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Co-authored-by: Guillaume de Rouville <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Make module and client init plan all workspace edits as Changesets instead of writing eagerly. The engine owns config bookkeeping and loads the installed SDK, resolves optional targetRuntime, and merges SDK-produced init changes. Also add JSON arg forwarding and cache invalidation for config-writing exports. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Co-authored-by: Guillaume de Rouville <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Add CurrentModule.asSDK so SDK code can enumerate the modules and clients it owns from workspace config. Gate the view to SDK installs and require the current module source to match the owning SDK entry. The API stays scoped to the SDK that is serving the request. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Co-authored-by: Guillaume de Rouville <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Skip default main.go scaffolding during module init because SDK init now returns starter files in its own Changeset. This keeps the engine-owned module config Changeset disjoint from the SDK-owned source-file Changeset. Co-authored-by: Yves Brissaud <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Hoist daily workspace/module verbs to the root, move advanced API access under dagger api, and keep workspace/cloud as focused toolboxes. Add dagger module, dagger sdk, and dagger setup as the new authoring, SDK management, and doctor lanes. Register SDK init commands from installed SDK capabilities and expose SDK-specific init args as typed flags. Remove the old mod, function, env, migrate, and raw config entry points while preserving hidden aliases where they still carry useful muscle memory. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Co-authored-by: Marcos Nils <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Update integration coverage to call the renamed root, API, and workspace verbs, and use SDK installs for module/client init flows. Refresh migration and client-generator assertions for the runtime/as-sdk config shape. Keep source-map fixtures as native workspaces so generated clients exercise the same path as users. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Co-authored-by: Quack <[email protected]> Co-authored-by: Guillaume de Rouville <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Refresh command examples and CLI/config reference for the new top-level verbs, setup migration flow, module runtime config, and SDK install/init shape. Leave generated API type pages and SDK bindings for the generated artifact commit. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Refresh generated SDK clients and API reference output for workspace client init, SDK config, runtime config, and CurrentModule.asSDK. Escape Javadoc descriptions before generated docs see placeholder-like schema text. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
Update CI, PHP SDK dev, release smoke tests, and TUI QA examples to use the shipped CLI 1.0 flows. The release smoke test now installs the Go SDK and scaffolds through dagger module init instead of relying on a prelaid fixture. Co-authored-by: Solomon Hykes <[email protected]> Co-authored-by: Yves Brissaud <[email protected]> Signed-off-by: Tibor Vass <[email protected]>
0b37276 to
7b78d49
Compare
|
I rewrote git history to simplify it, verified there is no change in diff. |
CLI 1.0
Two changes:
dagger mod install ...ordagger workspace install .... Justdagger install.dagger-module.tomlanddagger.tomlstop mixing up two different concepts — "what runs my module" (engine concern) and "what helps me author my module" (dev experience). They had a single field doing both jobs. Now they're separated.Design doc:
future/cli-1.0.md. It includes an accurate ✅ / 🟡 / ⬜ status legend over the full discrete-changes checklist.What
dagger --helplooks like (as shipped)Five visual groups, one job each:
The remaining design follow-ups (positional
dagger module init <sdk>reshape, the SDK contractinitModule/initClientcapability checks, default-SDK inference) are tracked as tasks #125–#129 in the design doc. See "Design direction, not yet implemented" below.What changed in commands
Daily commands are flat now
Before:
After:
dagger moduleis where you go to author a moduleThe
module sdkwrapper dispatches to whichever SDK authored the current module —python-sdkif you're in a Python module,go-sdkif you're in a Go one. You don't have to know.dagger apigathers everything that talks to the API directlydagger setupis the doctor commandThree steps, run together or separately:
dagger.jsonto the new workspace formatReplaces the old
dagger migrateanddagger recommend.Smaller surface changes
--modis now--load-module(the short-mstill works). The old name meant two different things — "load this module" and "edit this module" — depending on the command.dagger function call→dagger api call. Same forfunction list→api functions.dagger integrationmoved underdagger cloud integration {create, rm, list}.dagger workspace autocheck→dagger cloud check {on, off, list, status}.dagger activityis at the top level now (it's the "show me what's happening" verb).dagger api client init/listreplaces the old hiddendagger client install/uninstall/list/update. Client entries now live in workspace config under[[modules.<sdk>.as-sdk.clients]];dagger generateregenerates registered clients.What changed in the config files
The engine used to read one field —
sdk— and that single value had to answer two questions:In real life the answer to both is usually the same thing (the Go SDK runs your Go code AND helps you author it), but the questions are different. The new shape separates them.
dagger-module.toml— what the engine needsThat's it. No
sdkfield, noexperimentalflags, no per-module language-specific settings.Where the dropped fields moved:
sdkfieldpyproject.toml,go.mod,package.jsonexperimental.selfCallsdagger.toml— what's in your workspaceThis is the new picture. An SDK is just a module that happens to author other modules. Same install entry, same settings location, plus a sub-table that says "this one's an SDK; here's what it authors."
Reading the file, the rule is simple: anything under
[modules.*]is installed in this workspace. Theas-sdksub-table on a module entry is what marks it as an SDK and lists what it authors.This unifies a problem we didn't want: SDK settings live at
[modules.go-sdk.settings], same as any other module's settings.dagger settings go-sdk strict-build truejust works.dagger module initis atomic nowdagger module init my-thing --sdk=goused to do three steps:.dagger/modules/my-thing/dagger-module.tomlmy-thingto the workspace's installed modulesIf step 2 failed, step 1 already happened. You'd have go-sdk installed but no module. Annoying to clean up.
Now it's one engine call that returns a
Changeset. You see a preview of every file that will be created or modified, you confirm, and either all of it lands or none of it does. No half-done state.dagger sdk(shipped)SDK management as a first-class group:
dagger sdk install goresolvesgoagainst the embeddedsdks.jsonregistry, installsgithub.com/dagger/go-sdkas[modules.go](the workspace install name is the alias you typed, not the basename of the canonical ref), and stamps the empty[modules.go.as-sdk]table thatdagger module init/dagger api client initdispatch on. Genericdagger install <ref>does NOT mark anything as an SDK — the marker is opt-in via this verb.Engine:
Workspace.installgrew anasSdk: Boolean = falsearg. When true and the install is fresh, the entry is created with the empty marker; when the samename/sourceis already installed, the marker gets stamped onto the existing entry — so a plaindagger install go-sdkfollowed bydagger sdk install go-sdkupgrades it in place rather than erroring.dagger sdk uninstallruns a CLI-side refuse-if-authored check against the on-disk config (no session bootstrap to read TOML), then dispatches the regularWorkspace.uninstall.--forceoverrides; files on disk are left untouched, only the workspace entries go away.module-optionsandclient-optionsvalidate that the named install carries the as-sdk marker (so the user gets the useful "rundagger sdk install <sdk>first" hint when it's missing), but the typed-flag introspection itself is gated on the SDK contract — they print a clear "not yet wired" message rather than fabricating a flag list.Design direction, not yet implemented
A few pieces are in the design doc but not in the code yet. They land in follow-up PRs. Tracked as tasks #125–#129 in the design doc.
Positional SDK + typed SDK flags
Today:
dagger module init my-thing --sdk=go.--sdkis a flag. Per-SDK options pass through an--option K=Vfreeform mechanism that the engine persists indagger.tomlbut does not forward to the SDK at generation time — they are dead plumbing visible to the user.The follow-up flips it:
dagger module init go my-thing --go-version=1.22. SDK becomes a positional dispatch target. The CLI introspects the SDK'sinitModulefunction schema and surfaces SDK-specific args as typed flags.--go-versionis a real flag the SDK declares, not a freeform option.Same for
dagger api client init go ./lib/cli ./modules/api --package-name=@my-app/client.The
--optionflag dies. Typed SDK args replace it.SDK contract:
initModule/initClientSDKs gain two optional functions:
Presence is a capability flag, not just an optional fallback. If an SDK doesn't implement
initModule, thendagger module init <sdk>is unavailable for it — the CLI errors with"<sdk> does not support module init". Same forinitClientanddagger api client init <sdk>.targetRuntimeis the only one where absence is a sensible default (engine falls back to "the SDK ref IS the runtime ref").targetRuntimeintrospection is now wired.core.RuntimeTargetinterface added and surfaced viaSDK.AsRuntimeTarget(). When an SDK module exposestargetRuntime: String!on its main object, the engine calls it atdagger module inittime and writes the returned value into the new module'sdagger-module.toml [runtime] source. Self-hosting SDKs don't implement it; the engine falls back to the SDK's own installed ref. Fail-soft on every step — the override is opt-in, not load-bearing.So a module-only SDK (today's Go SDK) implements
initModulebut notinitClient. A hypothetical client-only SDK does the reverse. A full SDK does both.dagger sdk listsurfaces the capability matrix.When implemented, the engine merges the SDK's Changeset (additional language-specific files like
main.go,package.json, etc.) with its own (workspace bookkeeping).@generatefunctions can enumerate modules authored by that SDK (modules.<sdk>.as-sdk.modules) without scanning files or parsingdagger.toml.[runtime].pinthroughdagger-module.tomlmodule load/write/resolve for external runtimes, or remove/defer the field until it is honored. It is currently parsed but dropped beforecore.SDKConfig/runtime resolution.Default-SDK inference
When the workspace has exactly one installed SDK, the user could drop the
<sdk>positional:dagger module init my-thing. When multiple SDKs are installed, the user could declare adefault-sdkindagger.toml. Non-breaking; rules sketched in the design doc.SDK codegen regen across the 6 SDKs
The CLI calls
Workspace.moduleInit/clientInitvia raw GraphQL (dag.Do) today because the Go SDK binding still has the pre-Changeset signature. Collapses to typed calls once regenerated.Breaking changes
By design — 1.0 is the moment to clean this up.
Gone
dagger modgroupdagger function/fngroupdagger envtop-leveldagger integrationtop-leveldagger migratedagger workspace {init, migrate, install, uninstall, update, activity, autocheck}dagger checksaliasdagger confighidden aliasdagger recommend--mod/--no-modlong-form flagsdagger client install/uninstall/list/update(replaced bydagger api client init/list; client entries move to workspace config)Renamed
dagger function calldagger api calldagger function listdagger api functionsdagger execdagger api exec(run/raliases preserved under the new path)dagger workspace autocheckdagger cloud checkdagger integration setupdagger cloud integration create--mod/--no-mod--load-module/--no-load-module(-m/-Mstill work)Config files
dagger-module.tomlhas a[runtime]table instead of ansdkfield. Olddagger.jsonstill reads fine via the compat path;dagger setupmigrates it.[sdks.*]section that briefly existed during this PR's development was folded into[modules.*.as-sdk]. Migration writes the new shape directly.Schema
Workspace.moduleInitreturnsChangeset!instead ofString!. No callers in main; the Go SDK binding needs to regenerate before it's a typed call (the CLI currently calls it via raw GraphQL).Workspace.clientInitandWorkspace.clientGenerateare new.experimental.SELF_CALLSflag is still in the schema but the engine no longer looks at it.Migration warnings everywhere now point at
dagger setup.Reviewing
Discrete changes from current CLIsection has an explicit ✅ / 🟡 / ⬜ legend keyed against the actual code state.153d4bf0donward) is a standalone reviewable chunk.17733417f) is regenerated reference docs; the human-edited bits are 5 prose pages and 2 smallcmd/daggerfiles.