By Kevin McAleer, 5 Minutes
Page last updated November 21, 2026

When you open the Snakie desktop app, it quietly starts a second program: a plugin host. The host is plain Python, run by the Python 3 that’s installed on your computer.
The host does three jobs:
Snakie (the editor) Plugin host (Python)
+---------------------+ request +----------------------+
| "run the command | ----------> | finds your function |
| called clubkit.hi" | | and calls it |
| | <---------- | |
| shows the message | answer | returns a message |
+---------------------+ +----------------------+
Snakie sends a request such as “run this command on this file”. The host calls your Python function and sends back the answer. Snakie then acts on it.
This is the most important idea in the course. Your function doesn’t reach into Snakie and change things. It returns a description of what it wants, and Snakie does the work.
| Your function returns | Snakie does |
|---|---|
| a message | shows it in the Plugins panel |
| an edit | replaces the text of the open file |
| a status | shows it in the status bar |
| a list of problems | draws squiggles in the editor |
| a list of blocks | adds them to the Blocks toolbox |
That keeps plugins simple. A command is a function that takes the current file and returns one or more of those things. You can understand every plugin in this course by asking “what goes in, and what comes back?”
Every command and linter receives a context, usually called ctx. It describes the file that’s open in the editor.
| Value | What it holds |
|---|---|
ctx.file.name |
the file name, such as patrol.py |
ctx.file.path |
where the file is saved |
ctx.file.source |
"local" for your computer, "device" for a file on a board |
ctx.file.content |
all the text in the editor, as one string |
ctx.file.content is the one you’ll use most. It’s the text as it is in the editor right now, including changes you haven’t saved.
A plugin can’t talk to the board. It doesn’t run your MicroPython, flash firmware or read sensors. It works on text: the program in the editor.
That’s less limiting than it sounds. Most mistakes can be spotted by reading the code, and that’s exactly what a plugin is good at.
Snakie loads plugins from a folder in your home folder called .snakie/plugins.
| System | Folder |
|---|---|
| Windows | C:\Users\<you>\.snakie\plugins |
| macOS | /Users/<you>/.snakie/plugins |
| Linux | /home/<you>/.snakie/plugins |
A plugin is either a single file in there, such as clubkit.py, or a folder with an __init__.py inside, such as clubkit/__init__.py. We’ll use a folder so there’s room to grow.
The folder name starts with a dot, so your file manager may hide it. On macOS press Cmd + Shift + . in Finder. On Windows turn on Hidden items in the View menu. On Linux press Ctrl + H.
Three good reasons:
re for patternspython3 --version (or python --version on Windows). You should see a version number starting with 3.snakie. If Snakie has run before, it may already be thereplugins folder inside it if it’s missingProblem: python3 isn’t recognised.
Solution: Install Python 3 from python.org. On Windows, tick Add Python to PATH in the installer.
Why: Snakie looks for python3, then python, on your system’s PATH. No Python means no plugin host.
Problem: I can’t see the .snakie folder.
Solution: Show hidden files, or create it yourself. In a terminal, mkdir -p ~/.snakie/plugins works on macOS and Linux.
Why: Names starting with a dot are hidden by default.
Quick quiz 1 of 3
What runs your plugin code?
Quick quiz 2 of 3
How does a command change the text in the editor?
Quick quiz 3 of 3
Which value holds the text of the open file?
You can use the arrows ← → on your keyboard to navigate between lessons.
Comments