]> git.giacomolli.uk - onechat/commit
Read the data directory and the configuration
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 17:12:51 +0000 (14:12 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 17:12:51 +0000 (14:12 -0300)
commit8e8da466ded3b39188862e4b46f40220d65f316e
tree3af674ee37d456bf7fc138dd464ff1de0e065506
parentfeda522eba3e2a27c91741c77d0d01f1840c0004
Read the data directory and the configuration

OneChat finds its data directory in ONECHAT_DIR, then in an absolute
XDG_DATA_HOME, then in ~/.local/share/onechat, and creates it with mode
0700. config.json in that directory selects the model endpoint and the
compactor model and effort. A missing file or field takes the default,
and an unknown field or an invalid value is an error, so a typo never
becomes a silent default.

The endpoint is a name, chatgpt or api, not a URL, so the configuration
cannot send a token to another host.

Issue: b14d537
README.rst
config.go [new file with mode: 0644]
config_test.go [new file with mode: 0644]