nextflow module
Manage Nextflow modules and pipelines.
Usage
$ nextflow module <subcommand> [options]
Description
The module command manages registry-based modules. Use it to install modules from a registry, run them directly, search for available modules, and publish your own modules to a registry.
The install, list, remove, search, and view subcommands also handle registry pipelines, which are installed into modules/ so that they can be included like a workflow module. Use nextflow run to run a registry pipeline.
Options
-h, -help
Print the command usage.
Subcommands
create [options] [namespace/name]
Create a new module with a basic main.nf, meta.yml, and README.md.
The following options are available: The kind of module to scaffold: Scaffold a module without static typing. By default a module is scaffolded with typed input/output declarations.-kind (Process)Process (default) or Workflow.-legacy
install [options] [namespace/name]
Install a module or pipeline from the registry into your project.
Nextflow stores downloaded modules in the modules/ directory and writes a .module-info file in each module directory to record the installed version.
A pipeline is installed into modules/ in the same way. Nextflow downloads the whole Git repository of the pipeline at the commit pinned by the release, without the .git directory. The repository must have a main.nf at the top level, since an include always uses main.nf.
The following options are available: Reinstall the module or pipeline even if it is already installed. Without this flag, Nextflow reuses an installed module and does not overwrite a locally modified one. Re-vendor an installed module's dependencies from its Module or pipeline version to install, for example -force-update-depsmeta.yml, leaving the module itself untouched. Nextflow installs each declared dependency at its pinned version, transitively, and removes any of the module's own direct dependencies that are no longer declared. If the module is not installed, Nextflow installs it as usual. Cannot be combined with -force. Applies only to modules.-version1.0.0. Defaults to the latest version.
list [options]
List the modules and pipelines installed in your project.
Shows each module's name, version, kind (Process, Workflow, or Pipeline), and integrity status, which reports whether the module was modified locally.
The following options are available: Output mode for list results. Options: -o, -output (table)table (default), json.
publish [options] [namespace/name | path]
Publish a module to the registry so that others can install it.
The argument can be either a namespace/name reference to an already-installed module, or a local directory path containing the module files.
Authenticate with the NXF_REGISTRY_TOKEN environment variable or the registry.apiKey config option.
The module directory must contain main.nf, meta.yml, and README.md.
The following options are available: Validate the module structure and metadata without uploading it to the registry. Registry to publish the module to (default: -dry-run-registryhttps://registry.nextflow.io).
remove [options] [namespace/name]
Remove a module or pipeline from your project. By default, removes both the local files and the configuration entries.
The following options are available: Remove the module even if it has local modifications, or has no Remove the -force.module-info file because it was not installed from a registry.-keep-files.module-info file but keep the local files in the modules/ directory. Applies only to modules.
run [options] [namespace/name | path] [--<input_name> <input-value>]
Run a module directly. Pipelines cannot be run with this command. Use nextflow run instead.
The argument can be a remote module (namespace/name) or a local module path beginning with ./, ../, or /.
Nextflow downloads the module if it is not already installed.
Accepts all standard Nextflow run options, such as -profile, -resume, and -c.
Nextflow infers the command-line params, written as --<input_name>, from the module's declared inputs.
Workflow modules must be typed in order to be executed with nextflow module run.
The following additional options are available: Module version to run, for example -version1.0.0. Defaults to the latest version.
search [options] [query]
Search for modules or pipelines in the registry by keyword or name.
Returns matching process modules (or workflow modules or pipelines, with -kind workflow or -kind pipeline) with their description.
The following options are available: Kind of results to search for. Options: Maximum number of results to return. Output mode for search results. Options: -kind (process)process (default), workflow, pipeline.-limit (20)-o, -output (simple)simple (default), json.
spec [options] <namespace/name or path>
Generate the meta.yml for a local module from the source code (main.nf).
The generated file includes TODO placeholders for fields you do not specify.
If a spec file already exists, Nextflow incorporates it into the new file.
The following options are available: Module namespace, used to construct the module name. Required when the argument is a path, and ignored when it is a module name. Module version string, for example Short description of what the module does. Defaults to SPDX license identifier, for example Module author. Can be specified multiple times, once per author. Defaults to Print the generated spec to standard output without writing any file.-namespace <namespace>-version <version>1.0.0. Defaults to TODO: Add version.-description <text>TODO: Add description.-license <identifier>MIT or Apache-2.0. Defaults to TODO: Add license (e.g., MIT).-author <name>[TODO: Add author].-dry-run
view [options] [namespace/name]
Display detailed information about a module or pipeline from the registry. Shows the module name, version, description, and other metadata, along with example usage. For a pipeline, it shows the Git repository and commit of the release and the pipeline parameters, along with how to include and run the pipeline.
The following options are available: Module or pipeline version to query, for example Output mode for info results. Options: -version1.0.0. Defaults to the latest version.-o, -output (text)text (default), json.
validate [options] <scope/name or path>
Validate a module before publishing to the registry.
Verifies that:
- All required files are present (
main.nf,meta.yml,README.md). - The module spec contains all required fields (name, version, description, and license).
- Every module included by the module script is a registry module, not a local module.
- The dependencies declared in
requires.modulesare exactly the modules included by the module script, each pinned to an exact version.
Examples
Install the latest module version:
$ nextflow module install nf-core/fastqc
Display the installed modules as a table:
$ nextflow module list
Validate the module structure without publishing:
$ nextflow module publish myorg/my-module -dry-run
Publish a module to the Nextflow registry:
$ export NXF_REGISTRY_TOKEN=your-token
$ nextflow module publish myorg/my-module
Install a pipeline, to include it in your pipeline:
$ nextflow module install nf-core/rnaseq -version 3.14.0
Display information for the latest module version:
$ nextflow module view nf-core/fastqc
Display information for a specific version:
$ nextflow module view nf-core/fastqc -version 1.0.0
Create a module:
$ nextflow module create
Remove a module completely:
$ nextflow module remove nf-core/fastqc
Run a remote module:
$ nextflow module run nf-core/fastqc \
--input 'data/*.fastq.gz'
Run a remote module with a specific version and run options:
$ nextflow module run nf-core/fastqc \
-version 1.0.0 \
--input 'data/*.fastq.gz' \
-with-conda \
-resume
Run a local module:
$ nextflow module run ./modules/nf-core/fastqc/main.nf \
--input 'data/*.fastq.gz'
Search for alignment-related modules:
$ nextflow module search alignment
Search for workflow modules:
$ nextflow module search -kind workflow qc
Search for RNA-seq pipelines:
$ nextflow module search -kind pipeline rnaseq
Generate a spec for a local module by name:
$ nextflow module spec nf-core/fastqc
Generate a spec for a local module by path, which requires a namespace:
$ nextflow module spec -namespace nf-core ./modules/my-module
Provide additional fields to avoid TODO placeholders:
$ nextflow module spec \
-namespace nf-core \
-version 1.0.0 \
-description "Quality control of raw sequencing reads" \
-license MIT \
-author "@drpatelh" \
-author "@joseespinosa" \
./modules/nf-core/fastqc
Validate a module by name:
$ nextflow module validate myorg/my-module
Validate a module by path:
$ nextflow module validate ./modules/myorg/my-module