Command Line Interface
VirtualLanes provides a comprehensive command-line interface (CLI) built with Typer, offering rich command-line functionality with subcommands, options, and help documentation.
Installation
The CLI is automatically installed when you install VirtualLanes:
Command Structure
VirtualLanes's CLI follows a subcommand structure:
Main commands include:
bowlers- Manage bowlersgames- Manage gamesleagues- Manage leaguestui- Access the Terminal User Interfaceweb- Access the Web Interface
Global Help
To see all available commands:
Bowler Management
List bowlers
Example output:
┏━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Name ┃ Average ┃
┡━━━━━━━━━━━━╇━━━━━━━━━┩
│ John Doe │ 180 │
│ Jane Smith │ 210 │
│ Bob Johnson │ 160 │
└─────────────┴─────────┘
Add a bowler
Get help on bowler commands
Game Management
List games
Example output:
┏━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┓
┃ Date ┃ Bowler ┃ Score ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━┩
│ 2023-05-01 │ John Doe │ 185 │
│ 2023-05-02 │ Jane Smith │ 215 │
│ 2023-05-03 │ Bob Johnson│ 155 │
└─────────────┴────────────┴───────┘
Add a game
Get help on game commands
League Management
List leagues
Example output:
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Name ┃ Members ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ Friday Night League │ 12 │
│ Sunday Afternoon League │ 8 │
└─────────────────────────┴─────────┘
Add a league
Get help on league commands
TUI Interface
Start the Terminal User Interface:
Web Interface
Start the Web Interface:
With custom host and port:
Enable debug mode:
Python API Access
You can also access the CLI programmatically from Python:
This is equivalent to running the virtual-lanes command in the terminal.
Advanced Usage
Environment Variables
VirtualLanes CLI also respects environment variables. Any option can be set using an environment variable with the prefix VIRTUAL_LANES_ followed by the option name in uppercase.
For example:
- --host can be set with VIRTUAL_LANES_HOST
- --port can be set with VIRTUAL_LANES_PORT