Ai Agent written in Swift
The recommended setup is to clone Scribe into ~/.scribe/ so it shares the same root as
config, logs, and sessions — this lets Scribe find and modify its own source.
On first run Scribe writes a default scribe-config.json targeting Ollama at
http://localhost:11434 with the gemma4:e2b model. Edit the file or set
SCRIBE_CONFIG_PATH to point to your own config.
mkdir -p ~/.scribe
git clone https://github.com/zaneenders/scribe.git ~/.scribe/scribe
cd ~/.scribe/scribe
swift build -c release
sudo cp .build/release/scribe /usr/local/bin/scribemkdir -p ~/.scribe
git clone https://github.com/zaneenders/scribe.git ~/.scribe/scribe
cd ~/.scribe/scribe
swift build -c release --swift-sdk x86_64-swift-linux-musl
sudo cp .build/release/scribe /usr/local/bin/scribeCurrently not supported, I would start with updating slate to support a Windows terminal.
Scribe looks for scribe-config.json in this order:
SCRIBE_CONFIG_PATHenvironment variable (if set)~/.scribe/scribe-config.json<cwd>/scribe-config.json
If no config is found, a default is written to ~/.scribe/scribe-config.json and loaded.
Set SCRIBE_HOME to override the ~/.scribe data directory for config, logs, and sessions
(e.g. SCRIBE_HOME=~/.local/share/scribe scribe).
cwdcurrent working directory
| Key | Default | Description |
|---|---|---|
api.baseUrl |
http://localhost:11434 |
API base URL (Ollama default) |
api.apiKey |
"" |
Bearer token; leave empty when no auth is required |
agent.model |
gemma4:e2b |
Model name |
agent.contextWindow |
128000 |
Token context window size |
agent.contextWindowThreshold |
0.8 |
Fraction (0–1) that triggers context compaction |
logging.level |
trace |
One of trace, debug, info, notice, warning, error |
Only OpenAI-compatible
completionsAPIs are supported right now.
Scribe has four built-in tools: shell, read_file, write_file, edit_file.
Both are stored under ~/.scribe/ (or $SCRIBE_HOME if set):
~/.scribe/
├── scribe/ # source clone (git clone ... ~/.scribe/scribe)
├── scribe-config.json
├── logs/scribe-{uuid}.log # one log file per invocation
├── sessions/{uuid}/metadata.json # one directory per session
└── sessions/{uuid}/messages.jsonl
Preview generated documentation with Swift DocC (included in the Swift toolchain):
docc preview Sources/ScribeCore/ScribeCore.doccdocc preview Sources/ScribeCLI/ScribeCLI.docc