Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

AI Rewrite

masaki39masaki3922 downloads

Local-first, line-level AI rewriting: proofread, translate, or your own custom modes. Shows a ghost preview below the line; Tab to apply.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates3

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. ✨

AI Rewrite demo — proofread a line, then switch mode and translate
  • ✍️ Rewrites the current line or selection on demand — not next-word autocomplete.
  • 👻 Shows the result as a ghost preview below the line. Tab applies, Esc dismisses.
  • 🎛️ Ships with Proofread and Translate modes — add your own.
  • 🔌 Works with any OpenAI-compatible server: Ollama, LM Studio, OpenAI, OpenRouter…

[!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.

🚀 Quick start

  1. Install Ollama and pull a model: ollama pull gemma3
  2. Make sure Ollama is running (ollama serve — usually automatic).
  3. Install and enable AI Rewrite. It defaults to http://localhost:11434/v1 with model gemma3.
  4. Put the cursor on a line, run Correct current line or selection from the command palette, and press Tab to accept.

[!NOTE] Using a different model? Set it under Settings → AI Rewrite → Model.

⚙️ How it works

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
  • Reads the current line (or your selection) and shows the model's reply as a ghost preview.
  • Markdown prefixes are preserved — indentation, - , > , # , 1. , - [ ] — so the model only sees the prose.
  • Blank lines are skipped. With a selection, the whole selection (multiple lines) is rewritten and replaced on accept.

🎛️ Modes

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

  • Click the active mode in the status bar and pick from the menu.
  • Run Cycle mode to jump to the next one (bind it to a hotkey).
  • Each mode also gets an Apply … command — bind it in Settings → Hotkeys to switch mode and rewrite in one press.

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.

⚡ Triggers

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

🔗 Auto-link existing notes

Off by default. When enabled, the plugin wraps text matching an existing note title or alias in [[wiki links]] after a rewrite.

  • Case-insensitive; links the first occurrence per note.
  • Skips code, URLs, and existing links.
  • Leaves ambiguous names (claimed by more than one note) alone.

Turn it on under Settings → Auto-link existing notes.

⌨️ Keys

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).

🌐 Other servers

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 Bearer token.

[!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.

📋 Commands

Run from the command palette or bind a hotkey:

  • Correct current line or selection — rewrite with the active mode
  • Apply <mode> to current line or selection — switch to that mode, then rewrite
  • Cycle mode — switch to the next mode
  • Toggle suggestions — turn the plugin on or off
  • Test connection — send a short request with the current settings
💾 Manual install

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.

Key name reference

Accept/dismiss keys use CodeMirror key names:

  • Key name = the value of 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.
  • Modifiers prefix the key, joined with -: Mod- (Cmd on macOS, Ctrl elsewhere — best for cross-platform), Ctrl-, Shift-, Alt-, Cmd- / Meta-.
  • Multiple bindings are separated by spaces.

Examples: Tab ArrowRight · Escape · Ctrl-Space · Mod-Enter · Shift-Tab

[!NOTE] Full format: CodeMirror key bindings.

🛠️ Development

This project uses pnpm.

pnpm install   # install dependencies
pnpm dev       # development build (non-minified, inline sourcemaps)
pnpm build     # production build -> main.js (minified)

📄 License

MIT

HealthExcellent
ReviewPassed
About
Rewrite the current line or a selection with local AI (Ollama) and preview the suggestion as a ghost line below; press Tab to apply or Esc to dismiss. Preserve Markdown prefixes, offer Proofread and Translate modes, and trigger on demand, on line leave, or while typing.
AIWritingAutomation
Details
Current version
0.0.3
Last updated
2 days ago
Created
3 days ago
Updates
3 releases
Downloads
22
Compatible with
Obsidian 1.1.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Sponsor
Ko-fi
Author
masaki39masaki39
github.com/masaki39
GitHubmasaki39
  1. Community
  2. Plugins
  3. AI
  4. AI Rewrite

Related plugins

Text Generator

Generate text content using GPT-3 (OpenAI).

Smart Composer

AI chat with note context, smart writing assistance, and one-click edits for your vault.

Local GPT

Local Ollama and OpenAI-like GPT's assistance for maximum privacy and offline access.

Karpathy LLM Wiki

Karpathy's LLM Wiki implementation - multi-page knowledge generation with entity/concept pages and conversational query.

ChatGPT MD

A seamless integration of ChatGPT, OpenRouter.ai and local LLMs via Ollama into your notes.

Smart Templates

AI powered templates for generating structured content. Works with Local Models, Anthropic Claude, Gemini, OpenAI & more.

Templater

Create and use dynamic templates.

BRAT

Easily install a beta version of a plugin for testing.

Smart Connections

Find related notes and excerpts while writing. Your AI link building copilot displays relevant content in graph + list view. A local embedding model powers semantic search. Zero setup. No API key.

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.