Skip to content

CLI 1.0: top-level command surface (design + implementation) - #13392

Merged
tiborvass merged 10 commits into
mainfrom
design/cli-1.0
Jun 20, 2026
Merged

tiborvass merged 10 commits into
mainfrom
design/cli-1.0

Conversation

@shykes

@shykes shykes commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

CLI 1.0

Two changes:

  1. The commands you type every day are at the top level. No more dagger mod install ... or dagger workspace install .... Just dagger install.
  2. dagger-module.toml and dagger.toml stop 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 --help looks like (as shipped)

AVAILABLE COMMANDS
  setup           Ensure Dagger is properly set up and operational in the workspace

  activity        Show recent activity (runs, traces, etc.) for this workspace
  check           Verify your project — tests, linters, type checks, etc.
  generate        Generate derived files for your project — code, SDKs, types, etc.
  up              Run your project's services for local development — DBs, APIs, etc.

  install         Install a module into your workspace
  installed       List installed modules
  search          Search for modules you can install
  settings        Get or set module settings (use --env for an env overlay)
  uninstall       Uninstall a module from your workspace
  update          Refresh installed-module state

  api             Interact with the Dagger API (advanced)
  cloud           Manage Dagger Cloud
  module          Author a module: edit dependencies, engine version, etc.
  sdk             Install and manage SDKs (the modules that author other modules)
  workspace, ws   Inspect or configure your workspace

  help            Help about any command
  version         Print dagger version

Five visual groups, one job each:

Group What it's for
Setup The first thing you run in a new project
Daily flow What you run all day: check, generate, up, activity
Workspace Add/remove/list/update modules you depend on
Toolboxes Advanced: api, cloud, module, sdk, workspace
Utility help, version

