Skip to content

Command Line

Installing pluxeo installs one command, pluxeo, with one subcommand.

pluxeo index

Scan source directories for plugins and write an index file that IndexFileSource reads at runtime (Discovery Modes).

pluxeo index [--scan PATH]... [--output PATH]
Option Default Meaning
--scan PATH scan from [tool.pluxeo], else src A directory to scan. Repeatable.
--output PATH index from [tool.pluxeo], else pluxeo_index.json Where to write the index.

The command imports every module under the scanned directories, except __init__.py files, and collects the Plugin subclasses that declare a namespace and a name, and the @plugin functions. It writes them as JSON, grouped by namespace:

{
  "acme.renderers": {
    "charts": "acme.charts:Charts",
    "quotes": "acme.quotes:Quotes"
  }
}

Module names are derived from paths relative to the scanned directory's parent: scanning src/acme makes src/acme/charts.py the module acme.charts.

Warning

A module that fails to import is currently skipped without a message, and its plugins are missing from the index. Check the count the command prints. See Known Limitations.

[tool.pluxeo]

Read from pyproject.toml in the current directory.

[tool.pluxeo]
scan = ["src/acme"]                     # directories to scan
index = "src/acme/_pluxeo_index.json"   # output file
include = ["acme/plugins/*"]            # only modules matching one of these
exclude = ["acme/tests/*"]              # skip modules matching one of these

include and exclude are shell-style patterns (fnmatch) matched against each module's path relative to the scanned directory's parent, such as acme/plugins/charts.py. Command-line options override scan and index.