feat(cli): add "docker agent toolsets" to list built-in toolset types#3614
Open
dwin-gharibi wants to merge 6 commits into
Open
feat(cli): add "docker agent toolsets" to list built-in toolset types#3614dwin-gharibi wants to merge 6 commits into
dwin-gharibi wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new top-level command,
docker agent toolsets, that lists every built-intoolset type available for use in an agent configuration (
toolsets: - type: <name>),with a one-line summary and a docs link for each. Supports
--format table(default)and
--format json.This mirrors the existing
docker agent modelscommand and closes a discoverabilitygap: until now there was no CLI way to find out which toolset types exist — the list
lived only in Go source and the JSON schema.
Motivation
Writing an agent YAML means referencing toolsets by type:
There was no
docker agent-level way to enumerate the available types or read whatthey do.
docker agent debug toolsets <agent-file>is hidden, needs an agent file,and lists a specific agent's instantiated tools rather than the catalog of types.
What changed
pkg/teamloader/toolsets/catalog.goBuiltinToolsetInfo+BuiltinToolsets— the catalog (type, summary, docs URL), single source of truth.pkg/teamloader/toolsets/catalog_test.gocmd/root/toolsets.gonewToolsetsCmd()— the command, with--format table|jsonand telemetry, following themodelscommand pattern.cmd/root/toolsets_cmd_test.goNoArgs, and unknown-format tests.cmd/root/root.gonewToolsetsCmd()(one line, in the command list).docs/features/cli/index.mddocker agent models.How it stays correct
The command reads from
BuiltinToolsets, whichTestBuiltinToolsetsCatalogMatchesRegistryasserts is exactly equal to the keys of
DefaultToolsetCreators(). Adding a toolsetcreator without a catalog entry (or vice versa) fails the build, so the list can never
silently drift out of sync with reality.
Example output
$ docker agent toolsets --format json [ { "type": "filesystem", "summary": "Read, write, list, search, and navigate files and directories", "docs": "https://docker.github.io/docker-agent/tools/filesystem" }, ... ]Testing
go test ./pkg/teamloader/toolsets/ ./cmd/root/pkg/teamloader/toolsets— drift guard + summaries present.cmd/root— table lists types,--format jsonequals the catalog,NoArgs, unknown format rejected.All pass;
gofmt -landgo vetare clean. (Localgolangci-lint/taskweren'tinstalled on my machine — CI will run
task lint/task test.)Scope / non-goals
docker agent debug toolsets <agent-file>command — different purpose (per-agent instantiated tools), left as-is.toolsets:); MCP/OpenAPI tools discovered at runtime are out of scope.Closes #3613