feat(cli): support alias list --json output#2966
Merged
Merged
Conversation
docker-agent
reviewed
Jun 2, 2026
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The implementation is clean and correct. The --json flag for alias list is well-structured:
- Uses a proper closure to capture
asJSONflag value - Sorts aliases alphabetically (consistent with the non-JSON path)
- Handles empty alias lists correctly (outputs
[]— valid for JSON consumers) - Maps all alias fields to a typed
aliasListEntrystruct with appropriateomitemptytags - Error handling is consistent with the rest of the file
No bugs found in the added code.
dgageot
reviewed
Jun 2, 2026
| entries := make([]aliasListEntry, 0, len(names)) | ||
| for _, name := range names { | ||
| alias := allAliases[name] | ||
| entries = append(entries, aliasListEntry{ |
0577fb2 to
3aef9c2
Compare
dgageot
approved these changes
Jun 2, 2026
0784d11 to
44f4c4e
Compare
Add a --json flag to `docker agent alias list` that emits the registered aliases as a sorted JSON array, with empty options omitted. Closes #2965
Signed-off-by: Sayt-0 <louis-dalmorocompta@docker.com>
44f4c4e to
fe03d98
Compare
aheritier
added a commit
that referenced
this pull request
Jun 3, 2026
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.
Closes #2965