CLI Overview¶
BoxLab provides a comprehensive command-line interface for managing, converting, and analyzing object detection datasets. This guide covers the CLI structure, global options, and common usage patterns.
Command Structure¶
BoxLab CLI follows a hierarchical command structure:
Global Options¶
Available for all commands:
boxlab --help # Show help message
boxlab --version # Show version information
boxlab --verbose # Enable verbose output with tracebacks
boxlab -v # Short form of --verbose
Available Commands¶
annotator¶
Launch the GUI annotation tool:
No arguments required. Opens the interactive annotation interface.
dataset¶
Dataset management operations with subcommands:
Subcommands:
convert- Convert between formatsinfo- Display dataset informationmerge- Merge multiple datasetsvisualize- Generate visualizations
Common Patterns¶
Getting Help¶
# General help
boxlab --help
# Command help
boxlab dataset --help
# Subcommand help
boxlab dataset convert --help
Verbose Mode¶
Enable detailed output and full tracebacks:
Version Information¶
Running Methods¶
As Installed Command¶
After pip install boxlab:
As Python Module¶
Useful when boxlab command is not in PATH:
With Poetry¶
In development environment:
Error Handling¶
Error Codes¶
BoxLab CLI uses exit codes to indicate status:
0- Success1- General error2- Missing dependency error10-16- Dataset-related errors20- Validation error130- Interrupted by user (Ctrl+C)
Error Messages¶
Without --verbose:
With --verbose:
✗ Dataset not found at path: /path/to/dataset
Traceback (most recent call last):
File "boxlab/cli/__init__.py", line 15, in main
...
boxlab.exceptions.DatasetNotFoundError: Dataset not found at path: /path/to/dataset
Shell Completion¶
Bash¶
Add to ~/.bashrc:
Zsh¶
Add to ~/.zshrc:
Fish¶
Add to ~/.config/fish/completions/boxlab.fish:
Tips and Tricks¶
1. Use Absolute Paths¶
Always use absolute paths for clarity:
2. Check Before Converting¶
View dataset info before conversion:
# Check source
boxlab dataset info data/coco --format coco
# Then convert
boxlab dataset convert data/coco.json -if coco output/yolo -of yolo
3. Use --seed for Reproducibility¶
Always specify seed for consistent splits:
4. Dry Run with --no-copy¶
Test conversion without copying images:
Next Steps¶
- Dataset Commands - Detailed guide to dataset operations
- Annotator Command - Using the GUI from CLI
Reference¶
- API Reference - Python API documentation
- Dataset CLI - Dataset command reference