Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f5b6b86
Add first implementation of module CLI commands
jorgee Jan 28, 2026
f5822a5
add print of process outputs
jorgee Jan 30, 2026
24a741f
rename ModuleSpec and PipelineSpec
jorgee Jan 30, 2026
2432e90
add documentation and tests
jorgee Feb 6, 2026
31bf49c
add registry config as config extension
jorgee Feb 10, 2026
b091d73
fix NPE in nextflow CLI help
jorgee Feb 11, 2026
a03f630
add module info and expect /api path in the config registry url, upda…
jorgee Feb 19, 2026
36e9085
update default registry to include /api
jorgee Feb 19, 2026
d4418ed
Merge branch '251117-module-system' into 251117-module-system-impleme…
jorgee Feb 25, 2026
fc327c4
Fix compilation issue [ci skip]
pditommaso Feb 19, 2026
c3b02a8
add review comments and fix compilation and tests
jorgee Feb 25, 2026
73e9707
look for checksum in redirected headers
jorgee Feb 26, 2026
c154d35
rename checksum header
jorgee Feb 26, 2026
e924509
update docs
jorgee Feb 27, 2026
412ba53
fix NPE when no nextflow.config and change preference in registry url…
jorgee Feb 27, 2026
119c632
update speckit files [ci skip]
jorgee Feb 27, 2026
ad0bba2
Merge branch '251117-module-system' into 251117-module-system-impleme…
pditommaso Mar 3, 2026
4826533
Merge branch '251117-module-system' into 251117-module-system-impleme…
jorgee Mar 4, 2026
c20a408
rename module subcommands
jorgee Mar 4, 2026
90dc444
address review comments
jorgee Mar 5, 2026
afddf21
fix test
jorgee Mar 5, 2026
18a9e70
Remote module inclusion (#6815)
jorgee Mar 6, 2026
a2adf6e
update docs
bentsherman Mar 6, 2026
292e4f2
change module remove behaviour to avoid unexpected removes
jorgee Mar 6, 2026
e96c6ef
Apply suggestions from code review [ci skip]
jorgee Mar 9, 2026
0b83a2c
remove pipeline spec and modules config
jorgee Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 130 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,135 @@ $ nextflow secrets set AWS_ACCESS_KEY_ID
$ nextflow secrets delete AWS_ACCESS_KEY_ID
```

See {ref}`cli-secrets` for more information.
See {ref}`cli-secrets` for more information.

## Module management

:::{versionadded} 26.04.0
:::

Module management commands enable working with reusable, registry-based modules. The Nextflow module system allows you to install, run, search, and publish standardized modules from registries, eliminating duplicate work and spreading improvements throughout the community.

Use these commands to discover modules in registries, install them into your project, run them directly without creating a workflow, and publish your own modules for others to use.

### Installing modules

The `module install` command downloads modules from a registry and makes them available in your workflow. Modules are stored locally in the `modules/` directory and version information is tracked in `nextflow_spec.json`.

Use this to add reusable modules to your pipeline, manage module versions, or update modules to newer versions.

```console
$ nextflow module install nf-core/fastqc
$ nextflow module install nf-core/fastqc -version 1.0.0
```

After installation, module will be available in `modules/nf-core/fastqc` and included in `nextflow_spec.json`

Use the `-force` flag to reinstall a module even if local modifications exist.

See {ref}`cli-module-install` for more information.

### Running modules directly

The `module run` command executes a module directly from the registry without requiring a wrapper workflow. This provides immediate access to module functionality for ad-hoc tasks or testing.

Use this to quickly run a module, test module functionality, or execute one-off data processing tasks.

```console
$ nextflow module run nf-core/fastqc --input 'data/*.fastq.gz'
$ nextflow module run nf-core/fastqc --input 'data/*.fastq.gz' -version 1.0.0
```

The command accepts all standard Nextflow execution options (`-profile`, `-resume`, etc.):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really say in the new docs where --reads and --index come from. It'd be good to have a bit more guidance about how people should know what CLI flags to use.

Could we get nextflow module run [name] --help to list available flags? That'd be really useful!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to #6650


```console
$ nextflow module run nf-core/salmon \
--reads reads.fq \
--index salmon_index \
-profile docker \
-resume
```

See {ref}`cli-module-run` for more information.

### Listing modules

The `module list` command displays all modules currently installed in your project, showing their versions and integrity status.

Use this to review installed modules, check module versions, or detect local modifications.

```console
$ nextflow module list
$ nextflow module list -output json
```

The output shows each module's name, installed version, and whether it has been modified locally. Use `-json` for machine-readable output suitable for scripting.

See {ref}`cli-module-list` for more information.

### Searching for modules

The `module search` command queries the module registry to discover available modules by keyword or name.

Use this to find modules for specific tasks, explore available tools, or discover community contributions.

```console
$ nextflow module search alignment
$ nextflow module search "quality control" -limit 10
$ nextflow module search bwa -output json
```

Results include module names, versions, descriptions, and download statistics. Use `-limit` to control the number of results and `-output json` for programmatic access.

See {ref}`cli-module-search` for more information.

### Viewing module information

The `module info` command displays detailed metadata and usage information for a specific module from the registry.

Use this to understand module requirements, view input/output specifications, see available tools, or generate usage templates before installing or running a module.

```console
$ nextflow module info nf-core/fastqc
$ nextflow module info nf-core/fastqc -version 1.0.0
$ nextflow module info nf-core/fastqc -output json
```

The output includes the module's version, description, authors, keywords, tools, input/output channels, and a generated usage template showing how to run the module. Use `-json` for machine-readable output suitable for programmatic access.

See {ref}`cli-module-info` for more information.

### Removing modules

The `module remove` command deletes modules from your project, removing local files and configuration entries.

Use this to clean up unused modules, free disk space, or remove deprecated modules from your pipeline.

```console
$ nextflow module remove nf-core/fastqc
$ nextflow module remove nf-core/fastqc -keep-files
```

By default, both local files and configuration entries are removed. Use `-keep-files` to remove the configuration entry and `.module-info` while keeping local files.

See {ref}`cli-module-remove` for more information.

### Publishing modules

The `module publish` command uploads modules to a registry, making them available for others to install and use.

Use this to share your modules with the community, contribute to module libraries, or distribute modules within your organization.

```console
$ nextflow module publish myorg/my-module
$ nextflow module publish myorg/my-module -dry-run
```

Publishing requires authentication via the `NXF_REGISTRY_TOKEN` environment variable or `registry.apiKey` in the Nextflow configuration. The module must include `main.nf`, `meta.yaml`, and `README.md` files.

Use `-dry-run` to validate your module structure without uploading.

See {ref}`cli-module-publish` for more information.

## Configuration and validation

Expand Down Expand Up @@ -384,7 +512,7 @@ Use this to understand input/output relationships between tasks, trace data flow
$ nextflow lineage
```

See {ref}`data-lineage-page` to get started and {ref}`cli-lineage` for more information.
See {ref}`data-lineage-page` to get started and {ref}`cli-lineage` for more information.

## Seqera Platform

Expand Down
173 changes: 172 additions & 1 deletion docs/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,179 @@ This feature requires the use of a local or shared file system for the pipeline

## Sharing modules

Modules are designed to be easy to share and re-use across different pipelines, which helps eliminate duplicate work and spread improvements throughout the community. While Nextflow does not provide an explicit mechanism for sharing modules, there are several ways to do it:
Modules are designed to be easy to share and re-use across different pipelines, which helps eliminate duplicate work and spread improvements throughout the community. There are several ways to share modules:

- Use the Nextflow module registry (recommended, see below)
- Simply copy the module files into your pipeline repository
- Use [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to fetch modules from other Git repositories without maintaining a separate copy
- Use the [nf-core](https://nf-co.re/tools#modules) CLI to install and update modules with a standard approach used by the nf-core community

(module-registry)=

## Registry-based modules

:::{versionadded} 26.04.0
:::

Nextflow provides a module registry that enables you to install, share, and manage modules from centralized registries. This system provides version management, integrity checking, and seamless integration with the Nextflow DSL.

### Installing modules from a registry

Use the `module install` command to download modules from a registry:

```console
$ nextflow module install nf-core/fastqc
$ nextflow module install nf-core/fastqc -version 1.0.0
```

Installed modules are stored in the `modules/` directory and can be included by name instead of by relative path:

```nextflow
include { FASTQC } from 'nf-core/fastqc'

workflow {
reads = Channel.fromFilePairs('data/*_{1,2}.fastq.gz')
FASTQC(reads)
}
```

### Running modules directly

For ad-hoc tasks or testing, you can run a module directly without creating a workflow:

```console
$ nextflow module run nf-core/fastqc --input 'data/*.fastq.gz'
```

This command accepts all standard Nextflow options (`-profile`, `-resume`, etc.) and automatically downloads the module if not already installed.

### Managing module versions

Module versions are tracked in `nextflow_spec.json` in your project directory:

```json
{
"modules": {
"nf-core/fastqc": "1.0.0",
"nf-core/bwa-align": "1.2.0"
}
}
```

When you run your workflow, Nextflow automatically installs or updates modules to match the specified versions.

### Discovering modules

Search for available modules using the `module search` command:

```console
$ nextflow module search alignment
$ nextflow module search "quality control" -limit 10
```

List installed modules in your project:

```console
$ nextflow module list
```

### Module checksum verification

Nextflow automatically verifies module integrity using checksums. If you modify a module locally, Nextflow will detect the change and prevent accidental overwrites:

```console
$ nextflow module install nf-core/fastqc -version 1.1.0
Warning: Module nf-core/fastqc has local modifications. Use -force to override.
```

Use the `-force` flag to override local modifications when needed.

### Removing modules

Use the `module remove` command to uninstall a module:

```console
$ nextflow module remove nf-core/fastqc
```

By default, both the local module files and the entry in `nextflow_spec.json` are removed. Use the flags below to control this behaviour:

- `-keep-files` — Remove the entry from `nextflow_spec.json` but keep the local module files
- `-force` — Force removal even if the module has no `.module-info` file (i.e. not installed from a registry) or has local modifications

### Viewing module information

Use the `module info` command to display metadata and a usage template for a module:

```console
$ nextflow module info nf-core/fastqc
$ nextflow module info nf-core/fastqc -version 1.0.0
```

The output includes the module description, authors, keywords, tools, inputs, outputs, and a ready-to-use command-line template. Use `-json` to get machine-readable output.

### Publishing modules

To share your own modules, use the `module publish` command:

```console
$ nextflow module publish myorg/my-module
```

The argument can be either a `scope/name` reference (for an already-installed module) or a local directory path containing the module files.

Your module directory must include:

- `main.nf` - The module entry point
- `meta.yaml` - Module metadata (name, description, version, etc.)
- `README.md` - Module documentation

Authentication is required for publishing and can be provided via the `NXF_REGISTRY_TOKEN` environment variable or in your configuration:

```groovy
registry {
apiKey = 'YOUR_REGISTRY_TOKEN'
}
```

Use `-dry-run` to validate your module structure without uploading:

```console
$ nextflow module publish myorg/my-module -dry-run
```

### Registry configuration

By default, Nextflow uses the public registry at `https://registry.nextflow.io`. You can configure alternative or additional registries:

```groovy
registry {
url = [
'https://private.registry.myorg.com',
'https://registry.nextflow.io'
]
apiKey = '${MYORG_TOKEN}'
}
```

Registries are queried in the order specified until a module is found. The `apiKey` is used only for the primary (first) registry.

### Module directory structure

Registry modules follow a standard directory structure:

```
modules/
└── scope/
└── module-name/
├── .checksum # Integrity checksum (generated automatically)
├── README.md # Documentation (required for publishing)
├── main.nf # Module entry point (required)
├── meta.yaml # Module metadata (required for publishing)
├── resources/ # Optional: module binaries and resources
└── templates/ # Optional: process templates
```

The `modules/` directory should be committed to your Git repository to ensure reproducibility.

See the {ref}`cli-page` documentation for complete details on all module commands.
Loading
Loading