uFlow guidesPlugin API 1
Develop a uFlow plugin
The uFlow plugin API lets you extend the game browser, register content types, and run tools in the background.

Plugins can also add menu commands, native dialogs and settings, save data between sessions, and supply media. Players install a single .ufplugin file and find its commands and settings under Settings → General → Plugins.
Availability. Plugin API 1 is available in stable uFlow 2026.12.4. Open Settings → General → Plugins to install a plugin and configure its settings. Earlier preview builds support only a subset of these features. GameTDB also works on the earlier media-provider preview.
Write your first plugin
Library Bookmark adds two commands. One remembers the selected game. The other selects that game again when it is in the current view. Save the following as LibraryBookmark.ufplugin in UTF-8 without a BOM. You can also download the installable example.
-- uFlow plugin 1
return {
api = 1,
id = "library-bookmark",
name = "Library Bookmark",
version = "1.1",
settings = {
{ id = "show-name", label = "Show game name", enabled = true }
},
actions = {
{ id = "remember", label = "Bookmark current game" },
{ id = "recall", label = "Go to bookmarked game" }
},
run = function(action, view, state)
if action == "remember" then
local game = view.game(view.selected)
if not game then return "Select a game first." end
if game.entryKey == "" then return "This entry has no persistent identity." end
state.key = game.entryKey
state.title, state.library = nil, nil
if isEnabled("show-name") and #game.name <= 160 then
return "Bookmarked: " .. game.name
end
return "Bookmark saved."
end
if not state.key and not state.title then return "Save a bookmark first." end
local index
if state.key then index = view.findKey(state.key)
else index = view.find(state.title, state.library) end
if index then
return { select = index, message = "Bookmarked game selected." }
end
return "The bookmarked game is outside the current library view."
end
}
Install and test
- Copy
LibraryBookmark.ufplugintoSD:/wiiu/apps/uFlow/plugin-inbox/. Create the folder if needed. - Select a game in your library. Open Settings → General → Plugins → Install plugin from SD and choose the file.
- Open Library Bookmark → Bookmark current game. Back out, browse to another title, then open Library Bookmark → Go to bookmarked game. Return to the library to see the selection.
- Under Library Bookmark → Settings, turn Show game name off and try bookmarking again. The confirmation now reads “Bookmark saved.”
- To update a plugin, replace its inbox file and install it again. Keeping the same plugin ID and setting IDs preserves user data. Uninstalling unregisters the commands. Preferences, the plugin’s saved state, and any media it downloaded stay on the SD.
For host regression tests on Linux, install a C++20 compiler, a C compiler, and the development packages for libcurl, libpng, libturbojpeg and zlib. From the source checkout run sh tools/test-plugin-api.sh /path/to/GameTDB.ufplugin. Append live to also test real GameTDB transfers. The test uses a temporary library and both bundled examples.
Try the browser and launcher features
Install LibraryTools.ufplugin from the same inbox. Open Find / Sort in the game browser. Select Developer, then title, Filter: With publisher, or Subtitle: Publisher and year. Each selection applies independently. Choose Filter: All games or Subtitle: Off to clear it. Longer menus scroll with the D-pad.
Under Settings → Library, add a content directory and select DS homebrew, point it at a directory containing your own .nds files, and scan. Library Tools declares the existing noods launcher as its default. Configure that launcher under Settings → Launchers before playing. Users can choose a different launcher for a content type, directory or individual title.
Open General → Plugins → Library Tools → Count publishers. Press B to dismiss the confirmation or choose Start count. You can leave the menu while it runs. Reopen the plugin to see progress or cancel an active count. Last publisher count reads the most recent successful result.
API 1 reference
A .ufplugin is a Lua 5.4 text program of up to 256 KiB. Its first line is -- uFlow plugin 1. Return a descriptor table with the fields below. Declare the capabilities your plugin uses. At least one of actions, filters, sorts, subtitles, jobs, contentTypes or media is required.
| Field | Contract |
|---|---|
api, id |
Integer 1 and a unique stable ID of 1–64 lowercase ASCII letters, digits, or hyphens. |
name, version |
User-facing strings of up to 80 and 32 bytes respectively. |
settings |
Optional list of up to 16 switches with unique id, label, and boolean enabled default. Read the saved value with isEnabled(id). |
actions |
Up to 16 commands, in display order. Each has a unique id (1–48 lowercase letters, digits, or hyphens) and a nonempty label (up to 96 bytes). |
run(actionId, view, state, choice) |
Required when declaring actions. uFlow calls it when the user activates a command. |
filters, sorts, subtitles |
Up to 16 named entries per list, each with an id, a label, and the callback described below. |
contentTypes |
Up to 16 file-based library definitions. Each has an id, name, extensions and an existing launcher ID. |
jobs |
Up to 16 user-started background utilities. Each has an id, label and run callback. Jobs and actions share a command ID namespace. |
media |
Optional provider table. Registering it adds a download action to Settings → Media and the plugin’s own menu. |
Library and selection
| Field or function | Result |
|---|---|
view.count, view.selected |
Number of games in the current filtered and sorted view, and the one-based selected position. An empty view has count and selection zero. |
view.game(i) |
A table with entryKey, name, titleId, libraryId, publisher, developer, genre, region, year, players, favorite and installed. An out-of-range index returns nil. Game data is read-only from the host’s perspective. |
view.find(titleId, libraryId) |
One-based position of the first matching game in this view, or nil. Store identifiers to remember a game across sessions because positions can change. |
view.findKey(entryKey) |
Find a saved entry in the current view, including file-based ROMs with no title ID. Save the opaque game.entryKey returned by uFlow. It identifies the library and installed title or file location. Moving a ROM or assigning it to another library gives it a new key. |
view.language |
Console language tag, such as en or fr. |
Return a short string to display a message, or a table such as { message = "Game selected.", select = 2 } to also change the dashboard selection. Both table fields are optional. Messages can contain up to 256 bytes. Returning nil completes the command silently.
Filters, sorts and subtitles
| Entry | Callback and result |
|---|---|
filters |
match(game) returns a boolean. The filter applies after the selected library, search and A–Z filter. |
sorts |
key(game) returns an integer or a string up to 256 bytes. Use one type for every game. uFlow evaluates each key once for the view and sorts ascending, retaining title order for ties. |
subtitles |
text(game) returns up to 160 bytes of text for the selected game. Return an empty string to hide the caption. |
These callbacks receive the same game fields as view.game(i). Use isEnabled(id) to read plugin options. Selections are saved using the package and rule IDs. Keep each callback short. An invalid return or execution error discards a partially evaluated rule. The current library and both adjacent tabs share an 80 ms plugin deadline for each refresh. If the deadline expires, uFlow keeps the last completed ordering for that view and reports the timeout.
Content types and launchers
For example, { id="ds", name="DS homebrew", extensions={".nds"}, launcher="noods" } registers a file-based type. Type IDs use lowercase letters, digits and hyphens. Their library ID is plugin.<package-id>.<type-id>. List 1–32 lowercase filename extensions, each starting with a dot. The launcher ID refers to a launcher already known to uFlow. The normal launcher settings and per-game overrides apply. A plugin neither bundles an emulator nor assigns a directory on the user’s behalf.
Package updates supply new names, file extensions and launcher defaults to fields that still match the preceding package defaults. Values edited in the Content Type Editor are retained.
Removing a plugin removes its types from browsing and scanning. Configured directories and saved type customizations remain available for reinstall under the same ID.
Native dialogs and background jobs
An action or job can declare prompt = { title="…", text="…", choices={{id="start", label="Start"}} }. Supply one to six choices. uFlow presents the dialog before running the command. The final callback argument is the selected choice ID, or nil for commands without a dialog. Back dismisses the dialog without executing the callback.
A job’s run(view, state, report, choice) receives a snapshot of the visible library and the selected game at the moment it starts. Call report(percent, message) with an integer from 0 to 100 and a status message up to 160 bytes. Long jobs must report at least once a minute. Return a short completion message or nil. The host supports one utility job at a time. Leaving Settings keeps it running. HOME, game launch and exit request cancellation of both utility and media workers. A utility discards uncommitted state. Once publication to SD has begun, uFlow waits for that write to finish before handing off. If the process stops between FAT renames, the next command recovers a complete staged state record or reads the preceding backup. Completed media files stay available. Run the media action again to fill remaining gaps. Other plugins’ ordinary commands remain available during the job.
Plugin state and execution
state is a private table of string keys and string values. Set a key to nil to delete it. uFlow commits the changes after a successful action and validates the result first. A failing action keeps the previous state and selection. Each plugin may store up to 48 keys, 2 KiB per value, and 16 KiB total for keys and values. Keys use the same format as action IDs.
Actions are short, user-invoked callbacks. The runtime provides restricted base, string, table, and math functions, with limits on execution and memory. uFlow owns file access and network transfers. Callbacks are fixed when the package descriptor is validated. A callback or result error is reported to the player. A short call has an 80 ms deadline and a 200,000-instruction allowance. Per-game library rules have a 4,096-instruction allowance. Utility jobs use progress and cancellation checks instead of the short-call deadline.
The string library provides len, sub, lower, upper, reverse, byte, char, find, match, gsub and rep. Pattern operations accept subjects up to 4,096 bytes and patterns up to 128 bytes. Repetition produces at most 32 KiB. The table library provides pack, unpack, insert, remove, sort and concat. Operations that traverse a table accept up to 1,024 array entries. For long utilities, process records in small batches and report progress between batches.
Optional media provider
Place action, domains, record, key, and the four callbacks below inside media. The host runs downloads in the background, respects the user’s media folders, and validates complete PNG and JPEG images before saving them. A later scan can repair an incomplete cover at its configured destination. A title in two libraries uses each library’s configured folders. The original -- uFlow media plugin 1 format with top-level provider fields is supported for released plugins such as GameTDB 1.0.0.
| Callback | Result |
|---|---|
identify(platform, titleId, productCode, companyCode) |
Return a provider lookup ID or an empty string to skip. Media scanning supplies Wii U, Wii and GameCube titles. |
artwork(platform, lookupId, kind, language) |
For front or sleeve, return up to 12 JPEG/PNG HTTPS URLs in preference order, or an empty list to skip. URLs must use one of the declared hosts. |
database(platform) |
Return a direct ZIP URL whose first entry is XML, or an empty string to skip metadata. |
metadata(language) |
Return the supported metadata fields for the current XML record. Read child text, attributes or localized fields with xmlText, xmlAttr and xmlLocalized. |
Working examples
- Library Bookmark uses the core API for commands, settings, library selection and saved state. Example source
- Library Tools demonstrates filters, sort keys, selected-title captions, a DS content type, a confirmation dialog, a cancellable job and a saved result. Installable source
- GameTDB uses the media provider interface to download front covers, full sleeves and game metadata. GameTDB source and build instructions · Detailed provider fields and callbacks