The remaining design follow-ups (positional dagger module init <sdk> reshape, the SDK contract initModule / initClient capability 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:

dagger workspace install github.com/foo/bar
dagger mod search redis
dagger workspace update
dagger mod settings my-module python-version=3.13

After:

dagger install github.com/foo/bar
dagger search redis
dagger update
dagger settings my-module python-version=3.13

dagger module is where you go to author a module

dagger module init my-thing --sdk=go        # scaffold a new module
dagger module deps add github.com/dep/foo   # add a dependency
dagger module engine require-latest         # bump engine version
dagger module sdk python-version 3.13       # run the SDK's own commands

The module sdk wrapper dispatches to whichever SDK authored the current module — python-sdk if you're in a Python module, go-sdk if you're in a Go one. You don't have to know.

dagger api gathers everything that talks to the API directly

dagger api query '{...}'                     # raw GraphQL
dagger api call <function> [args]            # typed function call
dagger api functions                         # list functions
dagger api client init --sdk=<sdk> ...       # register a typed client (new)
dagger api client list                       # list registered clients

dagger setup is the doctor command

Three steps, run together or separately:

  1. Log in to Cloud (if you aren't already)
  2. Migrate a legacy dagger.json to the new workspace format
  3. Suggest modules to install based on what files are in your project

Replaces the old dagger migrate and dagger recommend.

Smaller surface changes

  • --mod is now --load-module (the short -m still 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 for function list → api functions.
  • dagger integration moved under dagger cloud integration {create, rm, list}.
  • dagger workspace autocheck → dagger cloud check {on, off, list, status}.
  • dagger activity is at the top level now (it's the "show me what's happening" verb).
  • dagger api client init / list replaces the old hidden dagger client install/uninstall/list/update. Client entries now live in workspace config under [[modules.<sdk>.as-sdk.clients]]; dagger generate regenerates 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:

  1. "What runs this module?" (engine question)
  2. "What helps me author this module?" (dev experience question)

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 needs

name = "api"
engineVersion = "v1.0.0"

[runtime]
source = "go"                  # builtin name OR a module ref like "github.com/dagger/go-sdk"
pin    = "sha256:..."          # optional; pins the runtime to a specific version

[[dependencies]]
source = "github.com/dagger/wolfi"
pin    = "sha256:..."

That's it. No sdk field, no experimental flags, no per-module language-specific settings.

Where the dropped fields moved:

Was Now
sdk field Workspace config (see below) — dev-experience concern, not engine concern
Python version, Go version, etc. Whatever file the SDK already uses: pyproject.toml, go.mod, package.json
experimental.selfCalls Dropped. The engine figures out self-calls support from whether the runtime knows how to load types. No per-module flag needed.

dagger.toml — what's in your workspace

This 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."

# A regular installed module
[modules.dagger-cloud]
source = "github.com/dagger/[email protected]"

# An SDK install. Looks like any other module install — except for the as-sdk
# sub-table below, which says "this one authors stuff in this workspace."
[modules.go-sdk]
source = "github.com/dagger/[email protected]"

[modules.go-sdk.settings]
strict-build = true

# These are the modules go-sdk authors here.
[[modules.go-sdk.as-sdk.modules]]
path = ".dagger/modules/api"

# These are the typed clients go-sdk generated here.
[[modules.go-sdk.as-sdk.clients]]
path = "./lib/dagger-client"
module = ".dagger/modules/api"

# This is the actual install entry for the module that go-sdk authored.
# (It gets one whether or not it lives under go-sdk's authoring list — install
# and author are tracked separately.)
[modules.api]
source = ".dagger/modules/api"

Reading the file, the rule is simple: anything under [modules.*] is installed in this workspace. The as-sdk sub-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 true just works.

dagger module init is atomic now

dagger module init my-thing --sdk=go used to do three steps:

  1. Install go-sdk into the workspace
  2. Write .dagger/modules/my-thing/dagger-module.toml
  3. Add my-thing to the workspace's installed modules

If 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.

extend type Workspace {
  moduleInit(name: String!, sdk: String!, path: String): Changeset!
  clientInit(path: String!, sdk: String!, module: String!, options: [SdkOption!]): Changeset!
}

dagger sdk (shipped)

SDK management as a first-class group:

dagger sdk install go            # alias-resolved via sdks.json; writes [modules.go.as-sdk] marker
dagger sdk uninstall go          # refuses if anything's authored under it (--force overrides)
dagger sdk list                  # installs that carry the as-sdk marker
dagger sdk search [query]        # registry of known SDKs (separate from `dagger search`)
dagger sdk module-options go     # 🟡 wired but gated on the SDK contract (task #129)
dagger sdk client-options go     # 🟡 same

dagger sdk install go resolves go against the embedded sdks.json registry, installs github.com/dagger/go-sdk as [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 that dagger module init / dagger api client init dispatch on. Generic dagger install <ref> does NOT mark anything as an SDK — the marker is opt-in via this verb.

Engine: Workspace.install grew an asSdk: Boolean = false arg. When true and the install is fresh, the entry is created with the empty marker; when the same name/source is already installed, the marker gets stamped onto the existing entry — so a plain dagger install go-sdk followed by dagger sdk install go-sdk upgrades it in place rather than erroring.

dagger sdk uninstall runs a CLI-side refuse-if-authored check against the on-disk config (no session bootstrap to read TOML), then dispatches the regular Workspace.uninstall. --force overrides; files on disk are left untouched, only the workspace entries go away.

module-options and client-options validate that the named install carries the as-sdk marker (so the user gets the useful "run dagger 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. --sdk is a flag. Per-SDK options pass through an --option K=V freeform mechanism that the engine persists in dagger.toml but 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's initModule function schema and surfaces SDK-specific args as typed flags. --go-version is 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 --option flag dies. Typed SDK args replace it.

SDK contract: initModule / initClient

SDKs gain two optional functions:

extend type GoSdk {
  initModule(ws: Workspace!, name: String!, path: String!, # ...sdk-args): Changeset!
  initClient(ws: Workspace!, path: String!, module: String!, # ...sdk-args): Changeset!
  targetRuntime: String!
}

Presence is a capability flag, not just an optional fallback. If an SDK doesn't implement initModule, then dagger module init <sdk> is unavailable for it — the CLI errors with "<sdk> does not support module init". Same for initClient and dagger api client init <sdk>. targetRuntime is the only one where absence is a sensible default (engine falls back to "the SDK ref IS the runtime ref").

targetRuntime introspection is now wired. core.RuntimeTarget interface added and surfaced via SDK.AsRuntimeTarget(). When an SDK module exposes targetRuntime: String! on its main object, the engine calls it at dagger module init time and writes the returned value into the new module's dagger-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 initModule but not initClient. A hypothetical client-only SDK does the reverse. A full SDK does both. dagger sdk list surfaces 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).

  • Add a scoped Workspace/current-SDK API so SDK @generate functions can enumerate modules authored by that SDK (modules.<sdk>.as-sdk.modules) without scanning files or parsing dagger.toml.
  • Wire [runtime].pin through dagger-module.toml module load/write/resolve for external runtimes, or remove/defer the field until it is honored. It is currently parsed but dropped before core.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 a default-sdk in dagger.toml. Non-breaking; rules sketched in the design doc.

SDK codegen regen across the 6 SDKs

The CLI calls Workspace.moduleInit / clientInit via 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 mod group
  • dagger function / fn group
  • dagger env top-level
  • dagger integration top-level
  • dagger migrate
  • dagger workspace {init, migrate, install, uninstall, update, activity, autocheck}
  • dagger checks alias
  • dagger config hidden alias
  • dagger recommend
  • --mod / --no-mod long-form flags
  • The old hidden dagger client install/uninstall/list/update (replaced by dagger api client init/list; client entries move to workspace config)

Renamed

Before After
dagger function call dagger api call
dagger function list dagger api functions
dagger exec dagger api exec (run / r aliases preserved under the new path)
dagger workspace autocheck dagger cloud check
dagger integration setup dagger cloud integration create
--mod / --no-mod --load-module / --no-load-module (-m/-M still work)

Config files

  • dagger-module.toml has a [runtime] table instead of an sdk field. Old dagger.json still reads fine via the compat path; dagger setup migrates it.
  • The [sdks.*] section that briefly existed during this PR's development was folded into [modules.*.as-sdk]. Migration writes the new shape directly.

Schema

  • Workspace.moduleInit returns Changeset! instead of String!. 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.clientInit and Workspace.clientGenerate are new.
  • Per-module experimental.SELF_CALLS flag is still in the schema but the engine no longer looks at it.

Migration warnings everywhere now point at dagger setup.


Reviewing

  • Start with the design doc if you want the why before the what. The Discrete changes from current CLI section has an explicit ✅ / 🟡 / ⬜ legend keyed against the actual code state.
  • Commits are independently revertable.
  • The post-pivot schema work (commits from 153d4bf0d onward) is a standalone reviewable chunk.
  • Most of the noise in the polish commit (17733417f) is regenerated reference docs; the human-edited bits are 5 prose pages and 2 small cmd/dagger files.

shykes added a commit that referenced this pull request Jun 10, 2026
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
@shykes shykes changed the title Design: CLI 1.0 top-level command surface CLI 1.0: top-level command surface (design + implementation) Jun 10, 2026
@shykes
shykes marked this pull request as ready for review June 10, 2026 19:50
@shykes
shykes requested review from a team as code owners June 10, 2026 19:50
eunomie pushed a commit to eunomie/dagger that referenced this pull request Jun 16, 2026
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]>
eunomie pushed a commit to eunomie/dagger that referenced this pull request Jun 16, 2026
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]>
eunomie added a commit that referenced this pull request Jun 17, 2026
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]>
eunomie pushed a commit that referenced this pull request Jun 17, 2026
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]>
eunomie added a commit that referenced this pull request Jun 17, 2026
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]>
eunomie added a commit to eunomie-quack/dagger that referenced this pull request Jun 17, 2026
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]>
eunomie added a commit that referenced this pull request Jun 17, 2026
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]>
@eunomie

eunomie commented Jun 17, 2026

Copy link
Copy Markdown
Member

Just to note some tests are skipped behind a todo until the corresponding code is implemented.
This was to allow a (as much as possible) green CI.
That way we also know easily what to fix, or let an agent do it.

$ 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")

@tiborvass

Copy link
Copy Markdown
Contributor

We migrated the straightforward generated-client tests to the CLI 1.0 flow: dagger sdk install + dagger api client init, api exec, and api client list.

Three legacy client-generator behaviors are still skipped because they need CLI 1.0 semantics before we can honestly migrate the tests:

  1. Custom generator install still uses dagger client install ./generator. We need to define how local/custom generator modules map into the new sdk install + api client init flow.

  2. Client uninstall tested removing one generated client from the legacy clients list in dagger.json. CLI 1.0 needs a defined equivalent: remove generated files, remove workspace config, uninstall SDK/module, or some combination.

  3. Client update tested mutating legacy dagger.json client generator refs and pins. CLI 1.0 needs a new update model for generated clients/workspace SDK modules before the test can be rewritten.

@shykes

shykes commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author
  1. Custom generator install still uses dagger client install ./generator. We need to define how local/custom generator modules map into the new sdk install + api client init flow.

dagger client install ./generator is replaced with dagger sdk install ./generator

There is no separate concept of a "generator", it's just a SDK (so a module) which may or may not implement client initialization.

eunomie pushed a commit that referenced this pull request Jun 18, 2026
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]>
eunomie added a commit that referenced this pull request Jun 18, 2026
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]>
@shykes shykes added this to the 1.0.0-beta.4 milestone Jun 18, 2026
tiborvass pushed a commit that referenced this pull request Jun 19, 2026
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]>
tiborvass pushed a commit that referenced this pull request Jun 19, 2026
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]>
tiborvass pushed a commit that referenced this pull request Jun 19, 2026
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]>
eunomie added a commit to eunomie/dagger that referenced this pull request Jun 19, 2026
`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]>
eunomie added a commit that referenced this pull request Jun 19, 2026
`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]>
tiborvass and others added 10 commits June 20, 2026 02:06
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]>
@tiborvass

tiborvass commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

I rewrote git history to simplify it, verified there is no change in diff.
Previous tip of the branch: 0b37276

@tiborvass
tiborvass merged commit 7d298df into main Jun 20, 2026
81 checks passed
@tiborvass
tiborvass deleted the design/cli-1.0 branch June 20, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants