Files
splinter/docs/CONFIG.md
T
lotherkandClaude Opus 5.5 25a616a87f review fixes, third round: the gateway asks in its chat, approvals say what
Telegram gateway
- A tool call of the gateway's own turn that needed consent was either denied
  (a daemon has no approval stream) or, with ack channels set, waited for an
  "ok <id>" that only the blocked gateway could have read. It now asks in the
  chat the turn came from, keeps reading while it waits, resolves answers
  (also other processes' and 'splinter --ack'), ignores strangers and tells
  everything else to wait. The update offset is shared, so nothing is handled
  twice. New cfg flag approve_is_channel: such an approve is asked directly.
- send_message wrote its error through err, and half the callers pass NULL: the
  first refused message (too long, bad UTF-8) crashed the gateway. It also
  missed '"ok": true' by substring; the reply is parsed now.
- tests/test_gateway.sh drives the real daemon against a fake Bot API and a
  fake model (tests/fake_telegram.py), with "ok" and with "no". In make check;
  .gitignore no longer hides tests/test_*.sh.

Approvals
- A channel was told "Zustimmung <id>" and nothing else: a phone said yes to a
  number. The message now names the tool and its arguments (cut at 300 bytes)
  and how to answer, and goes to the channel as "$1", never parsed by sh.

Smaller
- ring: an exit that already streamed text is not retried on the next one
  (the operator saw a second answer after half of the first); the header now
  says what moves the ring - limits and providers that are down.
- cli: the program's stderr went over the curses screen and the error quoted
  stdout. stderr goes to a file and into the error; temp paths are quoted;
  the BODY_CAP no-op is gone. (That is the "kaputt" make check used to print.)
- memory: memory_key_env became an env var curl never reads, so no request had
  a key. It is "Authorization: Token <key>" now, on curl's stdin. Tested.
- docs/CONFIG.md: the real default path, and the seven keys it did not know
  (telegram_allow, memory_url, memory_key_env, skills_dir, env_delegates,
  exit, delegate) with the line formats, checked against the parser.
- The no-token message named a config key that does not exist.

Left as it is, on purpose: 'read' stays unrestricted (decision); the fsync per
session line stays (durability over latency).

make check: 26 test binaries and the gateway script, green, also under
ASan/UBSan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 06:13:09 +00:00

129 lines
5.1 KiB
Markdown

# Configuration
Splinter reads one file, so that `splinter` alone is enough to start working.
```
~/.splinter/splinter.conf
```
next to the sessions. If that file does not exist, an older install's
`$XDG_CONFIG_HOME/splinter/config` (or `~/.config/splinter/config`) is read
instead.
`SPLINTER_CONFIG=/path` overrides the location, `--config PATH` does the same
for one run, `--no-config` ignores the file entirely, and `--init-config`
writes a commented example.
Format: one `key = value` per line, `#` starts a comment, blank lines are
ignored. Not JSON, on purpose — this file gets edited by hand, and a missing
comma must not be the reason the harness will not start.
## Not in the file: the goal
The session goal is set at runtime with `/goal <text>` — in the TUI, or in a
one-shot run (`splinter -p "/goal ship the config"`). It belongs to the
conversation in front of you, not to a file that outlives it.
## Precedence
Command line, then the file, then the built-in default. An unknown key is an
error with its line number: a typo that is silently ignored is a config that
lies about what it does.
## Keys
| key | meaning |
|-----|---------|
| `endpoint` | OpenAI-compatible URL, e.g. `http://127.0.0.1:8080/v1/chat/completions` |
| `model` | model name the endpoint expects |
| `api_key_env` | name of the env var holding the key (default `SPLINTER_API_KEY`) |
| `transport` | a transport a plugin provides, e.g. `cli` |
| `cli_cmd` | command for the `cli` transport, e.g. `claude -p` |
| `plugin` | a plugin to load, one line each; absolute paths survive a `cd` |
| `theme` | CDE palette name (`splinter --list-themes`) |
| `locale` | language code (`de`, `en`); catalogues live in `share/locale` |
| `autonomous` | `1` runs mutating/destructive tools without asking |
| `steps` | tool rounds per turn (default 8) |
| `max_bytes` | conversation budget in bytes, `0` = no limit |
| `session_dir` | where session logs go (default `~/.splinter`) |
| `system_prompt` | sent once at the start of a conversation |
| `telegram_allow` | user ids the gateway answers, comma-separated; empty means nobody |
| `memory_url` | base URL of a mem0 server (`memory_search`, `memory_add`) |
| `memory_key_env` | env var with the mem0 key, sent as `Authorization: Token <key>` |
| `skills_dir` | a directory of skills, one line each |
| `env_delegates` | `1` turns `CLAUDE_CODE_OAUTH_TOKEN(_N)` into delegates (default off) |
| `exit` | one way to reach a model for the exit ring, see below |
| `delegate` | another model the `delegate` tool can hand work to, see below |
Secrets never go into the file: every `*key_env` names a variable, and the
variable holds the key. Those variables are hidden from the `run` tool's shell.
## Exits and delegates
Both are one line each, `|`-separated, every field but the first named:
```
exit = groq | Groq free tier | endpoint=https://api.groq.com/openai/v1/chat/completions | model=llama-3.3-70b | key_env=GROQ_KEY
delegate = coder | C99, POSIX, kennt den Quellbaum | endpoint=http://kontron:8080/v1/chat/completions | model=qwen | tags=code,review | prio=5 | max_parallel=2
delegate = far | the same, on another machine | host=buildbox | endpoint=... | model=...
delegate = claude-cli | Claude Code | kind=cli | cmd=claude -p | tags=plan
```
`exit` fields: `endpoint`, `model`, `key_env`; the second field is the label.
`delegate` fields: `endpoint`, `model`, `key_env`, `tags`, `prio`,
`max_parallel`, `kind` (`openai` or `cli`), `cmd` (for `cli`), and `host` - an
ssh target: the child splinter runs there, with that machine's keys. An unnamed
field is the description the selection reads.
## Example: local model
```
endpoint = http://kontron.local:8080/v1/chat/completions
model = /models/unsloth/Qwen3.6-35B-A3B-MTP-GGUF/Qwen3.6-35B-A3B-UD-Q8_K_XL.gguf
theme = Delphinium
autonomous = 1
plugin = /home/lotherk/src/splinter/plugins/lcm/lcm.so
plugin = /home/lotherk/src/splinter/plugins/cps/cps.so
plugin = /home/lotherk/src/splinter/plugins/clock/clock.so
session_dir = /home/lotherk/.splinter
```
## Example: Claude Code as the model
```
transport = cli
cli_cmd = claude -p
plugin = /home/lotherk/src/splinter/plugins/cli/cli.so
theme = Delphinium
```
With both `endpoint` and `transport` set, `transport` wins — it is the more
specific instruction.
## Drop-ins
Next to the config file, a directory with the same name plus `.d` is read after
it, every `*.conf` in name order:
```
~/.splinter/splinter.conf
~/.splinter/splinter.conf.d/10-local.conf
~/.splinter/splinter.conf.d/20-delegates.conf
```
A later file overrides an earlier one, and an unknown key is still an error -
now with the file it came from. Proven in `test_config`.
## Installieren ohne root
make install PREFIX=$HOME/.local
Das installierte Binary traegt einen RPATH auf `$ORIGIN/../lib`, findet seine
`libsplinter.so` also neben sich. Kein Wrapper, kein `LD_LIBRARY_PATH`, keine
Umgebungsdatei: `~/.local/bin/splinter` ist das Programm.
Keys kommen aus der Umgebung, die du selbst exportierst — splinter liest keine
fremde Konfigurationsdatei mit. Ein Delegate nennt nur den Namen der Variablen
(`key_env=OPENCODE_GO_API_KEY`).