Skip to content

Commit

Permalink
Merge pull request #2655 from ewels/trogon
Browse files Browse the repository at this point in the history
Add support for Click TUI with Trogon
  • Loading branch information
ewels authored Jan 12, 2024
2 parents 39a52d5 + a616de2 commit 669be1e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- update python image version in docker file ([#2636](https://github.com/nf-core/tools/pull/2636))
- Set pdiff as nf-test differ in Docker image for Gitpod ([#2642](https://github.com/nf-core/tools/pull/2642))
- Fix Renovate Dockerfile updating issues ([#2648](https://github.com/nf-core/tools/pull/2648) and [#2651](https://github.com/nf-core/tools/pull/2651))
- Add new subcommand `nf-core tui`, which launches a TUI (terminal user interface) to intuitively explore the command line flags, built using [Trogon](https://github.com/Textualize/trogon) ([#2655](https://github.com/nf-core/tools/pull/2655))

# [v2.11.1 - Magnesium Dragon Patch](https://github.com/nf-core/tools/releases/tag/2.11) - [2023-12-20]

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ A python package with helper tools for the nf-core community.
- [`nf-core schema` - Work with pipeline schema files](#pipeline-schema)
- [`nf-core bump-version` - Update nf-core pipeline version number](#bumping-a-pipeline-version-number)
- [`nf-core sync` - Synchronise pipeline TEMPLATE branches](#sync-a-pipeline-with-the-template)
- [`nf-core tui` - Explore the nf-core command line graphically](#tools-cli-tui)
- [`nf-core modules` - commands for dealing with DSL2 modules](#modules)

- [`modules list` - List available modules](#list-modules)
Expand Down Expand Up @@ -731,6 +732,17 @@ To create the pull request, a personal access token is required for API authenti
These can be created at [https://github.com/settings/tokens](https://github.com/settings/tokens).
Supply this using the `--auth-token` flag.

## Tools CLI TUI

_CLI:_ Command line interface
_TUI:_ Terminal user interface

The `nf-core` command line interface is fairly large, with a lot of commands and options.
To make it easier to explore and use, run `nf-core tui` to launch a graphical terminal interface.

This functionality works using [Textualize/trogon](https://github.com/Textualize/trogon)
and is based on the underlying CLI implementation that uses [Click](https://click.palletsprojects.com/).

## Modules

With the advent of [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html), we are creating a centralised repository of modules.
Expand Down
4 changes: 3 additions & 1 deletion nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import rich.logging
import rich.traceback
import rich_click as click
from trogon import tui

from nf_core import __version__
from nf_core.download import DownloadError
Expand All @@ -30,7 +31,7 @@
"nf-core": [
{
"name": "Commands for users",
"commands": ["list", "launch", "create-params-file", "download", "licences"],
"commands": ["list", "launch", "create-params-file", "download", "licences", "tui"],
},
{
"name": "Commands for developers",
Expand Down Expand Up @@ -111,6 +112,7 @@ def run_nf_core():
nf_core_cli(auto_envvar_prefix="NFCORE")


@tui()
@click.group(context_settings=dict(help_option_names=["-h", "--help"]))
@click.version_option(__version__)
@click.option("-v", "--verbose", is_flag=True, default=False, help="Print verbose output to the console.")
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
mypy
myst_parser
pytest-cov
pytest-datafiles
responses
ruff
Sphinx
sphinx-rtd-theme
mypy
types-PyYAML
types-requests
types-jsonschema
types-Markdown
types-PyYAML
types-requests
types-setuptools
ruff
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ jinja2
jsonschema>=3.0
markdown>=3.3
packaging
pdiff
pre-commit
prompt_toolkit>=3.0.3
pytest>=7.0.0
pytest-workflow>=1.6.0
pytest>=7.0.0
pyyaml
questionary>=1.8.0
refgenie
Expand All @@ -17,4 +18,4 @@ requests_cache
rich-click>=1.6.1
rich>=13.3.1
tabulate
pdiff
trogon

0 comments on commit 669be1e

Please sign in to comment.