A locally running AI agent for macOS tasks, powered by Apple's Foundation model via apfel.
The repository is organized as a small monorepo with a Swift backend and a terminal UI client, with optional Telegram remote control backed by the same local runtime.
Swift backend runtime โ local API, tool execution, conversation management, and persistence.
packages/apfelclaw-server Terminal user interface built with OpenTUI and Bun, connecting to the local API.
apps/tui Optional remote access through a private Telegram bot, linked from the TUI and handled by the local backend.
/remotecontrol setup telegram A convenience shell script at the repo root that starts the backend server in one command.
./apfelclaw
Currently macOS-only. The backend depends on Apple platform APIs like
EventKit, Apple Mail, and Spotlight-backed file search, and expects apfel to be installed locally for model execution.
apfel installed and available on PATH ./apfelclaw
The server listens on 127.0.0.1:4242.
cd apps/tui
bun install bun run dev Or use the root convenience scripts:
./apfelclaw # backend
npm run dev:server # alternative
npm run dev:tui # TUI client The backend exposes a local REST API with WebSocket support for live session events.
| Method | Endpoint |
|---|---|
| GET | /health |
| GET | /config |
| PATCH | /config |
| GET | /tools |
| GET | /sessions |
| POST | /sessions |
| GET | /sessions/:id/messages |
| POST | /sessions/:id/messages |
| WS | /sessions/:id/stream |
Response header: Server: apfelclaw-server/0.1.0
Config lives in ~/.apfelclaw/config.json and persists
across server restarts. SQLite memory is stored at ~/.apfelclaw/memory.sqlite.
{
"assistantName": "Apfelclaw",
"userName": "You",
"approvalMode": "trusted-readonly",
"debug": false
}
Supported approvalMode values: always, ask-once-per-tool-per-session, trusted-readonly.
Contribution guidelines live in CONTRIBUTING.md. Please read that file before opening a pull request.