Metadata-Version: 2.4
Name: toml-cli
Version: 0.8.2
Summary: Command line interface to read and write keys/values to/from toml files
Project-URL: Repository, https://github.com/mrijken/toml-cli
Author-email: Marc Rijken <marc@rijken.org>
License-Expression: MIT AND (Apache-2.0 OR BSD-2-Clause)
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: jmespath>=1.0.1
Requires-Dist: regex>=2020.7.14
Requires-Dist: tomlkit>=0.13.3
Requires-Dist: typer>=0.16.0
Description-Content-Type: text/markdown

# toml-cli

![Build](https://github.com/mrijken/toml-cli/workflows/CI/badge.svg)

Command line interface for toml files.

This can be usefull for getting or setting parts of a toml file without an editor.
Which can be convinient when values have to be read by a script for example in
continuous development steps.

## Install

Install via

`pip install toml-cli`

or

`uv tool install toml-cli`

## Get a value

`toml get --toml-path pyproject.toml tool.poetry.name`

`toml get --toml-path pyproject.toml tool.poetry.authors[0]`

`toml get --toml-path pyproject.toml tool.poetry.name --default marc`

## Search with [JMESPath](https://jmespath.org/)

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

## Set a value

`toml set --toml-path pyproject.toml tool.poetry.version 0.2.0`

`toml set --toml-path pyproject.toml tool.poetry.authors[0] "Marc Rijken <marc@rijken.org>"`

When the index exists, the item is changed.  Otherwise, the item will be added to the list.

## Add a section

`toml add_section --toml-path pyproject.toml tool.poetry.new_section`

## Unset a value

`toml unset --toml-path pyproject.toml tool.poetry.version`
