toml-cli icon indicating copy to clipboard operation
toml-cli copied to clipboard

feat: Add search command (using JMESPath)

Open tiberium opened this issue 8 months ago • 0 comments

Hi, I have implemented a new command: search. The query that you can use to search is the JMESPath expression.

It might be really helpful for various of reasons, one would be to work with arrays of tables. For example, assuming such a pyproject.toml file:

[[tool.uv.index]]
name = "private-registry"
url = "some-private-url"

[[tool.uv.index]]
name = "public-registry"
url = "official-pypi-url"

Now we can retrieve the names of all the defined uv indexes:

toml search --toml-path pyproject.toml tool.uv.index[*].name

tiberium avatar May 08 '25 16:05 tiberium