command-line-interface-testing
Summary
Validate that a Python-based command-line tool (such as ChemDistiller's annotate.py) executes correctly and emits expected help documentation when invoked with the --help flag. This skill confirms entry-point accessibility and documents available command-line arguments before running production analyses.
When to use
After installing a Python package or before running a computational workflow for the first time, to verify that the CLI entry point is properly configured, the Python environment is correctly set up, and to discover available command-line arguments and their defaults (e.g., number of CPUs, MS1 m/z tolerance, output folder specification) that must be configured for your specific analysis.
When NOT to use
- The script has already been validated by prior successful test runs; further --help invocations add no new diagnostic value.
- You are performing interactive Python development and need programmatic access to argument definitions; use introspection or argparse module inspection instead.
- The Python environment or package is not installed; resolve installation errors before attempting CLI testing.
Inputs
- Python package installation directory path
- Shell environment with Python 2 or 3 (64-bit recommended)
- Required dependencies installed (SciPy, NumPy, h5py for ChemDistiller)
Outputs
- Help documentation text printed to standard output
- List of available command-line arguments and their descriptions
- Default parameter values
- Usage examples or command syntax patterns
How to apply
Navigate to the installed package directory (e.g., .../ChemDistiller/). Invoke the entry-point script with the --help flag using Python (e.g., python annotate.py --help). Capture and validate the standard output for the presence of documented command-line arguments, their descriptions, default values, and usage examples. Check that the help output is well-formed and lists all parameters relevant to your analysis (e.g., --ncpu, --delta_mz, --max_results for ChemDistiller). A successful invocation confirms the script's executable state, the Python environment's availability, and provides the reference documentation needed to construct valid production commands.
Related tools
- Python (Interpreter for executing the annotate.py entry-point script and capturing CLI output)
- annotate.py (ChemDistiller command-line entry point being tested for proper invocation and help documentation emission) — https://github.com/Mrqeoqqt/chemdistiller
Examples
python annotate.py --help
Evaluation signals
- Exit code is 0 (success) when --help is invoked.
- Help text is emitted to standard output without error messages or exceptions.
- All expected command-line arguments (--ncpu, --delta_mz, --max_results, --test, --svm_folder, etc.) are documented in the output.
- Default values are explicitly stated for optional parameters (e.g., --ncpu default: 1, --max_results default: 10).
- Help output includes usage examples or a description of positional arguments such as Input_Spectra_folder and optional output_folder.
Limitations
- The --help flag documents only the entry point's static argument schema; it does not validate runtime behavior, database connectivity, or file I/O against actual input spectra.
- Help output does not confirm that optional dependencies (RDKit for 2D structure image generation) are installed; a separate verification step is needed for optional features.
- Help invocation does not test the tool's ability to process actual spectra or produce correct annotations; use --test mode or a small validation dataset for end-to-end validation.
Evidence
- [readme] Try running ChemDistiller from the command line:
python annotate.py --help. This should give you the list of currently available command line arguments.: "Try running ChemDistiller from the command line: python annotate.py --help. This should give you the list of currently available command line arguments."
- [other] The annotate.py script can be invoked from the command line with the --help flag to display available options and functionality.: "The annotate.py script can be invoked from the command line with the --help flag to display available options and functionality."
- [other] Capture and validate that the help output is emitted to standard output.: "Capture and validate that the help output is emitted to standard output."
- [readme] ChemDistiller supports Python 2 and 3 (64-bit version recommended) and requires SciPy, NumPy, h5py libraries.: "ChemDistiller supports Python 2 and 3 (64-bit version recommended) and requires SciPy, NumPy, h5py libraries."
- [readme] maximum for your PC will be shown in help screen (see
python annotate.py --help): "maximum for your PC will be shown in help screen (see python annotate.py --help)"
1---2name: command-line-interface-testing-23description: Use when after installing a Python package or before running a computational workflow for the first time, to verify that the CLI entry point is properly configured, the Python environment is correctly set up, and to discover available command-line arguments and their defaults (e.4license: CC-BY-4.05metadata:6 edam_operation: http://edamontology.org/operation_00047 edam_topics:8 - http://edamontology.org/topic_00919 - http://edamontology.org/topic_352010 tools:11 - Python12 - annotate.py13 techniques:14 - mass-spectrometry15derived_from:16- doi: 10.1093/bioinformatics/bty08017 title: ChemDistiller18evidence_spans:19- ChemDistiller supports Python 2 and 3 (64-bit version recommended)20claims: []21provenance:22 collection: https://w3id.org/holobiomicslab/asb-skill/collection/metabolomics/v223 assembled_by: scripts/collect_metabolomics_collection.py24 sources:25 - build: coll_chemdistiller_cq26 doi: 10.1093/bioinformatics/bty08027 title: ChemDistiller28 dedup_kept_from: coll_chemdistiller_cq29schema_version: 0.2.030attribution:31 generator: AgenticScienceBuilder32 original_doi: 10.1093/bioinformatics/bty08033 all_source_dois:34 - 10.1093/bioinformatics/bty08035 zenodo_doi: 10.5281/zenodo.2079402736 curators: []37 promoter: Louis-Félix Nothias38 sponsor: CNRS & Université Côte d'Azur39---4041# command-line-interface-testing4243## Summary4445Validate that a Python-based command-line tool (such as ChemDistiller's annotate.py) executes correctly and emits expected help documentation when invoked with the --help flag. This skill confirms entry-point accessibility and documents available command-line arguments before running production analyses.4647## When to use4849After installing a Python package or before running a computational workflow for the first time, to verify that the CLI entry point is properly configured, the Python environment is correctly set up, and to discover available command-line arguments and their defaults (e.g., number of CPUs, MS1 m/z tolerance, output folder specification) that must be configured for your specific analysis.5051## When NOT to use5253- The script has already been validated by prior successful test runs; further --help invocations add no new diagnostic value.54- You are performing interactive Python development and need programmatic access to argument definitions; use introspection or argparse module inspection instead.55- The Python environment or package is not installed; resolve installation errors before attempting CLI testing.5657## Inputs5859- Python package installation directory path60- Shell environment with Python 2 or 3 (64-bit recommended)61- Required dependencies installed (SciPy, NumPy, h5py for ChemDistiller)6263## Outputs6465- Help documentation text printed to standard output66- List of available command-line arguments and their descriptions67- Default parameter values68- Usage examples or command syntax patterns6970## How to apply7172Navigate to the installed package directory (e.g., .../ChemDistiller/). Invoke the entry-point script with the --help flag using Python (e.g., `python annotate.py --help`). Capture and validate the standard output for the presence of documented command-line arguments, their descriptions, default values, and usage examples. Check that the help output is well-formed and lists all parameters relevant to your analysis (e.g., --ncpu, --delta_mz, --max_results for ChemDistiller). A successful invocation confirms the script's executable state, the Python environment's availability, and provides the reference documentation needed to construct valid production commands.7374## Related tools7576- **Python** (Interpreter for executing the annotate.py entry-point script and capturing CLI output)77- **annotate.py** (ChemDistiller command-line entry point being tested for proper invocation and help documentation emission) — https://github.com/Mrqeoqqt/chemdistiller7879## Examples8081```82python annotate.py --help83```8485## Evaluation signals8687- Exit code is 0 (success) when --help is invoked.88- Help text is emitted to standard output without error messages or exceptions.89- All expected command-line arguments (--ncpu, --delta_mz, --max_results, --test, --svm_folder, etc.) are documented in the output.90- Default values are explicitly stated for optional parameters (e.g., --ncpu default: 1, --max_results default: 10).91- Help output includes usage examples or a description of positional arguments such as Input_Spectra_folder and optional output_folder.9293## Limitations9495- The --help flag documents only the entry point's static argument schema; it does not validate runtime behavior, database connectivity, or file I/O against actual input spectra.96- Help output does not confirm that optional dependencies (RDKit for 2D structure image generation) are installed; a separate verification step is needed for optional features.97- Help invocation does not test the tool's ability to process actual spectra or produce correct annotations; use --test mode or a small validation dataset for end-to-end validation.9899## Evidence100101- [readme] Try running __ChemDistiller__ from the command line: `python annotate.py --help`. This should give you the list of currently available command line arguments.: "Try running __ChemDistiller__ from the command line: `python annotate.py --help`. This should give you the list of currently available command line arguments."102- [other] The annotate.py script can be invoked from the command line with the --help flag to display available options and functionality.: "The annotate.py script can be invoked from the command line with the --help flag to display available options and functionality."103- [other] Capture and validate that the help output is emitted to standard output.: "Capture and validate that the help output is emitted to standard output."104- [readme] ChemDistiller supports Python 2 and 3 (64-bit version recommended) and requires _SciPy_, _NumPy_, _h5py_ libraries.: "ChemDistiller supports Python 2 and 3 (64-bit version recommended) and requires _SciPy_, _NumPy_, _h5py_ libraries."105- [readme] maximum for your PC will be shown in help screen (see `python annotate.py --help`): "maximum for your PC will be shown in help screen (see `python annotate.py --help`)"