Skip to content

b315

Choose a tag to compare

@github-actions github-actions released this 04 Sep 12:52
0e7a3ed

feat(config): add a config subcommand for editing llmman.conf (#401)

Everything llmman.conf holds has to be typed into an editor today, and
the format is deny_unknown_fields, so a misspelled api_kye is a
credential that silently never takes effect and surfaces later as
someone else's 401. Nothing even tells a user where the file is.

Add llmman config, git config verb for verb: list, get, set,
unset and edit, with --system/--user/--file picking the
location. Reads see both files merged, later overriding earlier; writes
go to the per-user file.

Keys are TOML dotted keys, so nothing needs keeping in sync as the
format grows. Every write goes through config::parse before the file
is replaced, turning the typo above into an error next to the thing that
caused it and leaving the file on disk as it was. A file that ends up
holding an api_key is made owner-only, since llmman would otherwise
ignore the key just written; one holding no key keeps its mode, because
/etc/llmman/llmman.conf has to stay readable. Reading a file whose
keys llmman would drop warns rather than reporting a value that will
never be spent.

toml_edit rather than serializing a Conf back out: this is a file
people also hand-edit, and its comments and layout have to survive.