Plugin Structure
Every Nicotine+ plugin consists of two required files in a dedicated folder:1
Create Plugin Folder
Create a new folder for your plugin. The folder name becomes the plugin’s internal name.
2
Create PLUGININFO File
Add a
PLUGININFO file with metadata about your plugin:The
Name field is the human-readable name shown in the UI, while the folder name is the technical identifier.3
Create __init__.py File
Create an
__init__.py file with your plugin class:4
Install and Enable
After creating your plugin files:
- Close and reopen the Preferences dialog if it’s open
- Go to Preferences → Plugins
- Find your plugin in the list and enable it
There’s no need to restart Nicotine+ when installing or updating plugins.
Plugin Lifecycle
Understanding the plugin lifecycle is crucial for proper initialization and cleanup:Initialization Sequence
Shutdown Sequence
Available Attributes
Your plugin class has access to several important attributes:string
Technical plugin name based on the folder name. Read-only.
string
Friendly plugin name from PLUGININFO. Read-only.
string
Folder path where plugin files are stored. Read-only.
PluginHandler
Reference to the PluginHandler instance. Read-only.
Config
Reference to global Config handler. Read-only.
Core
Reference to Core instance for accessing users, rooms, searches, etc. Read-only.
dict
Dictionary of plugin settings. Define in
__init__(), access in init() and later.dict
Metadata describing how settings should be displayed in the UI.
dict
Dictionary of commands provided by this plugin.
Plugin Settings
Plugins can define user-configurable settings that appear in the Preferences dialog:Supported Setting Types
bool- Checkboxinteger- Integer spinner with optional min/maxfloat- Float spinner with optional min/max/stepsizestring- Text inputlist string- List of stringsradio- Radio buttons with options tupledropdown- Dropdown menu with options tuple
Utility Methods
The BasePlugin class provides several convenience methods:Logging
Sending Messages
Displaying Local Messages
action, remote, local, hilite, command
Next Steps
API Reference
Explore all available events, notifications, and methods
Plugin Examples
Learn from real-world plugin implementations