/* * splinter -- command line entry point. * * Copyright (c) 2026 Konrad Lother * SPDX-License-Identifier: BSD-3-Clause * * Exit statuses: 0 the turn produced an answer, 1 the turn failed, 2 usage or * configuration error, 3 the environment could not be set up (session dir). */ #include #include #include #include #include #include #include "splinter.h" #include "config.h" #include "i18n.h" #include "log.h" #include "skills.h" #include "memory.h" #include "prompt.h" #include "folder.h" #include "mcpserver.h" #include "interview.h" #include "ack.h" #include "swarm.h" #include "splinter_plugin.h" #include "theme.h" #include "ui.h" static void usage(FILE *f) { fprintf(f, "usage: splinter [options]\n\n" " -p, --prompt TEXT run one turn with TEXT and exit\n" " --endpoint URL transport: OpenAI-compatible chat endpoint\n" " --model NAME model name for --endpoint (required)\n" " --api-key-env VAR read the API key from VAR (default\n" " SPLINTER_API_KEY; missing means no auth)\n" " --script FILE transport: replay replies from FILE, one\n" " per line (no network; for tests and demos)\n" " --config PATH read this config file instead of the default\n" " --no-config ignore the config file entirely\n" " --init-config write a commented example config and exit\n" " --plugin PATH load a plugin (.so) before the first turn\n" " --transport NAME use a transport a plugin provides (\"cli\")\n" " --chat interactive curses UI instead of one turn\n" " --theme NAME CDE palette for the UI (default Delphinium)\n" " --list-themes print the palette names and exit\n" " --resume load the session's history into the conversation\n" " --choose TEXT print which delegate fits TEXT, then exit\n" " --daemon answer on Telegram until SIGINT\n" " --no-stdin ignore data on standard input\n" " -c, --continue continue the last session started in this " "directory\n" " --interview ask the first-run questions and write the " "profile\n" " --mcp-server-listen IP serve MCP on IP (tools of this " "registry);\n" " beyond 127.x it needs " "SPLINTER_MCP_TOKEN\n" " --mcp-listen-port N MCP port, default 8098\n" " --autonomous run mutating tools without asking\n" " --steps N tool rounds per turn (default 150)\n" " --session DIR session directory (default ~/.splinter)\n" " --session-id ID session id (default sess-