CLI Reference¶
This page provides a complete reference for all BPM command-line interface commands and options.
Command Overview¶
BPM provides several main command categories:
- Project Management:
init
,info
- Repository Management:
repo
- Template Operations:
generate
,update
- Workflow Execution:
run
- Utility Commands:
--help
,--version
Global Options¶
All BPM commands support these global options:
--help, -h Show help message and exit
--version, -V Show version and exit
--verbose, -v Enable verbose output
--quiet, -q Suppress output
Project Management Commands¶
bpm init
¶
Initialize a new bioinformatics project.
Arguments: - PROJECT_NAME
: Project name in format YYMMDD_ProjectName_Institute_Application
Options:
--force, -f Overwrite existing project directory
--template TEXT Use specific template for initialization
--config PATH Path to configuration file
Examples:
# Basic project initialization
bpm init 240101_RNAseq_Study_Institute_Research
# Initialize with specific template
bpm init 240101_RNAseq_Study_Institute_Research --template nfcore:rnaseq
# Force overwrite existing directory
bpm init 240101_RNAseq_Study_Institute_Research --force
bpm info
¶
Display project information and status.
Options:
--project PATH Path to project.yaml file (default: current directory)
--template TEXT Show information for specific template
--verbose, -v Show detailed information
Examples:
# Show current project info
bpm info
# Show info for specific project
bpm info --project /path/to/project/project.yaml
# Show detailed template information
bpm info --template demultiplexing:bclconvert --verbose
Repository Management Commands¶
bpm repo
¶
Manage BPM repositories.
bpm repo add
¶
Add a new repository to BPM.
Arguments: - REPOSITORY_PATH
: Path to repository (local path or Git URL)
Options:
Examples:
# Add local repository
bpm repo add /path/to/local/repo
# Add from Git URL
bpm repo add https://github.com/username/bpm-repo.git
# Add with custom name
bpm repo add /path/to/repo --name my-custom-repo
bpm repo list
¶
List all available repositories.
Options:
Examples:
bpm repo select
¶
Select the active repository.
Arguments: - REPOSITORY_NAME
: Name of the repository to activate
Examples:
# Select repository by name
bpm repo select my-repository
# Select default repository
bpm repo select default
bpm repo update
¶
Update repository from source.
Arguments: - REPOSITORY_NAME
: Name of repository to update (optional, updates all if not specified)
Options:
Examples:
# Update all repositories
bpm repo update
# Update specific repository
bpm repo update my-repository
# Force update
bpm repo update --force
bpm repo remove
¶
Remove a repository from BPM.
Arguments: - REPOSITORY_NAME
: Name of the repository to remove
Options:
Examples:
# Remove repository
bpm repo remove my-repository
# Force removal
bpm repo remove my-repository --force
Template Operations¶
bpm generate
¶
Generate files from templates.
Arguments: - TEMPLATE_NAME
: Template name in format section:name
Options:
--project PATH Path to project.yaml file
--output PATH Output directory (default: current directory)
--force, -f Overwrite existing files
--dry-run Show what would be generated without creating files
--list, -l List available templates
--variables TEXT Additional template variables (JSON format)
Examples:
# Generate from template
bpm generate demultiplexing:bclconvert --project project.yaml
# List available templates
bpm generate --list
# Dry run to see what would be generated
bpm generate nfcore:rnaseq --project project.yaml --dry-run
# Generate with custom variables
bpm generate nfcore:rnaseq --project project.yaml --variables '{"threads": 8, "memory": "32G"}'
bpm update
¶
Update files generated from templates.
Options:
--project PATH Path to project.yaml file
--template TEXT Update specific template
--force, -f Force update all templates
--dry-run Show what would be updated without making changes
Examples:
# Update all templates
bpm update --project project.yaml
# Update specific template
bpm update --template demultiplexing:bclconvert --project project.yaml
# Dry run to see changes
bpm update --project project.yaml --dry-run
Workflow Execution¶
bpm run
¶
Execute workflows.
Arguments: - WORKFLOW_NAME
: Workflow name in format section:name
Options:
--project PATH Path to project.yaml file
--output PATH Output directory
--force, -f Force execution even if outputs exist
--dry-run Show what would be executed without running
--list, -l List available workflows
--parameters TEXT Workflow parameters (JSON format)
Examples:
# Run workflow
bpm run workflows:generate_nfcore_rnaseq_samplesheet --project project.yaml
# List available workflows
bpm run --list
# Run with parameters
bpm run workflows:generate_nfcore_rnaseq_samplesheet --project project.yaml --parameters '{"input_dir": "/path/to/data"}'
# Dry run workflow
bpm run workflows:generate_nfcore_rnaseq_samplesheet --project project.yaml --dry-run
Configuration¶
Environment Variables¶
BPM uses these environment variables:
BPM_CACHE Cache directory for BPM data (default: $HOME/.cache/bpm)
BPM_CONFIG Path to global configuration file
BPM_LOG_LEVEL Logging level (DEBUG, INFO, WARNING, ERROR)
Configuration Files¶
BPM uses YAML configuration files:
- Global config:
~/.config/bpm/config.yaml
- Project config:
project.yaml
in project directory - Repository config:
repo.yaml
in repository directory
Exit Codes¶
BPM uses standard exit codes:
0
: Success1
: General error2
: Configuration error3
: Template error4
: Workflow error5
: Repository error
Examples¶
Complete Workflow Example¶
# Initialize project
bpm init 240101_RNAseq_Study_Institute_Research
# Add repository
bpm repo add /path/to/bioinformatics_repo
# List available templates
bpm generate --list
# Generate RNA-seq template
bpm generate nfcore:rnaseq --project project.yaml
# List available workflows
bpm run --list
# Run sample sheet generation
bpm run workflows:generate_nfcore_rnaseq_samplesheet --project project.yaml
# Check project status
bpm info --project project.yaml
Advanced Usage¶
# Generate template with custom variables
bpm generate nfcore:rnaseq \
--project project.yaml \
--variables '{"threads": 16, "memory": "64G", "genome": "GRCh38"}'
# Run workflow with parameters
bpm run workflows:process_data \
--project project.yaml \
--parameters '{"input_dir": "/data/raw", "output_dir": "/data/processed"}'
# Update specific template
bpm update --template demultiplexing:bclconvert --project project.yaml
# Force update all templates
bpm update --project project.yaml --force
Getting Help¶
For additional help: