How Plugins Work

What a Snakie plugin is, how Snakie runs it in a separate Python process, and what plugins can and cannot do

By Kevin McAleer,    5 Minutes

Page last updated November 21, 2026


Course Cover Image


Two programs talking

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:

  1. It looks in a folder for plugins
  2. It loads each one
  3. It waits for Snakie to ask for something
 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.


Your plugin never touches the editor

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?”


What goes in

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.


What plugins can’t do

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.


Where plugins live

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.


Why a separate program?

Three good reasons:

  • It’s real Python. Your plugin can use anything in Python’s standard library, such as re for patterns
  • A crash stays put. If your plugin has a bug, the host reports it. The editor carries on
  • It’s clear who runs what. Plugin code runs on your computer as you. Snakie tells you so at the top of the Plugins panel

Try it Yourself

  1. Open a terminal and type python3 --version (or python --version on Windows). You should see a version number starting with 3
  2. Find your home folder and look for .snakie. If Snakie has run before, it may already be there
  3. Create the plugins folder inside it if it’s missing

Common Issues

Problem: 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.


Check your understanding

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?

< Previous Next >

You can use the arrows  ← → on your keyboard to navigate between lessons.

Course complete

Congratulations, you finished Extend Snakie with Python Plugins!

That's all 13 lessons done. Let people know, it's a great way to inspire someone else to start.

Share card: I completed Extend Snakie with Python Plugins on KevsRobots
Post Bluesky LinkedIn Facebook


What are you looking for?
Watch Videos Get Ideas Learn Something Read a Review Read the Blog Search
... Z Z z