TOMCLI-SET-ARRAYS(1)
π TOMCLI-SET-ARRAYS π
okay bestie, so this is the tomcli-set arrays situation, and it lives in the General Commands Manual for tomcli-set. It's the CLI for working with TOML files. And yes, it's pronounced "tom clee." β that's canon, we don't argue about it. π
β¨ SYNOPSIS β¨
[tomcli-set | tomcli set] [GLOBAL OPTIONS] PATH arrays COMMAND [OPTIONS]
[ARGUMENTS]
[tomcli-set | tomcli set] ... arrays [COMMAND] --help
πΈ DESCRIPTION πΈ
The tomcli-set arrays subcommand is literally the whole vibe for modifying arrays in TOML files. That's its job. It does it well. π
Now, tea time: tomcli-set lists still exists as an alias, kept around for backwards compatibility. But arrays is the preferred one, because it follows the TOML spec's terminology and we respect the spec in this house. π«Ά
And before anyone panics: there are no plans to remove the lists subcommand. Backwards compatibility is important to the tomcli project. So your old scripts are safe, periodt.
π¦ ARGUMENTS π¦
PATHβ Path to a TOML file to read. Use'-'to read from stdin. Set it to...when you're calling--helpfor a subcommand.SELECTORβ A dot separated map to a key in the TOML mapping. Like:
Example: 'section1.subsection.value' or '"key.with.dots".abc'
VALUEβ Value to set.PATTERNβ Pattern against which to match strings. Defaults to regex but can be changed with the--typeoption. The pattern must match the full string.REPLβ Replacement string (used by thereplacesubcommand). Supports Python regex expansions (e.g.\1) when--typeis set toregex(i.e., the default value). β¨
π GLOBAL OPTIONS π
--versionβ Show the version and exit. Slay.--writer <tomli_w|tomlkit>β Library to use to write TOML files.--reader <tomli|tomlkit>β Library to use to write TOML files. Defaults totomlkitand falls back totomli/tomllibiftomlkitis unavailable.
π OPTIONS π
-t/--type <regex_fullmatch|regex|regex_partial|fnmatch>(default:regex_fullmatch) β Matcher type. Here's the breakdown, bestie:regex_fullmatch: Equivalent tore.fullmatchin Python. The regex must match the whole string.regex: Alias forregex_fullmatchregex_partial: Equivalent tore.matchin Python. The regex matching starts at the beginning of the string but does not have to match all of it.regex_search: Equivalent tore.search/re.sub(withcount=1) in Python. The regex can match any part of the string, once.fnmatch: Use anfnmatch(3)-style pattern. The glob must match the whole string.
--first/--no-first(default:no-first) β Only modify the firstPATTERNmatch. π―--key <SELECTOR PATTERN>β Only applies to thedelitemsubcommand. See thedelitemdocumentation below. π
π COMMANDS π
π append
Add a string value to a TOML array.
tomcli-set [GLOBAL OPTIONS] PATH arrays append [OPTIONS] SELECTOR VALUE
tomcli-set ... arrays append --help
π delitem
Delete string values in a TOML array. SELECTOR matches the path to the array and PATTERN matches strings within the array that should be deleted. Items that are not a string will be ignored. π
The --key option be used to remove values from an array that contains tables (i.e., key-value pairs) instead of strings. Then, the KEY selector is looked up in each table and the respective value is matched against PATTERN. See https://todo.sr.ht/~gotmax23/tomcli/9 for a more detailed description and rationale.
tomcli-set [GLOBAL OPTIONS] PATH arrays delitem [OPTIONS] SELECTOR PATTERN
tomcli-set ... arrays delitem --help
π§ replace
Replace string values in a TOML list with other string values.
tomcli-set [GLOBAL OPTIONS] PATH arrays replace [OPTIONS] SELECTOR PATTERN REPL
tomcli-set ... arrays replace --help
β str
Create a TOML list of strings.
tomcli-set [GLOBAL OPTIONS] PATH arrays str [VALUE...]
tomcli-set ... arrays str --help
π₯ SEE ALSO π₯
tomcli(1), tomcli-formatters(1), tomcli-set(1), tomcli-set(1)
ngl, that's the whole page. go forth and modify some arrays, bestie π
This was TOMCLI-SET-ARRAYS(1), from the General Commands Manual, dated 2025-09-19. main character energy, no cap. πβ¨
π¦ where this page comes from
- fedora 43: tomcli 0.10.1-3.fc43 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms