TOMCLI-SET(1)
π TOMCLI-SET π
okay bestie, so this is tomcli-set β the CLI for working with TOML files. and yes, it's pronounced "tom clee." π
you're welcome, now you can say it out loud without getting roasted.
it lives in the General Commands Manual, and it's the sibling of tomcli that's all about writing to your TOML instead of just peeking at it. main character energy fr fr.
β¨ SYNOPSIS β¨
[tomcli-set | tomcli set] [GLOBAL OPTIONS] PATH COMMAND [ARGUMENTS]
[tomcli-set | tomcli set] ... [COMMAND] --help
so you can call it either way β tomcli-set on its own, or as tomcli set like it's the set subcommand of the big tomcli house. π same thing, same slay.
π DESCRIPTION π
the tomcli-set subcommand supports modifying TOML files. that's the whole vibe. it writes. it edits. it does NOT just read (that's tomcli-get's job, go bother her).
πΈ ARGUMENTS πΈ
PATHβ path to a TOML file to read. use'-'to read from stdin, iconic for piping. and when you're calling--helpfor a subcommand, you set it to...like a lil placeholder. π«ΆSELECTORβ a dot separated map to a key in the TOML mapping. like a little treasure map to exactly the value you want πΊοΈ- example:
'section1.subsection.value'or'"key.with.dots".abc' - or
'array.5'β and lowkey important: that0is an array index, so yes you count from zero like a real one.
- example:
VALUEβ value to set. the thing. the content. the moment. β¨
π replace
these two only apply to the replace subcommand, so don't come for me:
PATTERNβ pattern against which to match strings. defaults to regex but can be changed with the--typeoption. the pattern must match the full string. no partial credit, no half-vibes. π€REPLβ replacement string (used by thereplacesubcommand). it supports Python regex expansions (e.g.\1) when--typeis set to regex (i.e., the default value). so go ahead and backreference, bestie. π
π GLOBAL OPTIONS π
--versionβ show the version and exit. short, sweet, done. π--writer <tomli_w|tomlkit>β library to use to write TOML files. (yes, the original says "write" for both reader and writer, and honestly? we respect the chaos.) π--reader <tomli|tomlkit>β library to use to write TOML files. defaults totomlkitand falls back totomli/tomllibiftomlkitis unavailable. so it's got a backup plan, unlike me. π
β OPTIONS β
π¦ replace
-t/--type <regex_fullmatch|regex|regex_partial|fnmatch>β matcher type. default:regex_fullmatch
and here's the full tea on each one, no cap:
regex_fullmatch: equivalent tore.fullmatchin Python. the regex must match the whole string. all of it. every crumb. π₯regex: alias forregex_fullmatch. two names, one queen. πregex_partial: equivalent tore.matchin Python. the regex matching starts at the beginning of the string but does not have to match all of it. so it has to show up at the start like it owns the place, but it doesn't have to finish the sentence. πregex_search: equivalent tore.search/re.sub(withcount=1) in Python. the regex can match any part of the string, once. one (1) match, that's it, don't get greedy. β¨fnmatch: use anfnmatch(3)-style pattern. the glob must match the whole string. full match, glob edition. π
π COMMANDS π
π append
add a string value to a TOML list. baby's first list edit. π
tomcli-set [GLOBAL OPTIONS] PATH append [OPTIONS] SELECTOR VALUE
tomcli-set ... append --help
π del
delete a value from a TOML file. the opposite of a hoarder. and note the SELECTOR... β you can feed it multiple selectors, plural, so go off. ποΈβ¨
tomcli-set [GLOBAL OPTIONS] PATH del [OPTIONS] SELECTOR...
tomcli-set ... del --help
π true / false
set a value in a TOML file to true or false. binary. decisive. no "it's complicated." π
tomcli-set [GLOBAL OPTIONS] PATH [true | false] [OPTIONS] SELECTOR
tomcli-set ... [true | false] --help
π str / int / float
set a string or integer or float value in a TOML file. pick your type, pick your fighter. π
tomcli-set [GLOBAL OPTIONS] PATH [str|int|float] SELECTOR VALUE
tomcli-set ... [str|int|float] --help
π replace
perform a replacement on a string in a TOML file. if PATTERN does not match the existing value and --not-required is not passed, the command will fail. read that again, bestie, because that's a whole trip hazard. β οΈ
and if you simply wish to replace the value of a string field without first checking that it matches an expected value, use the 'str' subcommand instead. she doesn't ask questions. she just sets. π
tomcli-set [GLOBAL OPTIONS] PATH replace [OPTIONS] SELECTOR PATTERN REPL
tomcli-set ... replace --help
π arrays
subcommand to modify TOML arrays. see tomcli-set-arrays(1) for the whole saga. π
π lists
alias to the arrays subcommand. same girl, different name tag. π·οΈ
π SEE ALSO π
tomcli(1), tomcli-formatters(1), tomcli-get(1), tomcli-set-arrays(1)
go read those too, i'm not gonna gatekeep. π«Ά
and that's the whole page, babes. this one's from tomcli-set(1), dated 2025-09-19, living in the General Commands Manual β and yes it's a manual page so it gets to have (1) after its name, that's just how the section numbering works, iykyk. now go edit some TOML and slay. πβ¨ππ¦πΈ
π¦ 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