A powerful Notepad++ plugin that integrates Large Language Model (LLM) capabilities using the OpenAI API, bringing AI-powered text processing directly into your favorite text editor.
- π― Custom Prompt: Enter any custom prompt for flexible AI interactions
- β¨ Enhance Text: Improve and refine your text while maintaining its original meaning
- π» Generate Code: Generate code based on descriptions or comments
- π Complete Text: Complete partial text naturally and contextually
- π Check Grammar: Check and correct grammar in your text
- π Translate Text: Translate text to English or other appropriate languages
- π Summarize Text: Create concise summaries of longer text
- Auto-Select All: If no text is selected, automatically processes the entire document
- Selection-Aware: Works with any selected text portion
- Unicode Support: Full support for international characters and languages
- Settings Dialog: Easy configuration of OpenAI API key with connection testing
- Input Dialog: Custom prompt feature with multi-line text input
- Error Handling: Clear error messages and robust operation
- Notepad++: Version 7.0 or later: 64-bit (x64), 32-bit (x86) or ARM64
- OpenAI API Key: Get one from OpenAI Platform
- Operating System: Windows 10 or later
- Architecture: each release has one zip per Notepad++ architecture (
_x64,_x86,_arm64). Use the one that matches your Notepad++. Plugins Admin picks it for you.
Once the plugin is accepted into the official nppPluginList, you can install it directly from Notepad++:
- Open Plugins β Plugins Adminβ¦
- On the Available tab, search for LLM Assistant
- Check the box and click Install β Notepad++ handles the download and future updates automatically
Maintainers: see packaging/PLUGINS_ADMIN_SUBMISSION.md
for how releases and the Plugins Admin listing are produced.
- Download the zip for your Notepad++ from the latest release (
_x64,_x86or_arm64) and extractLLMAssistant.dll - Create directory:
C:\Program Files\Notepad++\plugins\LLMAssistant\(32-bit Notepad++ on 64-bit Windows:C:\Program Files (x86)\Notepad++\plugins\LLMAssistant\) - Copy file: Place
LLMAssistant.dllin the created directory - Restart Notepad++
- Configure: Go to
Plugins > LLM Assistant > Settingsand enter your OpenAI API key
After installation, you should see "LLM Assistant" in the Plugins menu with 8 options:
- Custom Prompt
- Enhance Text
- Generate Code
- Complete Text
- Check Grammar
- Translate Text
- Summarize Text
- Settings
- Open a document in Notepad++
- Select text you want to process (optional - if nothing is selected, the entire document will be processed)
- Choose a function from
Plugins > LLM Assistant - Wait for the AI to process your request
- Review the result that replaces your original text
The Custom Prompt option allows maximum flexibility:
- Select
Plugins > LLM Assistant > Custom Prompt - Enter any prompt in the dialog (e.g., "Explain this code", "Make this more formal", "Fix any bugs")
- Your prompt will be combined with the selected text and sent to the AI
- The result replaces the original text
- "Refactor this code for better performance"
- "Convert this to Python"
- "Make this email more professional"
- "Explain what this function does"
- "Add error handling to this code"
- "Translate this to Spanish"
- Visual Studio 2022 or later (any edition, or Build Tools) with the "Desktop development with C++" workload
- Windows SDK (installed with that workload)
- For ARM64 builds only: the "MSVC Build Tools for ARM64/ARM64EC (Latest)" component (on Visual Studio 2022: "MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (Latest)"), added under Individual components in the Visual Studio Installer
- Git (for cloning the repository)
# Clone the repository
git clone <repository-url>
cd NotepadPlusPlus-LLM-Plugin
# Build the plugin
.\build.bat
# The compiled DLL will be in:
# x64\Release\LLMAssistant.dll
# Or build for 32-bit or ARM64 Notepad++:
.\build.bat x86 # Win32\Release\LLMAssistant.dll
.\build.bat arm64 # ARM64\Release\LLMAssistant.dllNotepad++ only loads a plugin built for its own architecture, so use the DLL that matches your Notepad++ (x64, x86 or ARM64).
The build script automatically:
- Finds the newest Visual Studio with the C++ tools (using
vswhere) - Sets up the build environment
- Compiles with the project's platform toolset (v145), or with the newest installed toolset if v145 is missing (for example v143 on Visual Studio 2022)
- Links required Windows libraries, and links the C/C++ runtime statically, so the DLL doesn't need the Visual C++ Redistributable installed
deploy.bat builds the x64 DLL the same way, then copies it into C:\Program Files\Notepad++\plugins\LLMAssistant\. Run it as Administrator. It closes Notepad++ the same way its close button does, so unsaved files are handled as usual: Notepad++ asks whether to save them, or, if session snapshot is on, keeps them in its backup for the next start. It won't copy anything while Notepad++ is still open.
The portable request, JSON, and UTF-8 regression tests use Catch2. Configure them with CMake:
cmake -S . -B CMakeBuild
cmake --build CMakeBuild
ctest --test-dir CMakeBuild --output-on-failureThe first configure downloads the pinned Catch2 release. The tests do not require Notepad++ or an OpenAI API key.
- Language: C++ using official Notepad++ plugin template
- API Integration: OpenAI GPT models via REST API
- HTTP Client: WinINet for native Windows compatibility
- JSON Processing: Custom lightweight JSON parser/builder (no external dependencies)
- Text Encoding: Full UTF-8 support for international text
- Memory Management: RAII principles with robust error handling
- Threading: Thread-safe singleton pattern for LLM service
LLMAssistant.dll
βββ PluginDefinition.cpp # Main plugin logic and menu handlers
βββ LLMService.cpp # OpenAI API integration
βββ SettingsDialog.cpp # Configuration UI
βββ SimpleJson.cpp # JSON parsing/building
βββ NppPlugin.cpp # Notepad++ plugin interface
βββ Resources # Dialog templates and constants
- Secure Storage: API keys stored in Windows registry with user-specific access
- HTTPS Only: All API communications use TLS encryption
- No Data Persistence: No text data stored locally by the plugin
- Memory Safety: Proper buffer management and cleanup
- Error Isolation: Exceptions contained within plugin boundaries
- Get an OpenAI API key from OpenAI Platform
- Open Notepad++
- Go to
Plugins > LLM Assistant > Settings - Enter your API key
- Click "Test Connection" to verify
- Click "OK" to save
API keys are stored in: HKEY_CURRENT_USER\Software\LLMAssistant\APIKey
Plugin doesn't appear in menu
- Ensure DLL is in correct directory:
C:\Program Files\Notepad++\plugins\LLMAssistant\ - Restart Notepad++ completely
- Check that the DLL matches your Notepad++ architecture (x64, x86 or ARM64). Notepad++ can't load a DLL built for another one. ? > About Notepad++ shows which one you have
"API key not configured" error
- Go to Settings and enter your OpenAI API key
- Use "Test Connection" to verify the key works
"No text available" error
- Open a document with text content
- The plugin needs text to process
Connection errors
- Check your internet connection
- Verify your OpenAI API key is valid and has credits
- Ensure firewall allows Notepad++ to make HTTP requests
If you encounter issues, check:
- Notepad++ version (should be 7.0+)
- Notepad++ architecture (x64, x86 or ARM64) matches the plugin zip you installed
- API key validity on OpenAI platform
- Available API credits/quota
This project is open source. See the source code for implementation details and licensing information.
Contributions are welcome! Areas for improvement:
- Additional LLM providers (Anthropic, Google, etc.)
- More predefined prompts
- Batch processing capabilities
- Plugin settings persistence
- Internationalization
For issues, questions, or feature requests:
- Check this README for common solutions
- Review the source code for technical details
- Create an issue in the project repository
- Include your Notepad++ version, Windows version, and error details
Made with β€οΈ for the Notepad++ community