InplaceAI is a macOS menu bar assistant that rewrites the text you have selected in any app using LLM. Trigger it with ⌥⇧R (or the menu bar command) and it captures the selected text through the Accessibility API, sends it to the configured model, then shows an inline bubble with the suggested rewrite so you can accept it in-place.
- System-wide: works in any text field that exposes accessibility text (Mail, Notes, Outlook, etc.).
- Inline suggestions: a floating bubble preview shows the before/after diff and lets you replace text without switching apps.
- Configurable AI: paste your OpenAI key once (stored locally in the app’s preferences), pick a model, and fine-tune the rewrite instruction.
- Privacy-aware: only the raw selection is sent to OpenAI—nothing is masked or pre-processed—so you can see exactly what leaves your machine.
- macOS 13 Ventura or newer.
- Xcode command-line tools or Xcode 15+.
- An OpenAI API key with access to the chosen model.
- Accessibility permission for InplaceAI (System Settings ▸ Privacy & Security ▸ Accessibility).
git clone <repo>
cd InplaceAI
swift build # or open with `xed .` / Xcode
swift runThe first launch prompts for Accessibility permission. Add your API key and model under Preferences (Status bar ▸ Preferences…). The default prompt rewrites text with better grammar while preserving intent—tweak it to match your tone.
Use a currently supported OpenAI chat model (default: gpt-5-nano); suggested options include gpt-5-mini, gpt-5.1, gpt-4.1-mini, and gpt-4.1, or any other available chat/completions model.
- In Preferences, set Provider to Custom (OpenAI-compatible URL) or Local (Ollama/LM Studio); update base URL/model as needed.
- API key is only required for the OpenAI provider; for local/custom, leave it blank if your endpoint doesn’t need one.
- Select text in any macOS app.
- Press
⌥⇧R(or choose Rewrite Selection from the menu bar icon). - Review the inline suggestion bubble:
- Replace injects the rewrite directly (falls back to clipboard + paste if direct replacement fails).
- Dismiss closes the bubble without changes.
- SwiftUI App + NSStatusItem for lightweight menu bar residency (
InplaceAIApp,StatusBarController). - Accessibility bridge (
SelectionMonitor,AccessibilityAuthorizer) watches the focused text element and replaces text via AX APIs. - AI client (
OpenAIService) callschat/completions, parameterized by the user’s model/instruction. - State & storage (
AppState,SettingsStore) handle API keys, prompt presets, and orchestrate rewrite tasks. - Inline UI (
InlineSuggestionWindow,SuggestionBubbleView) renders the floating revision bubble and manages accept/dismiss actions. - Global shortcut (
HotkeyController) registers the⌥⇧Rtrigger using Carbon hotkeys so the workflow stays in-app.
- Use
swift build/swift runfor iterative development. If sandboxed environments block SwiftPM caches, pointSWIFTPM_CONFIGURATION_PATHandSWIFTPM_CACHE_PATHto writable directories before building. - Accessibility APIs require a signed release/
codesign --deep -s -build when distributing to other machines. - When testing text replacement, verify both AX replacement and the clipboard fallback (e.g., in apps that block AX writes such as some browsers).
Use the helper script to build, sign, (optionally) notarize, and package a DMG:
# From repo root
CODESIGN_ID="Developer ID Application: Your Name (TEAMID)" \
NOTARY_PROFILE=your-notarytool-profile \ # omit to skip notarization
./scripts/build_dmg.shNotes:
- DMG lands in
dist/InplaceAI.dmg; app bundle is staged indist/InplaceAI.app. - Default build is arm64 only; set
BUILD_ARCHS="--arch arm64 --arch x86_64"for a universal build. - For testing without distribution, set
CODESIGN_ID="-"to ad-hoc sign and skipNOTARY_PROFILE.
- A simple icon lives at
Assets/InplaceAIIcon.svg(navy base with teal rewrite mark). Resize or export to.icns/.pngas needed for macOS app and status bar assets.
- Streamed suggestions for faster feedback.
- AppleScript/Shortcuts intents to expose rewrite actions to automation.
- More providers (local LLMs, Azure OpenAI) via pluggable adapters.