Ghost Complete

approvedunreviewed

by James Hicks

Finish your thought with AI suggestions right at the cursor. Press Tab to take the whole line or Right Arrow to keep just the next word.

↓ 19 downloadsUpdated 3d agoMIT

Ghost Complete

Ghost Complete is a desktop Obsidian community plugin that shows inline AI ghost text while you write Markdown, in the same spirit as GitHub Copilot in VS Code.

It is not affiliated with or endorsed by Dynalist Inc. Obsidian is a trademark of Dynalist Inc.

Features

  • By default, type three characters before suggestions start. Moving the cursor, accepting a suggestion, or leaving the editor starts a new count. Set Minimum typed characters to 0 for automatic suggestions while navigating a note.
  • After a short pause (400ms by default), a grey suggestion appears at the cursor in the Markdown editor.
  • Tab inserts the suggested continuation of the current line. Additional lines from the provider are discarded. Right Arrow inserts the next word. Escape dismisses it.
  • Tab and Right Arrow keep their normal editor behavior when no suggestion is showing.
  • Typing or moving the cursor dismisses the current suggestion and, after another pause, requests a new one.
  • Providers: OpenRouter (default) and Groq. Each provider has its own base URL and its own API key. Link distinct secrets. The plugin blocks a shared secret ID and recognizable keys assigned to the wrong provider.
  • The provider dropdown fills in that provider's suggested model. The model stays a text field, so you can change the id.
  • Sends a limited window of text before the cursor and a smaller window after it. The prompt asks for the continuation only.
  • Continuing to type discards stale replies. A request already sent can finish and incur charges. At most two network requests can be outstanding. Rate-limited endpoints pause for Retry-After, or 30 seconds if unspecified.
  • A command, Toggle autocomplete, and a status-bar indicator turn autocomplete on and off. Click the status item to toggle it.

Install for manual testing

This repository does not commit main.js. Build it, or download the three files from a GitHub Actions artifact (or from a release once a version tag has been published).

npm install
npm run build

npm run build writes main.js in the plugin root and typechecks the project.

Copy these files into your vault:

  • main.js
  • manifest.json
  • styles.css

Destination:

<vault>/.obsidian/plugins/ghost-complete/

Reload Obsidian (or restart it). The plugin needs Obsidian 1.13.2 or newer. Open Settings → Community plugins, turn off Restricted mode if it is on, and enable Ghost Complete.

Set up a provider

Open Settings → Ghost Complete.

Autocomplete is on by default. Until the selected provider has a key, the status bar reads Ghost: no key and no request is sent.

OpenRouter

  1. Create a key at openrouter.ai/keys.
  2. Choose OpenRouter. The plugin calls https://openrouter.ai/api/v1/chat/completions and fills the model with google/gemini-2.5-flash-lite (a current low-latency, low-cost model; thinking is off by default).
  3. Choose OpenRouter API key and link a secret from Obsidian's secret storage. Paste the key into that secret, not into plugin data. Only the secret id is saved in data.json. Test connection reports whether a key was found, the HTTP status, and the provider's error without showing the key.

Groq

  1. Create a key at console.groq.com/keys.
  2. Choose Groq. The plugin calls https://api.groq.com/openai/v1/chat/completions and fills the model with openai/gpt-oss-20b (Groq's current fast, inexpensive production chat model). llama-3.1-8b-instant is no longer the developer-tier default.
  3. Link a different secret for Groq API key. That secret is separate from the OpenRouter one and is sent only to Groq.

You can edit the model id after choosing a provider. Changing the provider again replaces the model with that provider's suggested default.

Then open a note in Source mode or Live Preview and type. After the debounce, grey ghost text appears at the cursor.

KeyWhen a suggestion is showingOtherwise
TabInsert the whole suggestionNormal editor behavior
Right ArrowInsert the next wordMove the cursor
EscapeDismiss the suggestionNormal editor behavior

The status bar shows Ghost on, Ghost… while a request is in flight, Ghost off, Ghost: no key, or Ghost: error.

What is sent to the provider

Ghost Complete needs a network connection because the suggestion is generated by the provider you select. It sends:

  • the model id, a short instruction, and a window of note text around the cursor (default 2000 characters before and 400 after)
  • the API key for the selected provider, in the Authorization header

OpenRouter can forward note text to an underlying model host. Retention depends on your provider and account settings. Add private folders under Excluded folders, one vault-relative path per line, to exclude their subfolders and notes. The plugin has no telemetry. Plugin data stores only the secret id. The plugin reads the selected secret into memory to authenticate requests. Ordinary autocomplete errors show local status messages. Recent suggestions and their surrounding text are cached in memory and cleared when settings change or autocomplete is disabled. If no secret resolves, no request is sent.

Debounce, max tokens, and the two context sizes are in the settings tab.

Development

Use Node.js 22.13 or later in the 22.x line, or Node.js 24 LTS, for development.

npm install
npm test
npm run build

npm test covers suggestion post-processing, word-by-word accept, the in-memory cache, debounce, and cancellation of stale requests. npm run dev rebuilds main.js while you edit.

Releasing

Bump version in manifest.json and add the same version to versions.json (minimum Obsidian version). You can use npm version patch after updating minAppVersion; version-bump.mjs updates both files.

Tag the commit with that version and no leading v:

git tag -a 0.1.0 -m "0.1.0"
git push origin 0.1.0

The GitHub Actions workflow builds the plugin on pulls and on main. On a version tag that matches manifest.json, it creates a draft GitHub release with main.js, manifest.json, and styles.css attached. Routine builds use a read-only repository token. A separate job attaches and attests the validated tag build with release permissions. Publish the draft after you add release notes.

The release tag must match manifest.json exactly. Obsidian's community list uses that tag, without a v prefix.

License

MIT © James Hicks

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.