# Extreme Editor [![Build](https://github.com/Forget-C/extreme-editor/actions/workflows/lint.yml/badge.svg)](https://github.com/Forget-C/extreme-editor/actions/workflows/lint.yml) [![Obsidian 1.11.5+](https://img.shields.io/badge/Obsidian-1.11.5%2B-7C3AED?logo=obsidian&logoColor=white)](https://obsidian.md) [![Desktop and mobile](https://img.shields.io/badge/platform-desktop%20%7C%20mobile-2563EB)](manifest.json) [![License: MIT](https://img.shields.io/badge/license-MIT-16A34A)](LICENSE) English | [简体中文](docs/README.zh-CN.md) Extreme Editor is a lightweight text optimization plugin for Obsidian. It selects a prompt based on the current note's folder and uses an LLM to optimize the text. ![Optimize text](docs/images/optimize.png) ## Features - Configure an OpenAI-compatible provider with a Base URL, API key, model, and custom headers. - Optimize selected text or an entire note. - Automatically select prompts through folder-to-prompt bindings. Subfolders inherit their parent folder's binding, and the most specific binding takes priority. | Provider configuration | Prompt management | Folder bindings | | --- | --- | --- | | ![Provider configuration](docs/images/provider.png) | ![Prompt management](docs/images/prompt.png) | ![Folder bindings](docs/images/binding.png) | ## Configuration 1. Open **Settings → Extreme Editor**. 2. In the **Provider** tab, enter the API base URL, such as `https://api.openai.com/v1`. 3. Select or create an Obsidian Keychain entry for the API key, then enter the model name. If additional request headers are required, enter them as a JSON object. 4. Select **Test** to verify the current configuration. This sends one minimal model request and may incur service charges. 5. In the **Prompts** tab, create prompts and set the default prompt. 6. In the **Folder bindings** tab, select a folder from the current vault's folder tree and associate it with a prompt. You can also select the vault root. 7. Search for **Extreme Editor** in Obsidian's hotkey settings and assign a hotkey to the plugin. Custom header example: ```json { "X-Api-Key": "value" } ``` ## Usage 1. Select text in the Markdown editor, or leave the selection empty to process the entire note. 2. Open the command palette and run **Extreme Editor: Optimize text with prompt**. To use a hotkey, assign one under **Settings → Hotkeys**. 3. Confirm the prompt shown at the top of the dialog, then select **Optimize**. Temporarily switching prompts does not change the folder binding. 4. Preview the result and, if necessary, edit the text on the right. 5. Select **Apply** to write the result back, or select **Cancel** to close the dialog without modifying the note. ## Privacy and external services - The plugin does not scan or send vault content at startup and includes no telemetry or analytics. - Only when you explicitly select **Optimize** are the current selection or entire note, the active prompt, the model name, and authentication headers sent to your configured provider. - Selecting **Test** sends only minimal text for connection verification. - The API key is stored through Obsidian's Keychain (`SecretStorage`); plugin data contains only the selected secret ID. Other settings, including custom header values, remain in the current vault's plugin data, so do not place credentials in custom headers. - Closing the dialog while a request is in progress discards the returned result and does not modify the note. ## Development The plugin requires Obsidian 1.11.5 or later. The development environment requires Node.js 18 or later and npm: ```bash npm install npm test npm run lint npm run build ``` `npm run build` generates `main.js` in the project root. Local installation and releases require `main.js`, `manifest.json`, and `styles.css`. For local installation, place these three files in `/.obsidian/plugins/extreme-editor/`, reload Obsidian, and enable the plugin under **Settings → Community plugins**. For detailed product and implementation decisions, see [`docs/plugin-design.md`](docs/plugin-design.md).