{"record":{"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/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/image/list.go#L152-L188","documentation":"Fourth check in shouldUseTree(): the `--tree` view has its own fixed layout and does not honor a custom Go template via --format, so passing both is rejected to avoid silently ignoring the user's template.","triggerScenarios":"`docker images --tree --format '{{json .}}'` or any custom format string with --tree.","commonSituations":"A standardized --format used across all image commands conflicts with the tree renderer; templating scripts applied uniformly.","solutions":["Drop --format when using --tree","Use --format with the tabular view (no --tree) for custom output","Use the default tree layout or a separate formatted invocation"],"exampleFix":"// before\ndocker images --tree --format '{{json .}}'\n// after\ndocker images --format '{{json .}}'","handlingStrategy":"validation","validationCode":"if options.tree && options.format != \"\" {\n    return errors.New(\"--format is not supported with --tree\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not pass a custom --format with --tree","Use --format with the tabular view for templated output","Keep format strings in a variable and omit them for tree invocations"],"tags":["images","cli","experimental","format"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}