TOMCLI-SET(1)

πŸ“¦
version 0.10.1 Β· 4 versions
, in fedora 43

πŸŽ€ 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 --help for 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: that 0 is an array index, so yes you count from zero like a real one.
  • 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 --type option. the pattern must match the full string. no partial credit, no half-vibes. 😀
  • REPL β€” replacement string (used by the replace subcommand). it supports Python regex expansions (e.g. \1) when --type is 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 to tomlkit and falls back to tomli/tomllib if tomlkit is 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 to re.fullmatch in Python. the regex must match the whole string. all of it. every crumb. πŸ”₯
  • regex: alias for regex_fullmatch. two names, one queen. πŸ‘‘
  • regex_partial: equivalent to re.match in 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 to re.search / re.sub (with count=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 an fnmatch(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