Skip to content

Latest commit

 

History

History
225 lines (147 loc) · 4.16 KB

File metadata and controls

225 lines (147 loc) · 4.16 KB

CLI Reference

Command-line interface reference for Count-Cups.

Overview

Count-Cups can be run from the command line with various options to customize behavior.

Basic Usage

python -m app.main [OPTIONS]

Command-Line Options

--debug

Enable debug mode with verbose logging.

python -m app.main --debug

Effect: Sets log level to DEBUG and enables debug mode.

--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}

Set the logging level.

python -m app.main --log-level DEBUG

Default: INFO

Options:

  • DEBUG: Detailed debugging information
  • INFO: General informational messages
  • WARNING: Warning messages
  • ERROR: Error messages only
  • CRITICAL: Critical errors only

--theme {auto,light,dark,dracula}

Set the application theme.

python -m app.main --theme dark

Default: auto

Options:

  • auto: Auto-detect system theme
  • light: Light theme
  • dark: Dark theme
  • dracula: Dracula theme

--detection-engine {heuristics,mediapipe}

Set the detection engine.

python -m app.main --detection-engine mediapipe

Default: heuristics

Options:

  • heuristics: Fast heuristic-based detection (default)
  • mediapipe: Advanced MediaPipe-based detection (requires MediaPipe)

--camera-index INTEGER

Specify which camera device to use.

python -m app.main --camera-index 1

Default: 0

Note: Use 0 for default camera, 1 for second camera, etc.

--no-camera

Run without camera (for testing).

python -m app.main --no-camera

Use Case: Testing without camera access or running in headless mode.

--version

Show version information and exit.

python -m app.main --version

Output: Count-Cups 1.0.0

Examples

Basic Launch

python -m app.main

Debug Mode

python -m app.main --debug

Custom Theme and Detection

python -m app.main --theme dark --detection-engine mediapipe

Specific Camera with Debug

python -m app.main --camera-index 1 --debug --log-level DEBUG

Testing Without Camera

python -m app.main --no-camera --debug

Environment Variables

Command-line arguments can be overridden by environment variables. See Configuration Guide for details.

Exit Codes

  • 0: Success
  • 1: Error (missing dependencies, fatal error)

Integration Examples

Shell Script

#!/bin/bash
# Launch Count-Cups with custom settings

python -m app.main \
    --theme dark \
    --detection-engine heuristics \
    --camera-index 0 \
    --log-level INFO

PowerShell Script

# Launch Count-Cups with custom settings

python -m app.main `
    --theme dark `
    --detection-engine heuristics `
    --camera-index 0 `
    --log-level INFO

Batch File (Windows)

@echo off
REM Launch Count-Cups with custom settings

python -m app.main ^
    --theme dark ^
    --detection-engine heuristics ^
    --camera-index 0 ^
    --log-level INFO

Troubleshooting

Command Not Found

Issue: python: command not found

Solution:

  • Use python3 instead of python
  • Add Python to PATH
  • Use full path to Python executable

Module Not Found

Issue: ModuleNotFoundError: No module named 'app'

Solution:

  • Ensure you're in the project root directory
  • Activate virtual environment
  • Install dependencies: pip install -r requirements.txt

Camera Not Found

Issue: Camera not detected

Solution:

  • Check camera permissions
  • Try different camera index: --camera-index 1
  • Verify camera is not in use by other applications

Next Steps


CLI Reference complete! Use command-line options to customize Count-Cups behavior.