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 recommended)
- OpenAI API Key: Get one from OpenAI Platform
- Operating System: Windows 10 or later
- Architecture: 64-bit Windows (plugin compiled for x64)
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 plugin:
LLMAssistant.dll - Create directory:
C:\Program Files\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 with C++ development tools
- Windows 10 SDK (latest version)
- 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.dllThe build script automatically:
- Detects Visual Studio 2022 installation
- Sets up the build environment
- Compiles with platform toolset v143
- Links required Windows libraries
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 if you have 64-bit Notepad++ (plugin is compiled for x64)
"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+)
- Windows architecture (plugin requires 64-bit)
- 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