masaki3922 downloadsLocal-first, line-level AI rewriting: proofread, translate, or your own custom modes. Shows a ghost preview below the line; Tab to apply.
Line-level AI rewriting for Obsidian — proofread, translate, or run your own modes. Tuned to run well on small, local models (Ollama by default), so it stays fast, private, and easy on your machine. ✨
[!TIP] Why line-level? Correcting one line is easy work for a small model like
gemma3, and triggering on demand keeps your machine cool — that's the whole design.
ollama pull gemma3ollama serve — usually automatic).http://localhost:11434/v1 with model gemma3.[!NOTE] Using a different model? Set it under Settings → AI Rewrite → Model.
i beleive their going too the meeting ← your line (typos)
↓ trigger (hotkey · on leave · while typing)
I believe they're going to the meeting ← ghost preview · Tab applies · Esc dismisses
- , > , # , 1. , - [ ] — so the model only sees the prose.A mode is just an editable instruction sent to the model. Two ship by default:
| Mode | What it does |
|---|---|
| Proofread | Fix spelling, grammar, punctuation and typos — same language, same meaning |
| Translate | Translate into your target language |
Switch modes
Add your own
Create modes under Settings → Modes (name + prompt). Put {targetLang} in a prompt to fill in the Target language setting. Adding or removing a mode takes effect after a reload.
Set under Settings → Trigger:
| Trigger | When it fires | Best for |
|---|---|---|
| On demand (default) | Only when you run a command/hotkey | Least noise, lowest CPU |
| When leaving a line | After you move off a line | Hands-off proofreading |
| While typing | After a short pause | Most eager |
Off by default. When enabled, the plugin wraps text matching an existing note title or alias in [[wiki links]] after a rewrite.
Turn it on under Settings → Auto-link existing notes.
| Key | Action |
|---|---|
| Tab / → | Apply the suggestion |
| Esc | Dismiss |
Keys only intercept while a preview is showing; otherwise they behave normally. Change them under Settings → Accept keys / Dismiss keys (space-separated CodeMirror key names).
AI Rewrite talks to any OpenAI-compatible endpoint — set the Base URL under Settings → Connection.
| Setup | What to set | Privacy |
|---|---|---|
| Local, no auth — Ollama, LM Studio, vLLM | Base URL | Stays fully local |
| Remote, authenticated — OpenAI, OpenRouter | Base URL + API key | Note content leaves your machine |
[!WARNING] Pointing the Base URL at a remote service sends your note content to that service — it's no longer local-only. The API key is sent as a
Bearertoken.
[!NOTE] A
⟳shows in the status bar while a request runs. Each request gives up after the Request timeout (default 30s) so a stalled model can't jam later suggestions — raise it if a slow model's first response gets cut off.
Run from the command palette or bind a hotkey:
Copy main.js, manifest.json (and styles.css if present) into your vault:
<Vault>/.obsidian/plugins/ai-rewrite/
Then reload Obsidian and enable the plugin in Settings → Community plugins.
Accept/dismiss keys use CodeMirror key names:
event.key for that key — look it up by pressing the key on keycode.info (e.g. Tab, Enter, Escape, ArrowRight, a, 1). The space bar is written Space.-: Mod- (Cmd on macOS, Ctrl elsewhere — best for cross-platform), Ctrl-, Shift-, Alt-, Cmd- / Meta-.Examples: Tab ArrowRight · Escape · Ctrl-Space · Mod-Enter · Shift-Tab
[!NOTE] Full format: CodeMirror key bindings.
This project uses pnpm.
pnpm install # install dependencies
pnpm dev # development build (non-minified, inline sourcemaps)
pnpm build # production build -> main.js (minified)
MIT