PotionUI Docs v0.3.0

Showing admins the next setup step

A plugin that needs more than the enable switch (a backend with an API key, models turned on, presets installed and assigned) lists those steps under setup: in manifest.yml. Once the plugin is enabled, Admin → Plugins shows a Setup needed badge on its card, and its Overview tab opens with a Setup section: the next step and its button first, then every step with its state. Each step is checked against the instance as it is now, so the list updates as the admin works through it.

yaml
setup:
  - kind: "backend.added"
    driver: "cloud.acme"
    label: "Add an Acme backend with your API key"
  - kind: "cloud.models_enabled"
    driver: "cloud.acme"
  - kind: "presets.installed"
  - kind: "presets.assigned"
kindDone whenThe button opens
plugin.settingsevery settings: entry marked required: true has a valuethe plugin's Settings tab
backend.added (needs driver)an enabled backend uses driverAdd backend with that driver picked, or the backend that is turned off
cloud.models_enabled (needs driver)one of those backends has at least one catalog model turned onthat backend's Catalog tab
presets.installedat least one preset from the plugin's own presets: roots is installedthe first preset
presets.assignedan installed preset of the plugin is assigned to a user or a groupthe first installed preset
check (needs check and label)your SetupCheck says sothe action_href you return

label and description are optional on the built-in kinds and replace the default wording; the description shows only while the step is not done. A step that depends on an earlier one (models before any backend exists, assignments before anything is installed) reads waiting and has no button. When a step names a driver that is not loaded yet, which is the case right after enabling a plugin that registers a backend, a Restart PotionUI step with a restart button comes first. When the manifest has docs:, the section also links to the first page.

A plugin-specific check is a class implementing SetupCheck:

python
from src.plugin_api import SetupCheck, SetupCheckContext, SetupCheckResult

class AccountLinked(SetupCheck):
    def evaluate(self, context: SetupCheckContext) -> SetupCheckResult:
        if context.settings.get("account_id"):
            return SetupCheckResult(done=True, description="Account linked.")
        return SetupCheckResult(
            done=False,
            description="Link the account this plugin bills to.",
            action_label="Open settings",
            action_href="/admin?tab=plugins&id=acme",
        )
yaml
setup:
  - kind: "check"
    check: "setup_checks:AccountLinked"
    label: "Link your Acme account"

context.settings holds the plugin's saved global settings. evaluate runs on every visit to Admin → Plugins, so keep it to local reads: no network calls. A check that cannot be loaded or raises shows as a step still to do. The report is served admin-only at GET /api/plugins/setup and never carries prices or costs.