Ivan Batura92 downloadsUse Copilot, Claude, Gemini, or a local CLI tool to generate AI results directly inside the current note.
Run any LLM from inside your note. Select text, hit a hotkey, get the result inserted in place — with [[wikilinks]] automatically expanded, your own system prompts, and support for multiple named connections across five provider types.
Status: desktop-only · Obsidian ≥ 1.5.0 ·
id: ask-any-ai
Ctrl/Cmd+P).## AI Result heading.Two commands share the same core pipeline:
.md file from your prompts folder. The file body becomes the system prompt; its YAML frontmatter can override per-run settings (model, provider, insertion position, and more).Both commands:
[[wikilinks]] in the input — [[Note]], [[Note#Heading]], or [[Note#^block]] — replacing them with the linked content before anything is sent to the LLM.A persistent progress notice shows where you are in the pipeline and how long it has taken.
claude, llm, gemini, …).ai-llm, ai-model, ai-insert-position, and other ai-* YAML keys to any template file to override plugin settings for that single invocation. Invalid values warn and fall back gracefully; global settings are never mutated.#A#B) and block references (#^id).Untitled*, Daily/*, …) and optional alias rendering so the LLM can emit wikilinks that resolve.AI Result, leave blank to disable, or use any heading you like.child_process, so the plugin is desktop-only.PATH (claude, llm, gemini, or any tool that reads from stdin and writes to stdout).Settings → Community plugins → Browse, search for Ask Any AI, install, enable.
main.js, manifest.json, and styles.css from a release.<Vault>/.obsidian/plugins/ask-any-ai/.Open Settings → Ask Any AI. The settings tab has four sections.
Manage one or more named LLM connections. Each connection has:
ai-llm: <Name>.Copilot, Claude, Claude (proxy), Gemini, or Local CLI.gpt-4.1-mini, claude-sonnet-4-20250514, gemini-2.0-flash). Claude proxies require an explicit model (e.g. anthropic/claude-3.7-sonnet for OpenRouter).| Provider | Fields |
|---|---|
| Copilot | Base URL + API key |
| Claude | Base URL (defaults to https://api.anthropic.com) + API key |
| Claude (proxy) | Base URL + API key (Bearer token) |
| Gemini | Base URL (defaults to https://generativelanguage.googleapis.com) + API key |
| Local CLI | Command, optional args, optional working directory |
ai-llm.Use + Add connection to create additional connections. Use Request timeout to set the maximum wait time for CLI responses.
.md files (default: Prompts/AI).When the include-system-prompt toggle is on, Ask AI with template prepends the inline prompt before the template body.
Optional. When on, the plugin appends a Markdown block listing every note in the vault to the system prompt, plus an instruction telling the LLM to wrap matches in [[...]]. Exclusions is a list of glob patterns:
Untitled* — any note starting with "Untitled".Screenshot* — any clipboard-image note.Daily/2024-* — folder-scoped pattern (uses /).Include note aliases — when enabled, each note's frontmatter aliases are listed alongside it (Note Name (aka: alias1, alias2)), letting the LLM use either name.
After selection (default), At cursor, or End of file.Select text in any note and run Ask AI from the command palette (Ctrl/Cmd+P). If the selection is empty, the current line is used.
You can bind the command to a hotkey under Settings → Hotkeys.
Imagine Project Brief.md exists in your vault. In a different note, type and select:
Summarise [[Project Brief]] in three bullets.
When you run the command:
[[Project Brief]] is replaced with the full content of Project Brief.md.## AI Result (or your configured heading).Run Ask AI with template to open a modal showing every .md file in your prompts folder plus a "None" option. Pick a file to use it as the system prompt for this invocation only — no settings are mutated.
Add ai-* YAML keys to the template's frontmatter to override settings for that single run:
---
ai-llm: Work Claude
ai-model: claude-haiku-4-5-20251001
ai-result-heading: Translation
ai-insert-position: end-of-file
ai-include-note-names: true
---
You are a professional translator. Translate the following to French.
ai-llm selects a connection by name; ai-model overrides its model for this run. Supported keys: ai-llm, ai-model, ai-result-heading, ai-insert-position, ai-debug, ai-include-inline-prompt, ai-include-note-names, ai-include-note-aliases.
Invalid values warn and fall back to the global setting; the warning is shown in a single notice. See documentation/03-features/template-overrides.md for the full reference.
| Provider | Endpoint | Wire format | Auth |
|---|---|---|---|
| Copilot | <baseUrl>/v1/chat/completions |
OpenAI Chat Completions | Authorization: Bearer <key> |
| Claude | <baseUrl>/v1/messages |
Anthropic Messages | x-api-key: <key> |
| Claude (proxy) | <baseUrl>/v1/chat/completions |
OpenAI Chat Completions | Authorization: Bearer <key> |
| Gemini | <baseUrl>/v1beta/models/<model>:generateContent |
Gemini generateContent |
API key in query string |
| Local CLI | subprocess | systemPrompt + "\n\n" + userContent piped to stdin |
— |
For the local CLI provider, the plugin spawns the configured command with shell: false. Args are split on whitespace; complex quoting requires a wrapper script.
<Vault>/.obsidian/plugins/ask-any-ai/data.json).documentation/.AGENTS.md.npm install
npm run dev # esbuild watch — rebuilds main.js on every change
npm run build # tsc --noEmit + esbuild production build
npm test # vitest run
npm run lint # eslint
To test inside a vault, symlink the repo into <Vault>/.obsidian/plugins/ask-any-ai/, run npm run dev, and reload Obsidian (Ctrl/Cmd+R) after changes.
See AGENTS.md for the full project conventions.