Skip to content

Conversation

@InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented Jun 11, 2025

Summary

Resolves #13633.

tool list --output-format=json outputs information about the installed tools in JSON. An example output looks like this:

[
  {
    "name": "black",
    "version": "24.2.0",
    "version_specifiers": ["==24.2.0"],
    "extra_requirements": [],
    "with_requirements": [],
    "directory": "[...]/tools/black",
    "environment": {
      "python": "[...]/tools/black/bin/python3",
      "version": "3.12.1"
    },
    "entrypoints": [
      { "name": "black", "path": "[...]/bin/black" },
      { "name": "blackd", "path": "[...]/bin/blackd" }
    ]
  }
]

--show-paths, --show-version-specifiers, --show-with and --show-extras are allowed to be used with --output-format, but they are redundant; the output will always include those information.

Test Plan

Unit tests.

@konstin konstin requested a review from Gankra June 11, 2025 12:14
@InSyncWithFoo InSyncWithFoo marked this pull request as ready for review June 11, 2025 15:24
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Performance Report

Merging #13962 will not alter performance

Comparing InSyncWithFoo:tool-list-json (08953ab) with main (77c771c)

Summary

✅ 3 untouched

@zanieb
Copy link
Member

zanieb commented Jul 14, 2025

Thanks for your patience here.

I'm planning to do a pass on this to make it consistent with #13689 unless you're interested? In particular, I think we should:

  • Attempt to use the same implementation and derive the display from the report rather than splitting the implementation
  • Add a preview warning
  • Reuse some of the report structs from there

@InSyncWithFoo
Copy link
Contributor Author

InSyncWithFoo commented Jul 14, 2025

@zanieb I'm occupied at the moment, so please, go ahead and thanks.

@zanieb zanieb self-assigned this Jul 14, 2025
@sigma67
Copy link

sigma67 commented Oct 17, 2025

Is there still interest in this PR? Would be a great feature to have ❤️

@egerlach
Copy link

@zanieb @InSyncWithFoo I just ran into a situation where this would have been useful. Would it be okay if I took a stab at this in the coming weeks? No guarantees, but I have the itch and I might have time.

Specifically, I'm thinking of doing 2 PRs, one that would refactor the reporting stuff from project sync off on its own, and a second which implements --format=json for tool list similar to sync. I'm not familiar with the internals of uv (yet), so I figure that doing a refactor first will let me get my bearings before actually trying to change anything.

@zanieb
Copy link
Member

zanieb commented Dec 15, 2025

Feel free yeah! I haven't had a chance to pick it up.

cc @EliteTK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support tool list --output-format=json

5 participants