README.md
May 4, 2026 ยท View on GitHub
apfelclaw
Disclaimer: This project is in very early development. It is not intended for production use or real-world tasks and is provided for experimental purposes only. Use it at your own risk. We are not liable for any security issues, data loss, or other damages resulting from its use.
apfelclaw is a locally running AI agent for tasks with macOS using Apple's Foundation model via apfel.
The repository is organized as a small monorepo:
packages/apfelclaw-server: Swift backend runtime, local API, tool execution, and persistenceapps/cli: Node-basedapfelclawcommand tool with onboarding and lifecycle commandsapps/tui: Separate chat applicationapfelclaw: convenience launcher for the Node CLI in this repo
Status
This project currently targets Apple Silicon Macs running macOS 26 Tahoe or newer. It depends on Apple platform APIs such as EventKit, Apple Mail, and Spotlight-backed file search, and it expects apfel to be installed locally for model execution.
Install with Homebrew
brew tap julianYaman/apfelclaw
brew install apfelclaw
The Homebrew formula can install the Node-based apfelclaw command tool, the separate chat app, and the Swift backend runtime together.
Prerequisites
- macOS 26 Tahoe or newer
- Node.js 18+
- Bun 1.0+ for local chat development or source builds
- Swift 6.3+ for backend development or source builds
apfelinstalled and available onPATH
apfelclaw inherits the same macOS baseline as apfel, because model execution is delegated to the local apfel server.
Run locally
- Install workspace dependencies:
bun install
- Run the CLI and complete onboarding:
./apfelclaw
The CLI runs the onboarding flow, can optionally set up Telegram remote control, and starts the backend in the background.
This launcher script runs the Node apfelclaw command tool from the repo root.
- If you want to run the chat app from source during development:
cd apps/tui
bun install
- Start the TUI client:
bun run dev
Or use the chat command through the CLI:
./apfelclaw chat
You can also use the root scripts:
./apfelclaw
./apfelclaw serve
./apfelclaw chat
npm run dev:server
npm run dev:tui
The backend keeps using apfel for model execution.
CLI commands
apfelclaw: onboarding on first run, then help and local statusapfelclaw setup: re-run the onboarding guideapfelclaw serve: run the backend in the foregroundapfelclaw chat: launch the terminal chat client when the backend is already runningapfelclaw stop: stop the managed backendapfelclaw --status: print backend, apfel, and remote-control statusapfelclaw --update: update apfelclaw and Homebrew-managed apfel
Development
API endpoints:
GET /healthGET /statusGET /configPATCH /configGET /toolsGET /sessionsPOST /sessionsGET /sessions/:id/messagesPOST /sessions/:id/messagesGET /sessions/:id/streamWebSocket stream for live session events
HTTP response headers:
Server: apfelclaw/0.2.2
Config API:
GET /configreturns flat global app config JSON:
{
"assistantName": "Apfelclaw",
"userName": "You",
"approvalMode": "trusted-readonly",
"debug": false
}
PATCH /configaccepts the same flat keys as optional fields and returns the updated config.- Supported
approvalModevalues arealways,ask-once-per-tool-per-session, andtrusted-readonly. debugis a boolean global flag for backend debug logging.- Empty or whitespace-only names are rejected. Name fields are trimmed and capped at 80 characters.
Contributor notes
- Config lives in
~/.apfelclaw/config.jsonand persists across server restarts. - Install state lives in
~/.apfelclaw/state.json. - SQLite memory lives in
~/.apfelclaw/memory.sqlite. - The current TUI is the first client; other clients can target the same local API later.
Ctrl+Ctriggers a graceful server shutdown before process exit.- The backend version is defined in Swift and is used for both the system prompt and the
Serverresponse header. - When
debugistrue, the server prints each HTTP request, theIntentRouterdecision for chat turns, and tool call arguments and results. - Runtime tools are defined in
packages/apfelclaw-server/TOOLS.mdand in the JSON catalog underSources/ApfelClawCore/Resources/tools.json.
Contributing
Contribution guidelines live in CONTRIBUTING.md. Please read that file before opening a pull request.
License
This project is available under the MIT License. See LICENSE.