plugin command (experimental)

The plugin command

  • Creates or list plugins
gallery.js plugin

Plugin handling

Commands:
  gallery.js plugin create   Create a new plugin
  gallery.js plugin list     List plugins                          [aliases: ls]
  gallery.js plugin plugins  List plugins                              [default]

Options:
      --version          Show version number                           [boolean]
      --full-version     Show full build version                       [boolean]
  -l, --log-level        Console log level
         [string] [choices: "trace", "debug", "info", "warn", "error", "silent"]
  -J, --log-json-format  Log output format in json                     [boolean]
  -L, --log-file         Log file
      --log-file-level   Log file level
  [string] [choices: "trace", "debug", "info", "warn", "error"] [default: "debug
                                                                              "]
  -c, --config           Configuration file
      --auto-config      Search for configuration on common configuration direct
                         ories                         [boolean] [default: true]
  -h, --help             Show help                                     [boolean]
      --level                                                   [default: debug]
Note

The plugin feature is quite fresh and handled experimental. Depending on requirements and progress the API might change. You are welcome to test the feature to report your limitations and feature requests

Note

The plugin feature is currently limited to the extractor and database module. Further modules like search and web application should follow. See Plugin for further details

plugin create command

With the create command you can scaffold a plugin. You can choose the source type between vanilla JS or Typescript version. Further you can create extractor steps and or database mappers.

The template shows basic usage and add some data.

gallery.js plugin create

Create a new plugin

Options:
      --version          Show version number                           [boolean]
      --full-version     Show full build version                       [boolean]
  -l, --log-level        Console log level
         [string] [choices: "trace", "debug", "info", "warn", "error", "silent"]
  -J, --log-json-format  Log output format in json                     [boolean]
  -L, --log-file         Log file
      --log-file-level   Log file level
  [string] [choices: "trace", "debug", "info", "warn", "error"] [default: "debug
                                                                              "]
  -c, --config           Configuration file
      --auto-config      Search for configuration on common configuration direct
                         ories                         [boolean] [default: true]
  -n, --name             Plugin name                                  [required]
  -d, --dir              Base directory of plugins. The plugin will be created a
                         s separate directory of given plugin name below
  -t, --sourceType       Source language type
               [choices: "single", "vanilla", "typescript"] [default: "vanilla"]
  -e, --environment      Plugin environments
                      [array] [choices: "server", "browser"] [default: "server"]
  -m, --modules          Plugin modules. Any set of extractor, database
                             [array] [choices: "extractor", "database", "query"]
  -f, --force            Force plugin folder overwrite if exists
                                                      [boolean] [default: false]
  -h, --help             Show help                                     [boolean]
      --level                                                   [default: debug]

plugin list command

The list command lists active plugins and lists extractors and database mappers. These commands are helpful to validate basic validation if the plugin can be loaded.

gallery.js plugin list

List plugins

Options:
      --version          Show version number                           [boolean]
      --full-version     Show full build version                       [boolean]
  -l, --log-level        Console log level
         [string] [choices: "trace", "debug", "info", "warn", "error", "silent"]
  -J, --log-json-format  Log output format in json                     [boolean]
  -L, --log-file         Log file
      --log-file-level   Log file level
  [string] [choices: "trace", "debug", "info", "warn", "error"] [default: "debug
                                                                              "]
  -c, --config           Configuration file
      --auto-config      Search for configuration on common configuration direct
                         ories                         [boolean] [default: true]
      --long             Long version                 [boolean] [default: false]
      --json             Print plugins in JSON format [boolean] [default: false]
  -h, --help             Show help                                     [boolean]
      --level                                                   [default: debug]