This tool improves Nextflow CLI user experience by suggesting parameters and scripts using an fzf search interface.
Ensure your Nextflow script, includes usage instructions formatted in the docopt style, enclosed by triple quotes. For example:
def usage = """
Usage:
nextflow run --input <input> [--outdir <outdir>]
Options:
--input Path to input CSV file
--outdir Path to output directory (optional)
--help Show this message
"""
After typing your script with nextflow run *.nf
, activate the parameter suggestion menu by pressing Ctrl + n
.
To set up workflow script suggestions, edit the .workflows
file in your $HOME
directory. Add entries in the following format:
<key> <path to workflow script>
This allows for quick access to workflow scripts after typing nextflow run
.
- First, you need to install fzf.
- Clone this repository:
git clone https://github.com/5uperb0y/nf-tools
. - Open the
src/nf-complete/nf-complete.sh
in a text editor. - Set your preferred shortcut and path to your workflow list in the
nf-complete.sh
NF_COMPLETE_SHORTCUT="\C-n" NF_COMPLETE_WORKFLOWS="$HOME/.workflows"
- Add the following line to your
~/.bashrc
file:source /path/to/nf-complete.sh
- Restart your terminal or run
source ~/.bashrc
to activate the changes. - Type your shortcut to open the workflow and paramter suggestion menu.