You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sub-issue of #240. Hardened spec — do not re-derive decisions. Mirrors internal/cmd/pipelines/variablegroup/list/list.go (the modern list pattern with JSON view struct + table printer).
Command Description
List the agent queues in a project. The command fetches the matching queues via the Agent Queues REST 7.1 endpoint and renders them as a default table (with optional JSON export). All output passes through ctx.Printer("list") for the table and opts.exporter.Write(ios, view) for JSON.
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/queues?queueName={filter}&api-version=7.1
Locked Decisions (do not re-derive)
#
Decision
Rationale
1
Use the vendored SDK taskagent.Client.GetAgentQueues (not raw HTTP). Mock already generated at internal/mocks/taskagent_client_mock.go:471-480.
Consistent with the other taskagent subgroup siblings.
2
Queues are project-scoped: positional [ORGANIZATION/]PROJECT parsed with util.ParseProjectScope from internal/cmd/util/scope.go:138. The function returns a *util.Path with Organization (defaults resolved from ctx.Config().Authentication().GetDefaultOrganization()) and Project populated; Targets is not used (the command has no target beyond the project).
Queues belong to a project. Same parser as work-item list (#136), work-item create (#203), and the pipelines build family.
2.5
cobra.ExactArgs(1, "project argument required") — args[0] is the full scope. Combined with the ParseProjectScope parser, the resulting shape is azdo pipelines queue list [ORGANIZATION/]PROJECT, NOT [ORGANIZATION/]PROJECT/TARGET.
Mirrors the project-scope precedent; no target segment exists for this command.
3
Optional filter --name (string) maps to GetAgentQueuesArgs.QueueName.
Mirrors Azure CLI filter.
4
Default output is a table. JSON output via --json passes a dedicated view struct []queueJSON to opts.exporter.Write. The view struct flattens Pool (name only) and ProjectId (string).
Positional structure (parser: util.ParseProjectScope at internal/cmd/util/scope.go:138)
The parser expects 1 or 2 /-separated segments in the single positional. The resulting *util.Path has the following fields after a successful parse:
Field
Value
Notes
*Path.Organization
string
Required. Resolved from the first segment, or from ctx.Config().Authentication().GetDefaultOrganization() when the segment is omitted.
*Path.Project
string
Required. Resolved from the second segment when 2 segments are given, or from the single segment when only 1 is given.
*Path.Targets
[]string{}
Always empty. The command has no positional target beyond the project; queue filtering is done server-side via --name and client-side via --max-items.
Segment-count table
Input
Result
""(no positional)
Error — "accepts 1 arg(s), received 0" (cobra-level). The parser itself accepts the empty input as a project-less scope, but cobra.ExactArgs(1) rejects the call before parsing.
cobra.ExactArgs(1, "project argument required"). The RunE handler assigns args[0] to opts.scopeArg, then run() calls util.ParseProjectScope(ctx, opts.scopeArg) to obtain the *util.Path.
Flags
Flag
Type
Default
Required
Maps to
Description
--name
string
""
no
GetAgentQueuesArgs.QueueName
Optional name filter on the queue. Empty string → no name filter.
--max-items
int
0
no
(client-side cap)
Maximum number of queues to return. 0 = no cap; truncates the slice after the SDK call.
Update internal/cmd/pipelines/queue/queue.go to add listcmd "github.com/tmeckel/azdo-cli/internal/cmd/pipelines/queue/list" and cmd.AddCommand(listcmd.NewCmd(ctx)). Update the Example block.
Sub-issue of #240. Hardened spec — do not re-derive decisions. Mirrors
internal/cmd/pipelines/variablegroup/list/list.go(the modern list pattern with JSON view struct + table printer).Command Description
List the agent queues in a project. The command fetches the matching queues via the Agent Queues REST 7.1 endpoint and renders them as a default table (with optional JSON export). All output passes through
ctx.Printer("list")for the table andopts.exporter.Write(ios, view)for JSON.Locked Decisions (do not re-derive)
taskagent.Client.GetAgentQueues(not raw HTTP). Mock already generated atinternal/mocks/taskagent_client_mock.go:471-480.taskagentsubgroup siblings.[ORGANIZATION/]PROJECTparsed withutil.ParseProjectScopefrominternal/cmd/util/scope.go:138. The function returns a*util.PathwithOrganization(defaults resolved fromctx.Config().Authentication().GetDefaultOrganization()) andProjectpopulated;Targetsis not used (the command has no target beyond the project).work-item list(#136),work-item create(#203), and thepipelines buildfamily.cobra.ExactArgs(1, "project argument required")—args[0]is the full scope. Combined with theParseProjectScopeparser, the resulting shape isazdo pipelines queue list [ORGANIZATION/]PROJECT, NOT[ORGANIZATION/]PROJECT/TARGET.--name(string) maps toGetAgentQueuesArgs.QueueName.--jsonpasses a dedicated view struct[]queueJSONtoopts.exporter.Write. The view struct flattensPool(name only) andProjectId(string).pipelines/variablegroup/list/list.go.id,name,pool(name),projectId(string),createdBy(flattened).--max-items(int, default 0 = no cap) — if positive, truncate the result slice client-side.pipelines/variablegroup/list--max-items.ls,l.internal/cmd/pipelines/queue/list. Reuse SDK call from the vendoredtaskagentpackage.GetAgentQueuesis already generated atinternal/mocks/taskagent_client_mock.go:471-480. Do not regenerate.Command Signature
Aliases:
ls,l.Positional structure (parser:
util.ParseProjectScopeatinternal/cmd/util/scope.go:138)The parser expects 1 or 2
/-separated segments in the single positional. The resulting*util.Pathhas the following fields after a successful parse:*Path.Organizationstringctx.Config().Authentication().GetDefaultOrganization()when the segment is omitted.*Path.Projectstring*Path.Targets[]string{}--nameand client-side via--max-items.Segment-count table
""(no positional)"accepts 1 arg(s), received 0"(cobra-level). The parser itself accepts the empty input as a project-less scope, butcobra.ExactArgs(1)rejects the call before parsing."Fabrikam"Organization= default org,Project="Fabrikam"."myorg/Fabrikam"Organization="myorg",Project="Fabrikam"."a/b/c""invalid input \"a/b/c\": expected 1-2 segments, got 3".cobra.Argsvalidatorcobra.ExactArgs(1, "project argument required"). The RunE handler assignsargs[0]toopts.scopeArg, thenrun()callsutil.ParseProjectScope(ctx, opts.scopeArg)to obtain the*util.Path.Flags
--namestring""GetAgentQueuesArgs.QueueName--max-itemsint00= no cap; truncates the slice after the SDK call.--json/--jq/--templateutil.AddJSONFlags--json id,name,poolNamefilters fields;--template @fileaccepts a Go-template file.JSON Output Contract
Table Output Contract
Default columns:
ID, NAME, POOL, PROJECT(matches thepipelines queue showtable from #245).Command Wiring
internal/cmd/pipelines/queue/listlist.go—NewCmd(ctx util.CmdContext) *cobra.Command+listOptions+runListlist_test.go— table-driven gomock testsinternal/cmd/pipelines/queue/queue.goto addlistcmd "github.com/tmeckel/azdo-cli/internal/cmd/pipelines/queue/list"andcmd.AddCommand(listcmd.NewCmd(ctx)). Update theExampleblock.pipelines→queue→list.API Surface
Reuse the already-vendored client. No new SDK clients required.
taskagent.Client.GetAgentQueues→ Agent Queues - List (REST 7.1)taskagent.GetAgentQueuesArgsstruct:{Project *string, QueueName *string, ActionFilter *TaskAgentQueueActionFilter}.Mock for
GetAgentQueuesis already generated atinternal/mocks/taskagent_client_mock.go:471-480. No mock regeneration needed.Reference Existing Patterns
internal/cmd/pipelines/variablegroup/list/list.go— primary list reference (modern list pattern with JSON view struct, table printer,--max-itemscap).internal/cmd/pipelines/queue/show/show.go(sibling under feat: Implementazdo pipelines queue showcommand #245) — closest sibling; copy the table columns and thequeueJSONview struct shape.internal/cmd/boards/workitem/list/list_test.go:765-844—setupFakeDeps/stub*fixture.internal/mocks/taskagent_client_mock.go:471-480— mock forGetAgentQueues(already generated, do not regenerate).internal/azdo/factory.go:133-139—ClientFactory().TaskAgent(...)accessor (reuse).internal/cmd/util/scope.go:138—util.ParseProjectScope(common project-scope parser, also used by feat: Implementazdo boards work-item listcommand #136, feat: Implementazdo boards work-item createcommand #203, and thepipelines buildfamily).References