Command line interface
Nextflow provides a robust command line interface (CLI) for the management and execution of pipelines. This page explains the key concepts and common usage patterns for the CLI.
For the complete reference of all commands, subcommands, and options, see CLI reference.
Nextflow uses two types of command line flags:
- Nextflow options use a single dash (e.g.,
-log) and modify Nextflow's behavior. - Pipeline parameters use a double dash (e.g.,
--input) and are passed to your pipeline script.
Pipeline execution
Pipeline execution is the core function of Nextflow. These commands run Nextflow workflows, either from local files or remote Git repositories. Nextflow handles downloading, caching, and executing pipelines with minimal user intervention. The See run for more information. Local pipelines Run a pipeline from your local filesystem: Remote pipelines Use the format Nextflow automatically: If you omit the organization, Nextflow searches cached pipelines first, then attempts to download from the You can also use full repository URLs: Private repositories Use the Alternatively, configure Git authentication. See Git configuration for more information. Non-GitHub providers Use the Revision selection Use the Nextflow downloads and stores each explicitly requested Git branch, tag, or commit ID in a separate directory path, enabling you to run multiple revisions of the same pipeline simultaneously. Downloaded revisions are stored in a subdirectory of the local project: Use tags or commit IDs instead of branches for reproducible pipeline runs. Branch references change as development progresses over time. Pipeline parameters are values defined with Parameter names support automatic conversion between kebab-case and camelCase: Parameters without values are set to Quote parameters containing wildcards to prevent shell expansion: Parameter files For complex parameter sets, use YAML or JSON files with Parameter precedence Nextflow applies parameters defined in multiple places in the following order (lowest to highest priority): The Use this when you want both the Nextflow driver and tasks running in Kubernetes. This differs from using the Kubernetes executor with See kuberun for more information.Launching a project
run command executes pipeline scripts from local files or remote repositories. It automatically manages repository downloads, caching, and execution, supporting various Git providers and authentication methods.$ nextflow run main.nf<organization>/<repository> to run a pipeline directly from Git repositories:$ nextflow run nextflow-io/hello
$HOME/.nextflow/assets/NXF_ORG organization (default: nextflow-io).$ nextflow run https://github.com/nextflow-io/hello-user option to add credentials for private repositories:$ nextflow run organization/private-repo -user my-username-hub option specify Bitbucket, GitLab, or other Git providers:$ nextflow run organization/repo -hub bitbucket-r option to specify Git branches, tags, or commits:$ nextflow run nextflow-io/hello -r v1.1
$ nextflow run nextflow-io/hello -r dev-branch
$ nextflow run nextflow-io/hello -r a3f5c8e$NXF_ASSETS/.repos/<org>/<repo>/clones/<commitId>.Pipeline parameters
params in your script. Override them on the command line using the -- prefix to customize pipeline behavior without modifying code.$ nextflow run main.nf --input data.csv --output results$ nextflow run main.nf --input-file data.csv # Becomes params.inputFiletrue:$ nextflow run main.nf --verbose # params.verbose = true$ nextflow run main.nf --files "*.fasta"-params-file. This is cleaner than long command lines.{
"input": "data.csv",
"output": "results/",
"min_quality": 20
}$ nextflow run main.nf -params-file params.json
params.foo = 'default')-params-file)--foo bar)Kubernetes execution
kuberun command executes pipelines entirely within a Kubernetes cluster. This experimental feature runs the Nextflow driver itself inside Kubernetes.run, where only tasks run in Kubernetes while the driver runs externally.$ nextflow kuberun nextflow-io/hello
Project management
Project management commands interact with Git-hosted pipelines. Nextflow integrates with Git providers (e.g., GitHub, GitLab, and Bitbucket) to treat pipelines as versioned projects and maintains a local cache in $HOME/.nextflow/assets/.
Use these commands to explore available pipelines, inspect their code, maintain your cache, and clone projects. The The Use this to understand a project's structure, see available versions, or verify which revision is currently checked out. This prints an output similar to the following: This shows: The Use this to manually download pipelines before running them, update cached pipelines, or download pipelines for offline use. You can specify a particular revision to download. See pull for more information. The Use this to quickly inspect pipeline code without opening files or explore the project structure. Specify See view for more information. The Use this when you want to modify an existing pipeline, create a derivative pipeline, or study a pipeline's structure. If you omit the target directory it uses the pipeline name. See clone for more information. The Use this to free disk space by removing pipelines you no longer need. The project is deleted from See drop for more information. The Use this to store credentials securely, reference them in pipelines without exposing values, and manage sensitive data centrally across your organization. See secrets for more information.Listing downloaded projects
list command shows all pipelines currently downloaded to your local cache. This helps you track which projects are available offline and manage your cache directory. Pipelines are stored in $HOME/.nextflow/assets/ by default.$ nextflow listShowing project information
info command displays detailed metadata about a downloaded project, including its repository location, local path, main script, and available revisions.nextflow info helloproject name: nextflow-io/hello
repository : https://github.com/nextflow-io/hello
local path : $HOME/.nextflow/assets/.repos/nextflow-io/hello
main script : main.nf
revisions :
> master (default)
mybranch
> v1.1 [t]
v1.2 [t]
[t])>)Pulling or updating projects
pull command downloads a pipeline or updates an existing one to the latest version from its Git repository.nextflow pull nextflow-io/hello$ nextflow pull nextflow-io/hello -r mybranchViewing project code
view command displays the contents of a pipeline's main script or lists all files in the repository.-l option lists all repository files instead of showing script contents.$ nextflow view nextflow-io/hello
$ nextflow view nextflow-io/hello -lCloning projects locally
clone command copies a pipeline from the cache to a local directory and creates a full Git repository you can modify.$ nextflow clone nextflow-io/hello my-helloDeleting cached projects
drop command removes a downloaded pipeline from the local cache.$HOME/.nextflow/assets/. The next run will download it again if needed.$ nextflow drop nextflow-io/helloSecret management
secrets command manages secure pipeline secrets.$ nextflow secrets list
$ nextflow secrets set AWS_ACCESS_KEY_ID
$ nextflow secrets delete AWS_ACCESS_KEY_ID
Configuration and validation
Configuration and validation options and commands help you control and verify pipeline settings. Configuration options supplement pipeline configuration at runtime, while validation commands inspect how Nextflow interprets your configuration files, process definitions, and scripts.
Use these to customize pipeline configuration, debug configuration issues, verify settings, and catch issues before execution. The Use this when you want to override specific settings while keeping other defaults intact. Multiple configuration files can be specified as a comma separated list. See Configuration for more information. The Use this when you want to ensure no default configurations interfere with your custom settings. Unlike See Configuration for more information. The Use this to debug configuration issues, verify which settings will be applied, understand configuration precedence, or inspect specific configuration properties. See config for more information. The Use this to determine which container images will be used by each process before running the pipeline. See inspect for more information. The Use this to catch syntax errors before execution, enforce consistent code formatting, or validate entire directories of Nextflow code. See lint for more information.Soft configuration override
-c option adds your configuration on top of the defaults and merges them together.$ nextflow -c my.config run nextflow-io/helloHard configuration override
-C option replaces all default configuration with your custom configuration files. Multiple configuration files can be specified as a comma separated list.-c which merges configurations, -C ensures only your specified file is used.$ nextflow -C my.config run nextflow-io/helloConfiguration inspection
config command prints the resolved configuration for a pipeline.$ nextflow config
$ nextflow config nextflow-io/helloProcess inspection
inspect command analyzes process settings in a pipeline without executing it. It outputs container information in JSON or Nextflow configuration format.$ nextflow inspect nextflow-io/hello
$ nextflow inspect nextflow-io/hello -format jsonScript validation
lint command analyzes Nextflow scripts and configuration files for syntax errors and code issues. It can also automatically format your code to maintain consistent style across your project.$ nextflow lint main.nf
Execution history
Execution history and maintenance commands manage past runs and clean up cached files. Nextflow maintains metadata about all executions and stores intermediate files in work directories.
Use these commands to review past executions, free disk space, troubleshoot failures, or explore data lineage. The Use this to find run names for resuming, review execution history, or debug failed runs. The command shows recent executions by default, with options to view specific runs or customize output fields. See [log][cli-log] for more information. The Use this to free disk space, clean up failed or test runs, or maintain your work directory. Use See [clean][cli-clean] for more information. Experimental: may change in a future release. The Use this to understand input/output relationships between tasks, trace data flow through the pipeline, or establish file provenance. Lineage tracking must be enabled in configuration. See Getting started with data lineage to get started and lineage for more information.Execution logs
log command displays execution history and details about past pipeline runs, such as run names, timestamps, and customizable output fields.$ nextflow log
$ nextflow log dreamy_euler
$ nextflow log last -f name,status,durationWork directory cleanup
clean command removes work directories and cached intermediate files from past executions.-n to perform a dry run and show what would be deleted. Use -f to delete files.$ nextflow clean -n
$ nextflow clean dreamy_euler -fData lineage
lineage command explores data lineage and provenance for workflow executions and tracks relationships between inputs, outputs, and processing steps.$ nextflow lineage
Seqera Platform
Seqera Platform is a comprehensive workflow orchestration platform that extends Nextflow with features for workflow management, monitoring, and collaboration.
Use these commands to authenticate with Seqera Platform and launch workflows directly to the Platform's managed infrastructure. The Use this to log in or out of the Platform, establishing or removing your authentication credentials. Additional authentication operations include checking login status, viewing configuration details, and logging out: See auth for more information. The Use this to leverage Platform's cloud resources, monitoring capabilities, and execution management. The Platform handles resource provisioning, execution monitoring, and result storage. See launch for more information.Platform authentication
auth command manages authentication credentials for Seqera Platform, saving access tokens for API interactions.$ nextflow auth login$ nextflow auth status
$ nextflow auth config
$ nextflow auth logoutPlatform workflow submission
launch command submits a workflow to run on Seqera Platform's infrastructure instead of your local machine.$ nextflow launch nextflow-io/hello
System utilities
System utilities provide administrative and development tools for managing Nextflow itself, interacting with remote filesystems, working with plugins, and debugging.
Use these commands for system administration, development, and testing. The Use this to test Nextflow DSL code interactively, debug expressions, explore Nextflow's APIs, or experiment with syntax. It opens a GUI or REPL depending on your environment. The Use this to manage remote data, test cloud storage access, or perform bulk file operations without additional tools. See fs for more information. The See plugin for more information. Plugin creation Use the Plugin installation Use the Plugin execution Use the the format See individual plugin documentation for plugin specific commands. The Use this to upgrade Nextflow, switch versions, or install edge releases. By default, it updates to the latest stable release. Specify a particular version or use the The Use this to learn about command-specific options, refresh your memory about syntax, or discover available features for a particular command. The Use Use Interactive console
console command launches an interactive Groovy console with Nextflow's execution context loaded.$ nextflow consoleRemote filesystem operations
fs command performs filesystem operations on remote storage systems supported by Nextflow, such as S3, Google Cloud Storage, and Azure Blob Storage.$ nextflow fs list s3://my-bucket/data/
$ nextflow fs cat s3://my-bucket/data/file.txt
$ nextflow fs cp s3://my-bucket/data/file.txt s3://dest/
$ nextflow fs delete s3://my-bucket/data/file.txtPlugins
plugin command creates plugins, installs them, and executes plugin-specific operations.create subcommand to create a new plugin scaffold for development:$ nextflow plugin createinstall subcommand to install a plugin and extend Nextflow functionality:$ nextflow plugin install my-pluginplugin-name:command to execute plugin-specific commands:$ nextflow plugin my-plugin:hello --alpha --betaNextflow updates
self-update command updates Nextflow to a newer version. It downloads and installs the latest release or a specific version.NXF_EDGE environment variable for development releases.$ nextflow self-update
$ NXF_EDGE=1 nextflow self-updateCommand help
help command displays detailed usage information for any Nextflow command.$ nextflow help runVersion information
-v and -version options print Nextflow version information.-v for minimal output showing version and build number.$ nextflow -v
nextflow version 24.04.0.5917-version for detailed output showing creation date, citation, and website.$ nextflow -version
N E X T F L O W
version 24.04.0 build 5917
created 03-05-2024 15:07 UTC
cite doi:10.1038/nbt.3820
http://nextflow.io