Managing Plugins

Accent CMS provides CLI commands to manage plugins without editing files manually, plus development conveniences that keep a broken plugin from taking the site down.

Managing Plugins (CLI)

Scaffolding a New Plugin

accent plugin new my-plugin --lang rust   # or: --lang js

Creates a my-plugin/ directory containing a complete, buildable content-hook plugin in the chosen language, including the slice of the WIT contract it needs. The command prints the build steps for the toolchain you picked. See Writing a Plugin for the full walkthrough.

Listing Installed Plugins

accent plugin list

Displays a summary table of all installed plugins:

NAME                      VERSION    HOOKS                FILTERS    ROUTES
---------------------------------------------------------------------------
syntax-highlight          0.2.0      on_render            1          0
contact-form              1.0.0      none                 0          1

Inspecting a Plugin

accent plugin info syntax-highlight

Shows detailed metadata: name, version, API version, description, registered hooks, filters, routes, shortcodes, and configuration.

Installing from the Registry

# Install the latest version
accent plugin install syntax-highlight

# Install a specific version
accent plugin install syntax-highlight@0.2.0

Downloads the plugin from the configured registry, verifies the SHA-256 checksum, and places it in the plugins directory. If a plugin with the same name is already installed, you must remove it first.

Removing a Plugin

accent plugin remove syntax-highlight

Deletes the plugin directory and all its contents. The plugin must be reinstalled to use it again.

Custom Config Path

All plugin commands accept --config to specify a config file (for resolving the plugins directory):

accent plugin --config prod.yaml list

Hot Reload

When dev.hot_reload is enabled, plugin WASM files are watched for changes. Modifying a .wasm file triggers an automatic reload of that plugin without restarting the server. Template filters provided by plugins are re-registered after reload.

Graceful Error Handling

The plugin system is designed to be resilient:

  • Missing plugins directory: The server starts normally with no plugins loaded
  • Invalid plugin.toml: The plugin is skipped with a warning; other plugins still load
  • Missing plugin.wasm: The plugin is skipped with a warning
  • WASM load failure: The plugin is skipped; the server continues
  • Runtime errors: Plugin errors are logged; original content is preserved

This means a broken plugin will never prevent your site from serving content.