plugin.toml

The manifest names your plugin, picks its tile size and says how to start it. Nook reads it once at start-up, or on every save in dev mode.

toml
id          = "weather"
name        = "Weather"
icon        = "cloud-sun"
size        = "wide"
run         = ["python", "main.py"]
mode        = "live"
hotkey      = "ctrl+alt+KeyW"
description = "Current weather for your city."
version     = "1.0.0"

Keys

KeyDefaultWhat it does
idrequiredUnique, 1 to 48 characters of a-z 0-9 - _. Nook stores it as plugin:<id> in its config.
namerequiredShown in the page header and the tile editor.
runrequiredProgram and arguments, e.g. ["node", "main.js"]. Runs in the plugin folder. A path like "bin/tool.exe" is resolved inside the folder; other names come from PATH.
icon"puzzle-piece"A Phosphor icon name, shown in the tile editor and on the default tile.
size"small"small (1x1), wide (2x1) or large (2x2). Users can resize it anyway.
mode"live"live keeps one process running; poll re-runs it. See How it works.
interval60Seconds between runs in poll mode (at least 1).
hotkeynoneA global shortcut, e.g. "ctrl+alt+KeyY". Pressing it sends you hotkey.
accepts_filesfalseWhile your page is open, files dropped on the notch are sent to you as files.
page_sizepanel size[width, height] in points. The panel grows to this while your page is open.
description, author, versionemptyInformation only. The version is written to Nook's log and the marketplace.

Space to draw in

Nook tells you the exact space in a layout message, since the user may resize your tile. The usual content sizes are:

TargetWidth × height (points)
small tile44 × 44
wide tile104 × 36
large tile104 × 104
page536 × 168

Environment

VariableValue
NOOK_PLUGIN_IDYour id.
NOOK_PLUGIN_DIRYour folder (also the working directory).
NOOK_DATA_DIR%APPDATA%\Nook\plugin-data\<id>. Save settings and data here, not in the plugin folder, so updates don't overwrite them.
NOOK_THEME, NOOK_ACCENTdark or light, and the accent as #RRGGBB.
NOOK_MODE, NOOK_PROTOCOL, NOOK_VERSIONlive or poll, 1, and Nook's version.
NOOK_EVENTPoll mode only: the event that caused this run, as JSON.

Python and Node also get PYTHONUNBUFFERED=1 and PYTHONIOENCODING=utf-8, so prints arrive right away.