PiTrac CLI Interface

The pitrac command provides minimal service management capabilities. All PiTrac operations including process control, configuration, testing, and calibration are now performed through the web UI at port 8080.

CLI Architecture

Bashly Framework

PiTrac uses Bashly to generate its CLI from a YAML specification:

bashly.yml (specification)
    ↓
bashly generate
    ↓
pitrac (generated script)
    ↓
src/*.sh (command implementations)

The current version is 1.0.0 (generated by bashly 1.3.1).

Global Options

pitrac [global options] <command> [command options]

Global Options:
  --help, -h       Show help message
  --version, -v    Show version
  --config, -c     Use alternate configuration file
  --verbose, -v    Enable verbose output
  --debug          Enable debug mode

Web UI

  • PiTrac Process Management - Start/stop the launch monitor
  • Configuration Management - All settings through a graphical interface
  • Testing Suite - Hardware tests, camera tests, and calibration
  • Shot Monitoring - Real-time shot display and history
  • System Status - View logs, diagnostics, and system health
  • Calibration Wizard - Step-by-step camera calibration

Access the web interface at: http://your-pi-ip:8080

Essential CLI Commands

The CLI provides only basic service management:

Web Server Commands (Primary Usage)

# Start the web server - THIS IS THE MAIN COMMAND YOU NEED
pitrac web start

# Stop the web server
pitrac web stop

# Check web server status
pitrac web status

# View web server logs
pitrac web logs

# Get web UI URL
pitrac web url

Note: Once the web server is running, all PiTrac operations are performed through the web UI.

Supporting Service Commands

Manage supporting services (rarely needed):

# ActiveMQ message broker
pitrac activemq status

# Version information
pitrac version

Note: ActiveMQ is typically managed automatically during installation. Manual control is rarely necessary.

Directory Structure

Many CLI commands are deprecated as functionality moved to the web UI:

packaging/
├── bashly.yml           # CLI specification
├── pitrac              # Generated CLI script
├── generate.sh         # Script to regenerate CLI
├── src/
│   ├── web.sh          # Web server management (PRIMARY)
│   ├── activemq.sh     # ActiveMQ management
│   ├── version.sh      # Version info
│   └── lib/
│       ├── environment.sh  # Environment setup
│       ├── logging.sh      # Logging functions
│       ├── process.sh      # Process management
│       └── services.sh     # Service functions

Key Implementation Details

Binary Location

The PiTrac binary is located at /usr/lib/pitrac/pitrac_lm (defined in src/lib/environment.sh).

Configuration Files

  • User config: ~/.pitrac/config/

Environment Variables

The CLI sets up various environment variables including:

  • LD_LIBRARY_PATH - Library paths
  • PITRAC_ROOT - Installation directory
  • Camera-specific environment variables based on configuration

Generating the CLI

To regenerate the CLI after modifying bashly.yml:

cd packaging

# Using local bashly gem
./generate.sh

# Or using Docker
docker run --rm -v "$PWD:/app" dannyben/bashly generate

# The generated script will be: pitrac