Ai Agent written in Swift
- Swift 6.3 or newer
- macOS 26+ or Linux (x86_64 or aarch64)
Clone Scribe into ~/.scribe/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.
Put the binary on your PATH (for example ~/.local/bin):
# ensure ~/.local/bin is on your PATH
mkdir -p ~/.local/binmkdir -p ~/.scribe
git clone https://github.com/zaneenders/scribe.git ~/.scribe/scribe
cd ~/.scribe/scribe
swift build -c release
install -m 755 .build/release/scribe ~/.local/bin/scribeInstall the Swift static SDK once, then build for your architecture:
swift sdk install https://download.swift.org/swift-6.3.2-release/static-sdk/swift-6.3.2-RELEASE/swift-6.3.2-RELEASE_static-linux-0.1.0.artifactbundle.tar.gz \
--checksum 3fd798bef6f4408f1ea5a6f94ce4d4052830c4326ab85ebc04f983f01b3da407
mkdir -p ~/.scribe
git clone https://github.com/zaneenders/scribe.git ~/.scribe/scribe
cd ~/.scribe/scribe
ARCH=$(uname -m) # x86_64 or aarch64
swift build -c release --swift-sdk "${ARCH}-swift-linux-musl"
install -m 755 .build/release/scribe ~/.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
└── sessions/{uuid}/
├── metadata.json
├── messages.jsonl
└── scribe.log # diagnostic log for that session
Per-session logs live under sessions/{uuid}/scribe.log. Older releases wrote
~/.scribe/logs/scribe-{uuid}.log; those files are not moved automatically.
When building on ScribeAgent directly (server, tests, custom CLI):
- Pass a host-owned
LoggerintoScribeAgentat init; it flows through the agent loop and built-in tools. ToolRegistryrequiresinit(tools:logger:).ToolExecutor/executetakeslogger:for each invocation.- The global
ScribeCore.scribeSessionLoggersink was removed — inject your own logger instead.
See DEVELOPMENT.md (Logging) for line format and message conventions.
Preview generated documentation with Swift DocC (included in the Swift toolchain):
docc preview Sources/ScribeCore/ScribeCore.doccdocc preview Sources/ScribeCLI/ScribeCLI.docc