Local-first coding shell for Apple Foundation Models and Ollama.
apple-code is a Swift CLI assistant for local coding workflows on macOS. It runs on-device with Apple Foundation Models by default, and can switch to local Ollama models (including Qwen variants) with no cloud API dependency.
- Local providers only:
appleandollama - Fast settings menu in REPL:
/settingsorCtrl+P - Dynamic local Ollama model picker using
ollama list - Tool-calling support for filesystem, shell, web, browser, PDF, and Apple apps
- Session persistence, transcript history, and quick session switching
- Two UI modes (
classic,framed) and multiple built-in themes
- macOS 26+ (Tahoe) on Apple Silicon
- Xcode 26+ command line tools
- Swift toolchain with FoundationModels support
- Ollama installed locally for
--provider ollama
./scripts/install.shThen:
export PATH="$HOME/.local/bin:$PATH"
apple-codeInstaller options:
./scripts/install.sh --helpswift run apple-code
swift run apple-code "summarize this repo"# REPL
apple-code
# One-shot
apple-code "summarize this repo"
# Specific project directory
apple-code --cwd ~/projects/myappapple-code --provider appleexport OLLAMA_BASE_URL="http://127.0.0.1:11434"
export OLLAMA_MODEL="qwen3.5:4b"
apple-code --provider ollama --model qwen3.5:4bIf a model is missing:
ollama pull qwen3.5:4bIn REPL, /settings can prompt and run pulls for you.
apple-code [options] ["prompt"]
--system "..." Custom system instructions
--cwd /path/to/dir Working directory for file/command tools
--provider <name> Model provider: apple | ollama
--model <id> Model ID (ollama)
--base-url <url> Base URL for ollama (default: http://127.0.0.1:11434)
--ui <mode> UI mode: classic | framed
--timeout N Max seconds (default: 120)
--no-apple-tools Disable Apple app tools (Notes, Mail, etc.)
--check-apple-tools Run Apple app diagnostics and exit
--no-web-tools Disable dedicated web search/fetch tools
--no-browser-tools Disable browser automation tools
--run-web-fetch <url> Run webFetch tool directly and exit
--run-web-search "q" Run webSearch tool directly and exit
--run-web-limit N Result count for --run-web-search (default: 5)
--run-notes-action a Run notes tool directly and exit
--run-notes-query q Query/title for --run-notes-action
--run-notes-body b Body text for --run-notes-action
--security-profile p Security profile: secure | balanced | compatibility
--allow-path /path Additional allowed filesystem root (repeatable)
--allow-host host Allowed web host/domain (repeatable)
--allow-private-network Allow localhost/private network URLs
--dangerous-without-confirm Allow dangerous mutating actions without extra gate
--allow-fallback-execution Allow automatic refusal fallback tool execution
--verbose Show full output (disable summary mode)
-i, --interactive Force interactive mode
--resume <session-id> Resume a session
--new Start a new session
-h, --help Show help
Core:
/new,/n/sessions,/s/resume <id>/delete <id>/history [n]/show <id>/quit,/q
Settings and model control:
/settings/model,/m/ui [classic|framed]/theme <wow|minimal|classic|solar|ocean|forest>/session <id|next|prev>
Utility:
/cd <path>/clear,/c/help,/h
Compatibility:
:commandsare still supported
Hotkeys:
Ctrl+Popen settingsEsc (Ctrl+[)previous session chipCtrl+]next session chip- Arrow keys for inline editing/history
Ctrl+Jinsert newline in input
| Category | Tools |
|---|---|
| Filesystem | readFile, writeFile, listDirectory, searchFiles, searchContent, createPDF |
| Shell | runCommand |
| Apple apps | notes, mail, calendar, reminders, messages |
| Web | webSearch, webFetch |
| Browser automation | agentBrowser |
Check installed binary:
which apple-code
apple-code --helpValidate Apple app integrations:
apple-code --check-apple-toolsValidate Ollama:
ollama list
curl http://127.0.0.1:11434/api/tagsIf --provider ollama fails:
- Confirm Ollama is running locally
- Verify model exists with
ollama list - Set
OLLAMA_BASE_URLif using a non-default host/port
swift build
swift build -c release
swift test
./scripts/coverage.sh./scripts/coverage.sh enforces an 80% line-coverage gate on the unit-testable core modules and also prints full-project coverage for visibility.
Released under the MIT License. See LICENSE.

