Repository navigation
[workspace] Workspaces: dagger mod commands - #13226
Conversation
|
Some local testing |
shykes
left a comment
There was a problem hiding this comment.
Looks great. Dropped a suggestion for fetching the index using go generate. Other than that - ship it 🚀
| Repo string `json:"repo"` | ||
| } | ||
|
|
||
| //go:embed modules.json |
There was a problem hiding this comment.
Should we add a go generate to fetch the latest index? Users would still need to update the CLI to get an updated index, but it would give give us training wheels for index distribution infra. Then we can switch to live updates in a future PR.
| //go:embed modules.json | |
| //go:embed modules.json | |
| //go:generate curl -LO https://dagger.io/stdlib/modules.json |
There was a problem hiding this comment.
I should have noted in the description, but I just had it embedded to try it out, but I think it should fetch from a remote url at runtime, not at build time. That way the index isn't tied in any way to the build version.
Now that its pushed I can have it fetch the raw github url and once its in dagger/dagger@main we can change that and maybe put our own cdn in front of the file too
There was a problem hiding this comment.
Went for a hybrid approach to avoid potential issues fetching from github. So it'll try to pull the json file from github, and if there's any errors we still embed the file and it uses that so that the user doesn't see an error. Happy to discuss alternative solutions here too
Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]>
Signed-off-by: kpenfound <[email protected]>
…le loading Signed-off-by: kpenfound <[email protected]>
Signed-off-by: kpenfound <[email protected]>
|
Added
|
Signed-off-by: kpenfound <[email protected]>
|
Rolled back the changes with |
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Yves Brissaud <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Yves Brissaud <[email protected]> Signed-off-by: Kyle Penfound <[email protected]>
* dagger mod subcommands for workspace and module development Workspace modules (.dagger/config.toml): - dagger mod install / uninstall / list, dagger mod search (registry fetched at runtime from GitHub with an embedded fallback), plus a top-level dagger uninstall and the Workspace.uninstall resolver. Module development (dagger.json): - dagger mod deps add / rm / list (ModuleSource dependency APIs) - dagger mod engine required / require / require-current (ModuleSource engine version) Generated SDK clients and docs are produced by a follow-up regenerate. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: kpenfound <[email protected]> * generate Signed-off-by: kpenfound <[email protected]> * use new updatedConfigDirectory api to update dagger.json without module loading Signed-off-by: kpenfound <[email protected]> * move deps add/rm to updatedConfigDirectory api Signed-off-by: kpenfound <[email protected]> * roll back deps and engine. Only use embedded modules.json Signed-off-by: kpenfound <[email protected]> --------- Signed-off-by: kpenfound <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Yves Brissaud <[email protected]> Signed-off-by: Kyle Penfound <[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
Moves dagger function call -> dagger api call (rename of var to apiCallCmd). Moves dagger function list -> dagger api functions (rename to plural noun, and var renamed to apiFunctionsCmd). Kills the dagger function/fn group entirely. Drops the hidden dagger functions top-level alias (funcListCmd). Keeps dagger call as a hidden top-level alias for dagger api call (via the preexisting callModCmd). Also adds the api group Long description with the teaching beat from the design doc: "Every Dagger command — check, up, generate, even install — ultimately runs against a GraphQL API served by the Dagger engine, combining Dagger's core types with schema extensions loaded from modules..." So dagger api --help now explains what the group is for, while the top-level mockup keeps the bare "(advanced)" tag for signal-and-skip. The singular dagger module authoring group (with deps/engine subcommands) was originally planned for this phase but is deferred. Restoring the deps/engine commands from PR #13226 requires re-porting the schema-side work (ModuleSource.updatedConfigDirectory and friends in core/schema/modulesource.go) which doesn't exist on main. That schema work will land alongside the deps/engine CLI commands in a later phase. Tests: - TestCosmeticCommandAliases rewritten to look up the call/functions commands under api instead of under function - TestHelpAliasesRespectHiddenAliases drops the function-group assertion - Validate-workspace-flag-policy assertion updated to use apiCallCmd
Adds the singular `dagger module` group at top-level, with `deps` and `engine` subcommands restored from PR #13226's pre-rollback state. The original work was rolled back because there was no clean home for it under the old `dagger mod` — adding it created the consumer/ author conflation. Phase 1 cleared the old `dagger mod`; this phase introduces the singular module group as the dedicated authoring lane. CLI surface: dagger module deps { add, rm, list } dagger module engine { require, require-current, require-latest, required } Both groups operate on the dagger-module.toml reachable from the current directory. Authoring commands take no module-targeting flag (--load-module from a higher scope is still honored via the existing helper, but the design's intended pattern is cd-first). Schema port (core/schema/modulesource.go): - ModuleSource.updatedConfigDirectory: writes dagger.json with any in-memory edits applied, returned as a diff. Does NOT run codegen and does NOT validate the engine version against the running engine, so a module can declare a requirement newer than the engine it's currently being edited on. Loading or serving such a module still fails at moduleSource.asModule — the gate only moves, it doesn't disappear. - loadModuleSourceConfig split into: - buildModuleConfig (does the build without validation) - loadModuleSourceConfig (wrapper that validates engine version) This lets updatedConfigDirectory persist a config without triggering the version gate, while existing load/serve paths still enforce it. SDK port: - sdk/go/dagger.gen.go gains the UpdatedConfigDirectory method on ModuleSource. Other SDKs (Python, TypeScript, etc.) are not regenerated here — they'll be picked up by the next full codegen pass. The CLI doesn't use them. Module init is still deferred — it depends on the SDK module interface work (sdks.json alias registry, --sdk auto-install, template convention) tracked in future/cli-1.0.md.
Implements the doctor verb. Three sequential steps, each independently
prompted with a yes/no question the user can skip:
Step 1: Cloud login
- If already logged in (cloudauth.GetCloudAuth succeeds), no-op.
- Otherwise: prompt; if accepted, invoke the same flow as
`dagger cloud login` (cloudauth.Login with auth gate).
Step 2: Workspace migration
- Build the migration via dag.CurrentWorkspace().Migrate().
- If the resulting changeset is empty, no-op.
- Otherwise: prompt; if accepted, apply via handleChangesetResponseAt
against the workspace export path (same routing the deleted
`dagger workspace migrate` used).
Step 3: Recommended modules
- Reactivates the recommend scan from PR #13226's pre-rollback state.
- Restored: Recommend []string field on registryModule, modules.json
already carried the patterns through Phase 1, plus the helpers
(runRecommend, recommendation, recommendExcludeDirs,
installedModuleNames) now in a new recommend.go.
- Skips modules already installed.
- Prompts with the table of matches; if accepted, installs each
recommended module via installWorkspaceModule.
Confirm prompt:
- --auto-apply (-y) accepts every step without prompting.
- Non-interactive (no TTY on stdin): default is to skip — the safer
default; users in CI explicitly pass --auto-apply if they want
setup to mutate state.
- Interactive: [Y/n] prompt; empty / y / yes accepts.
Bonus: brings back the small workspace export-path helpers
(currentWorkspaceExportPath, localWorkspaceAddressPath,
workspaceRootFromCwd) that were deleted with migrate.go in phase 3.
Now they live in setup.go since setup is their only caller.
Design doc updated:
- setup decision context entry expanded with the concrete shape.
- Discrete changes setup item marked done.
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]>
Moves dagger function call -> dagger api call (rename of var to apiCallCmd). Moves dagger function list -> dagger api functions (rename to plural noun, and var renamed to apiFunctionsCmd). Kills the dagger function/fn group entirely. Drops the hidden dagger functions top-level alias (funcListCmd). Keeps dagger call as a hidden top-level alias for dagger api call (via the preexisting callModCmd). Also adds the api group Long description with the teaching beat from the design doc: "Every Dagger command — check, up, generate, even install — ultimately runs against a GraphQL API served by the Dagger engine, combining Dagger's core types with schema extensions loaded from modules..." So dagger api --help now explains what the group is for, while the top-level mockup keeps the bare "(advanced)" tag for signal-and-skip. The singular dagger module authoring group (with deps/engine subcommands) was originally planned for this phase but is deferred. Restoring the deps/engine commands from PR dagger#13226 requires re-porting the schema-side work (ModuleSource.updatedConfigDirectory and friends in core/schema/modulesource.go) which doesn't exist on main. That schema work will land alongside the deps/engine CLI commands in a later phase. Tests: - TestCosmeticCommandAliases rewritten to look up the call/functions commands under api instead of under function - TestHelpAliasesRespectHiddenAliases drops the function-group assertion - Validate-workspace-flag-policy assertion updated to use apiCallCmd Signed-off-by: Solomon Hykes <[email protected]>
Adds the singular `dagger module` group at top-level, with `deps` and `engine` subcommands restored from PR dagger#13226's pre-rollback state. The original work was rolled back because there was no clean home for it under the old `dagger mod` — adding it created the consumer/ author conflation. Phase 1 cleared the old `dagger mod`; this phase introduces the singular module group as the dedicated authoring lane. CLI surface: dagger module deps { add, rm, list } dagger module engine { require, require-current, require-latest, required } Both groups operate on the dagger-module.toml reachable from the current directory. Authoring commands take no module-targeting flag (--load-module from a higher scope is still honored via the existing helper, but the design's intended pattern is cd-first). Schema port (core/schema/modulesource.go): - ModuleSource.updatedConfigDirectory: writes dagger.json with any in-memory edits applied, returned as a diff. Does NOT run codegen and does NOT validate the engine version against the running engine, so a module can declare a requirement newer than the engine it's currently being edited on. Loading or serving such a module still fails at moduleSource.asModule — the gate only moves, it doesn't disappear. - loadModuleSourceConfig split into: - buildModuleConfig (does the build without validation) - loadModuleSourceConfig (wrapper that validates engine version) This lets updatedConfigDirectory persist a config without triggering the version gate, while existing load/serve paths still enforce it. SDK port: - sdk/go/dagger.gen.go gains the UpdatedConfigDirectory method on ModuleSource. Other SDKs (Python, TypeScript, etc.) are not regenerated here — they'll be picked up by the next full codegen pass. The CLI doesn't use them. Module init is still deferred — it depends on the SDK module interface work (sdks.json alias registry, --sdk auto-install, template convention) tracked in future/cli-1.0.md. Signed-off-by: Solomon Hykes <[email protected]>
Implements the doctor verb. Three sequential steps, each independently
prompted with a yes/no question the user can skip:
Step 1: Cloud login
- If already logged in (cloudauth.GetCloudAuth succeeds), no-op.
- Otherwise: prompt; if accepted, invoke the same flow as
`dagger cloud login` (cloudauth.Login with auth gate).
Step 2: Workspace migration
- Build the migration via dag.CurrentWorkspace().Migrate().
- If the resulting changeset is empty, no-op.
- Otherwise: prompt; if accepted, apply via handleChangesetResponseAt
against the workspace export path (same routing the deleted
`dagger workspace migrate` used).
Step 3: Recommended modules
- Reactivates the recommend scan from PR dagger#13226's pre-rollback state.
- Restored: Recommend []string field on registryModule, modules.json
already carried the patterns through Phase 1, plus the helpers
(runRecommend, recommendation, recommendExcludeDirs,
installedModuleNames) now in a new recommend.go.
- Skips modules already installed.
- Prompts with the table of matches; if accepted, installs each
recommended module via installWorkspaceModule.
Confirm prompt:
- --auto-apply (-y) accepts every step without prompting.
- Non-interactive (no TTY on stdin): default is to skip — the safer
default; users in CI explicitly pass --auto-apply if they want
setup to mutate state.
- Interactive: [Y/n] prompt; empty / y / yes accepts.
Bonus: brings back the small workspace export-path helpers
(currentWorkspaceExportPath, localWorkspaceAddressPath,
workspaceRootFromCwd) that were deleted with migrate.go in phase 3.
Now they live in setup.go since setup is their only caller.
Design doc updated:
- setup decision context entry expanded with the concrete shape.
- Discrete changes setup item marked done.
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]>
Moves dagger function call -> dagger api call (rename of var to apiCallCmd). Moves dagger function list -> dagger api functions (rename to plural noun, and var renamed to apiFunctionsCmd). Kills the dagger function/fn group entirely. Drops the hidden dagger functions top-level alias (funcListCmd). Keeps dagger call as a hidden top-level alias for dagger api call (via the preexisting callModCmd). Also adds the api group Long description with the teaching beat from the design doc: "Every Dagger command — check, up, generate, even install — ultimately runs against a GraphQL API served by the Dagger engine, combining Dagger's core types with schema extensions loaded from modules..." So dagger api --help now explains what the group is for, while the top-level mockup keeps the bare "(advanced)" tag for signal-and-skip. The singular dagger module authoring group (with deps/engine subcommands) was originally planned for this phase but is deferred. Restoring the deps/engine commands from PR dagger#13226 requires re-porting the schema-side work (ModuleSource.updatedConfigDirectory and friends in core/schema/modulesource.go) which doesn't exist on main. That schema work will land alongside the deps/engine CLI commands in a later phase. Tests: - TestCosmeticCommandAliases rewritten to look up the call/functions commands under api instead of under function - TestHelpAliasesRespectHiddenAliases drops the function-group assertion - Validate-workspace-flag-policy assertion updated to use apiCallCmd Signed-off-by: Solomon Hykes <[email protected]>
Adds the singular `dagger module` group at top-level, with `deps` and `engine` subcommands restored from PR dagger#13226's pre-rollback state. The original work was rolled back because there was no clean home for it under the old `dagger mod` — adding it created the consumer/ author conflation. Phase 1 cleared the old `dagger mod`; this phase introduces the singular module group as the dedicated authoring lane. CLI surface: dagger module deps { add, rm, list } dagger module engine { require, require-current, require-latest, required } Both groups operate on the dagger-module.toml reachable from the current directory. Authoring commands take no module-targeting flag (--load-module from a higher scope is still honored via the existing helper, but the design's intended pattern is cd-first). Schema port (core/schema/modulesource.go): - ModuleSource.updatedConfigDirectory: writes dagger.json with any in-memory edits applied, returned as a diff. Does NOT run codegen and does NOT validate the engine version against the running engine, so a module can declare a requirement newer than the engine it's currently being edited on. Loading or serving such a module still fails at moduleSource.asModule — the gate only moves, it doesn't disappear. - loadModuleSourceConfig split into: - buildModuleConfig (does the build without validation) - loadModuleSourceConfig (wrapper that validates engine version) This lets updatedConfigDirectory persist a config without triggering the version gate, while existing load/serve paths still enforce it. SDK port: - sdk/go/dagger.gen.go gains the UpdatedConfigDirectory method on ModuleSource. Other SDKs (Python, TypeScript, etc.) are not regenerated here — they'll be picked up by the next full codegen pass. The CLI doesn't use them. Module init is still deferred — it depends on the SDK module interface work (sdks.json alias registry, --sdk auto-install, template convention) tracked in future/cli-1.0.md. Signed-off-by: Solomon Hykes <[email protected]>
Implements the doctor verb. Three sequential steps, each independently
prompted with a yes/no question the user can skip:
Step 1: Cloud login
- If already logged in (cloudauth.GetCloudAuth succeeds), no-op.
- Otherwise: prompt; if accepted, invoke the same flow as
`dagger cloud login` (cloudauth.Login with auth gate).
Step 2: Workspace migration
- Build the migration via dag.CurrentWorkspace().Migrate().
- If the resulting changeset is empty, no-op.
- Otherwise: prompt; if accepted, apply via handleChangesetResponseAt
against the workspace export path (same routing the deleted
`dagger workspace migrate` used).
Step 3: Recommended modules
- Reactivates the recommend scan from PR dagger#13226's pre-rollback state.
- Restored: Recommend []string field on registryModule, modules.json
already carried the patterns through Phase 1, plus the helpers
(runRecommend, recommendation, recommendExcludeDirs,
installedModuleNames) now in a new recommend.go.
- Skips modules already installed.
- Prompts with the table of matches; if accepted, installs each
recommended module via installWorkspaceModule.
Confirm prompt:
- --auto-apply (-y) accepts every step without prompting.
- Non-interactive (no TTY on stdin): default is to skip — the safer
default; users in CI explicitly pass --auto-apply if they want
setup to mutate state.
- Interactive: [Y/n] prompt; empty / y / yes accepts.
Bonus: brings back the small workspace export-path helpers
(currentWorkspaceExportPath, localWorkspaceAddressPath,
workspaceRootFromCwd) that were deleted with migrate.go in phase 3.
Now they live in setup.go since setup is their only caller.
Design doc updated:
- setup decision context entry expanded with the concrete shape.
- Discrete changes setup item marked done.
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 #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]>
Moves dagger function call -> dagger api call (rename of var to apiCallCmd). Moves dagger function list -> dagger api functions (rename to plural noun, and var renamed to apiFunctionsCmd). Kills the dagger function/fn group entirely. Drops the hidden dagger functions top-level alias (funcListCmd). Keeps dagger call as a hidden top-level alias for dagger api call (via the preexisting callModCmd). Also adds the api group Long description with the teaching beat from the design doc: "Every Dagger command — check, up, generate, even install — ultimately runs against a GraphQL API served by the Dagger engine, combining Dagger's core types with schema extensions loaded from modules..." So dagger api --help now explains what the group is for, while the top-level mockup keeps the bare "(advanced)" tag for signal-and-skip. The singular dagger module authoring group (with deps/engine subcommands) was originally planned for this phase but is deferred. Restoring the deps/engine commands from PR #13226 requires re-porting the schema-side work (ModuleSource.updatedConfigDirectory and friends in core/schema/modulesource.go) which doesn't exist on main. That schema work will land alongside the deps/engine CLI commands in a later phase. Tests: - TestCosmeticCommandAliases rewritten to look up the call/functions commands under api instead of under function - TestHelpAliasesRespectHiddenAliases drops the function-group assertion - Validate-workspace-flag-policy assertion updated to use apiCallCmd Signed-off-by: Solomon Hykes <[email protected]>
Adds the singular `dagger module` group at top-level, with `deps` and `engine` subcommands restored from PR #13226's pre-rollback state. The original work was rolled back because there was no clean home for it under the old `dagger mod` — adding it created the consumer/ author conflation. Phase 1 cleared the old `dagger mod`; this phase introduces the singular module group as the dedicated authoring lane. CLI surface: dagger module deps { add, rm, list } dagger module engine { require, require-current, require-latest, required } Both groups operate on the dagger-module.toml reachable from the current directory. Authoring commands take no module-targeting flag (--load-module from a higher scope is still honored via the existing helper, but the design's intended pattern is cd-first). Schema port (core/schema/modulesource.go): - ModuleSource.updatedConfigDirectory: writes dagger.json with any in-memory edits applied, returned as a diff. Does NOT run codegen and does NOT validate the engine version against the running engine, so a module can declare a requirement newer than the engine it's currently being edited on. Loading or serving such a module still fails at moduleSource.asModule — the gate only moves, it doesn't disappear. - loadModuleSourceConfig split into: - buildModuleConfig (does the build without validation) - loadModuleSourceConfig (wrapper that validates engine version) This lets updatedConfigDirectory persist a config without triggering the version gate, while existing load/serve paths still enforce it. SDK port: - sdk/go/dagger.gen.go gains the UpdatedConfigDirectory method on ModuleSource. Other SDKs (Python, TypeScript, etc.) are not regenerated here — they'll be picked up by the next full codegen pass. The CLI doesn't use them. Module init is still deferred — it depends on the SDK module interface work (sdks.json alias registry, --sdk auto-install, template convention) tracked in future/cli-1.0.md. Signed-off-by: Solomon Hykes <[email protected]>
Implements the doctor verb. Three sequential steps, each independently
prompted with a yes/no question the user can skip:
Step 1: Cloud login
- If already logged in (cloudauth.GetCloudAuth succeeds), no-op.
- Otherwise: prompt; if accepted, invoke the same flow as
`dagger cloud login` (cloudauth.Login with auth gate).
Step 2: Workspace migration
- Build the migration via dag.CurrentWorkspace().Migrate().
- If the resulting changeset is empty, no-op.
- Otherwise: prompt; if accepted, apply via handleChangesetResponseAt
against the workspace export path (same routing the deleted
`dagger workspace migrate` used).
Step 3: Recommended modules
- Reactivates the recommend scan from PR #13226's pre-rollback state.
- Restored: Recommend []string field on registryModule, modules.json
already carried the patterns through Phase 1, plus the helpers
(runRecommend, recommendation, recommendExcludeDirs,
installedModuleNames) now in a new recommend.go.
- Skips modules already installed.
- Prompts with the table of matches; if accepted, installs each
recommended module via installWorkspaceModule.
Confirm prompt:
- --auto-apply (-y) accepts every step without prompting.
- Non-interactive (no TTY on stdin): default is to skip — the safer
default; users in CI explicitly pass --auto-apply if they want
setup to mutate state.
- Interactive: [Y/n] prompt; empty / y / yes accepts.
Bonus: brings back the small workspace export-path helpers
(currentWorkspaceExportPath, localWorkspaceAddressPath,
workspaceRootFromCwd) that were deleted with migrate.go in phase 3.
Now they live in setup.go since setup is their only caller.
Design doc updated:
- setup decision context entry expanded with the concrete shape.
- Discrete changes setup item marked done.
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 #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]>
Moves dagger function call -> dagger api call (rename of var to apiCallCmd). Moves dagger function list -> dagger api functions (rename to plural noun, and var renamed to apiFunctionsCmd). Kills the dagger function/fn group entirely. Drops the hidden dagger functions top-level alias (funcListCmd). Keeps dagger call as a hidden top-level alias for dagger api call (via the preexisting callModCmd). Also adds the api group Long description with the teaching beat from the design doc: "Every Dagger command — check, up, generate, even install — ultimately runs against a GraphQL API served by the Dagger engine, combining Dagger's core types with schema extensions loaded from modules..." So dagger api --help now explains what the group is for, while the top-level mockup keeps the bare "(advanced)" tag for signal-and-skip. The singular dagger module authoring group (with deps/engine subcommands) was originally planned for this phase but is deferred. Restoring the deps/engine commands from PR #13226 requires re-porting the schema-side work (ModuleSource.updatedConfigDirectory and friends in core/schema/modulesource.go) which doesn't exist on main. That schema work will land alongside the deps/engine CLI commands in a later phase. Tests: - TestCosmeticCommandAliases rewritten to look up the call/functions commands under api instead of under function - TestHelpAliasesRespectHiddenAliases drops the function-group assertion - Validate-workspace-flag-policy assertion updated to use apiCallCmd Signed-off-by: Solomon Hykes <[email protected]>
Adds the singular `dagger module` group at top-level, with `deps` and `engine` subcommands restored from PR #13226's pre-rollback state. The original work was rolled back because there was no clean home for it under the old `dagger mod` — adding it created the consumer/ author conflation. Phase 1 cleared the old `dagger mod`; this phase introduces the singular module group as the dedicated authoring lane. CLI surface: dagger module deps { add, rm, list } dagger module engine { require, require-current, require-latest, required } Both groups operate on the dagger-module.toml reachable from the current directory. Authoring commands take no module-targeting flag (--load-module from a higher scope is still honored via the existing helper, but the design's intended pattern is cd-first). Schema port (core/schema/modulesource.go): - ModuleSource.updatedConfigDirectory: writes dagger.json with any in-memory edits applied, returned as a diff. Does NOT run codegen and does NOT validate the engine version against the running engine, so a module can declare a requirement newer than the engine it's currently being edited on. Loading or serving such a module still fails at moduleSource.asModule — the gate only moves, it doesn't disappear. - loadModuleSourceConfig split into: - buildModuleConfig (does the build without validation) - loadModuleSourceConfig (wrapper that validates engine version) This lets updatedConfigDirectory persist a config without triggering the version gate, while existing load/serve paths still enforce it. SDK port: - sdk/go/dagger.gen.go gains the UpdatedConfigDirectory method on ModuleSource. Other SDKs (Python, TypeScript, etc.) are not regenerated here — they'll be picked up by the next full codegen pass. The CLI doesn't use them. Module init is still deferred — it depends on the SDK module interface work (sdks.json alias registry, --sdk auto-install, template convention) tracked in future/cli-1.0.md. Signed-off-by: Solomon Hykes <[email protected]>
Implements the doctor verb. Three sequential steps, each independently
prompted with a yes/no question the user can skip:
Step 1: Cloud login
- If already logged in (cloudauth.GetCloudAuth succeeds), no-op.
- Otherwise: prompt; if accepted, invoke the same flow as
`dagger cloud login` (cloudauth.Login with auth gate).
Step 2: Workspace migration
- Build the migration via dag.CurrentWorkspace().Migrate().
- If the resulting changeset is empty, no-op.
- Otherwise: prompt; if accepted, apply via handleChangesetResponseAt
against the workspace export path (same routing the deleted
`dagger workspace migrate` used).
Step 3: Recommended modules
- Reactivates the recommend scan from PR #13226's pre-rollback state.
- Restored: Recommend []string field on registryModule, modules.json
already carried the patterns through Phase 1, plus the helpers
(runRecommend, recommendation, recommendExcludeDirs,
installedModuleNames) now in a new recommend.go.
- Skips modules already installed.
- Prompts with the table of matches; if accepted, installs each
recommended module via installWorkspaceModule.
Confirm prompt:
- --auto-apply (-y) accepts every step without prompting.
- Non-interactive (no TTY on stdin): default is to skip — the safer
default; users in CI explicitly pass --auto-apply if they want
setup to mutate state.
- Interactive: [Y/n] prompt; empty / y / yes accepts.
Bonus: brings back the small workspace export-path helpers
(currentWorkspaceExportPath, localWorkspaceAddressPath,
workspaceRootFromCwd) that were deleted with migrate.go in phase 3.
Now they live in setup.go since setup is their only caller.
Design doc updated:
- setup decision context entry expanded with the concrete shape.
- Discrete changes setup item marked done.
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 #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]>
Moves dagger function call -> dagger api call (rename of var to apiCallCmd). Moves dagger function list -> dagger api functions (rename to plural noun, and var renamed to apiFunctionsCmd). Kills the dagger function/fn group entirely. Drops the hidden dagger functions top-level alias (funcListCmd). Keeps dagger call as a hidden top-level alias for dagger api call (via the preexisting callModCmd). Also adds the api group Long description with the teaching beat from the design doc: "Every Dagger command — check, up, generate, even install — ultimately runs against a GraphQL API served by the Dagger engine, combining Dagger's core types with schema extensions loaded from modules..." So dagger api --help now explains what the group is for, while the top-level mockup keeps the bare "(advanced)" tag for signal-and-skip. The singular dagger module authoring group (with deps/engine subcommands) was originally planned for this phase but is deferred. Restoring the deps/engine commands from PR #13226 requires re-porting the schema-side work (ModuleSource.updatedConfigDirectory and friends in core/schema/modulesource.go) which doesn't exist on main. That schema work will land alongside the deps/engine CLI commands in a later phase. Tests: - TestCosmeticCommandAliases rewritten to look up the call/functions commands under api instead of under function - TestHelpAliasesRespectHiddenAliases drops the function-group assertion - Validate-workspace-flag-policy assertion updated to use apiCallCmd Signed-off-by: Solomon Hykes <[email protected]>
Adds the singular `dagger module` group at top-level, with `deps` and `engine` subcommands restored from PR #13226's pre-rollback state. The original work was rolled back because there was no clean home for it under the old `dagger mod` — adding it created the consumer/ author conflation. Phase 1 cleared the old `dagger mod`; this phase introduces the singular module group as the dedicated authoring lane. CLI surface: dagger module deps { add, rm, list } dagger module engine { require, require-current, require-latest, required } Both groups operate on the dagger-module.toml reachable from the current directory. Authoring commands take no module-targeting flag (--load-module from a higher scope is still honored via the existing helper, but the design's intended pattern is cd-first). Schema port (core/schema/modulesource.go): - ModuleSource.updatedConfigDirectory: writes dagger.json with any in-memory edits applied, returned as a diff. Does NOT run codegen and does NOT validate the engine version against the running engine, so a module can declare a requirement newer than the engine it's currently being edited on. Loading or serving such a module still fails at moduleSource.asModule — the gate only moves, it doesn't disappear. - loadModuleSourceConfig split into: - buildModuleConfig (does the build without validation) - loadModuleSourceConfig (wrapper that validates engine version) This lets updatedConfigDirectory persist a config without triggering the version gate, while existing load/serve paths still enforce it. SDK port: - sdk/go/dagger.gen.go gains the UpdatedConfigDirectory method on ModuleSource. Other SDKs (Python, TypeScript, etc.) are not regenerated here — they'll be picked up by the next full codegen pass. The CLI doesn't use them. Module init is still deferred — it depends on the SDK module interface work (sdks.json alias registry, --sdk auto-install, template convention) tracked in future/cli-1.0.md. Signed-off-by: Solomon Hykes <[email protected]>
Implements the doctor verb. Three sequential steps, each independently
prompted with a yes/no question the user can skip:
Step 1: Cloud login
- If already logged in (cloudauth.GetCloudAuth succeeds), no-op.
- Otherwise: prompt; if accepted, invoke the same flow as
`dagger cloud login` (cloudauth.Login with auth gate).
Step 2: Workspace migration
- Build the migration via dag.CurrentWorkspace().Migrate().
- If the resulting changeset is empty, no-op.
- Otherwise: prompt; if accepted, apply via handleChangesetResponseAt
against the workspace export path (same routing the deleted
`dagger workspace migrate` used).
Step 3: Recommended modules
- Reactivates the recommend scan from PR #13226's pre-rollback state.
- Restored: Recommend []string field on registryModule, modules.json
already carried the patterns through Phase 1, plus the helpers
(runRecommend, recommendation, recommendExcludeDirs,
installedModuleNames) now in a new recommend.go.
- Skips modules already installed.
- Prompts with the table of matches; if accepted, installs each
recommended module via installWorkspaceModule.
Confirm prompt:
- --auto-apply (-y) accepts every step without prompting.
- Non-interactive (no TTY on stdin): default is to skip — the safer
default; users in CI explicitly pass --auto-apply if they want
setup to mutate state.
- Interactive: [Y/n] prompt; empty / y / yes accepts.
Bonus: brings back the small workspace export-path helpers
(currentWorkspaceExportPath, localWorkspaceAddressPath,
workspaceRootFromCwd) that were deleted with migrate.go in phase 3.
Now they live in setup.go since setup is their only caller.
Design doc updated:
- setup decision context entry expanded with the concrete shape.
- Discrete changes setup item marked done.
Signed-off-by: Solomon Hykes <[email protected]>

Adds a
dagger modcommand group for working with modules in your workspace, plus a top-leveldagger uninstall.Commands
dagger mod install— install a module (alias fordagger install)dagger mod uninstall/dagger uninstall— remove a module from the workspacedagger mod list— list installed modules (name, source, entrypoint)dagger mod search [query]— search a curated registry by name/descriptionUninstall adds a new
Workspace.uninstallresolver (mirrorsWorkspace.install). Search is backed by an embeddedcmd/dagger/modules.json(name/description/repo) behind a loader seam, so it can fetch remotely later.