{"id":"e331ddab0ab08dea","repo":"docker/cli","slug":"format-is-not-yet-supported-with-tree","errorCode":null,"errorMessage":"--format is not yet supported with --tree","messagePattern":"--format is not yet supported with --tree","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/image/list.go","lineNumber":170,"sourceCode":"\t\t\treturn false, errors.New(\"--quiet is not yet supported with --tree\")\n\t\t}\n\t\treturn false, nil\n\t}\n\tif options.noTrunc {\n\t\tif options.tree {\n\t\t\treturn false, errors.New(\"--no-trunc is not yet supported with --tree\")\n\t\t}\n\t\treturn false, nil\n\t}\n\tif options.showDigests {\n\t\tif options.tree {\n\t\t\treturn false, errors.New(\"--show-digest is not yet supported with --tree\")\n\t\t}\n\t\treturn false, nil\n\t}\n\tif options.format != \"\" {\n\t\tif options.tree {\n\t\t\treturn false, errors.New(\"--format is not yet supported with --tree\")\n\t\t}\n\t\treturn false, nil\n\t}\n\treturn true, nil\n}\n\n// isDangling is a copy of [formatter.isDangling].\nfunc isDangling(img image.Summary) bool {\n\tif len(img.RepoTags) == 0 {\n\t\treturn true\n\t}\n\treturn len(img.RepoTags) == 1 && img.RepoTags[0] == \"<none>:<none>\" && len(img.RepoDigests) == 1 && img.RepoDigests[0] == \"<none>@<none>\"\n}\n\n// printAmbiguousHint prints an informational warning if the provided filter\n// argument is ambiguous.\n//\n// The \"docker images\" top-level subcommand predates the \"docker <object> <verb>\"","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/image/list.go#L152-L188","documentation":"--format lets users template `docker image ls` output with Go templates or select json/table output, which is driven by the formatter package over flat image rows. The tree view builds hierarchical multi-platform output outside that formatter pipeline, so custom formats cannot be applied to it; shouldUseTree rejects the combination as 'not yet supported'.","triggerScenarios":"Running `docker image ls --tree --format '{{.Repository}}'` or `--tree --format json`; shouldUseTree returns the error whenever options.format is non-empty and options.tree is set. A `formatter.ImagesFormat` set in the CLI config file combined with --tree can trigger it without any --format flag on the command line, depending on how format is resolved.","commonSituations":"Scripts consuming `--format json` output hitting a user alias that adds --tree; users with imagesFormat configured in ~/.docker/config.json enabling tree mode; attempts to get machine-readable output of the multi-platform tree.","solutions":["Drop --tree when you need formatted/machine-readable output: `docker image ls --format json`.","Drop --format to see the tree: `docker image ls --tree`.","Check ~/.docker/config.json for an 'imagesFormat' entry if the error appears without an explicit --format flag, and remove it or override with --format table."],"exampleFix":"# before\ndocker image ls --tree --format json\n# after\ndocker image ls --format json","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker-cli","images","tree-view","format","flag-conflict"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}