feat: Add --debug option to CLI for verbose output

This commit introduces a global  option to the GarminSync CLI, providing verbose logging and diagnostic information for troubleshooting.

Key changes include:

- Implemented a  to manage and propagate the debug flag across CLI commands.

- Refactored  in  to accept and utilize the debug flag, enabling detailed logging of HTTP requests and responses.

- Updated CLI commands (, ) to access the  from the .

- Resolved circular import by extracting  into a dedicated  module.

- Configured  for Poetry-based dependency management.

- Addressed various  type hinting issues and  linting warnings across the CLI codebase to maintain code quality.
This commit is contained in:
2025-12-22 06:39:40 -08:00
parent 9e096e6f6e
commit 02fa8aa1eb
13 changed files with 1018 additions and 325 deletions

10
cli/src/context.py Normal file
View File

@@ -0,0 +1,10 @@
import click
from typing import Optional
from .api.client import ApiClient # Import ApiClient
class CliContext:
def __init__(self):
self.debug = False
self.api_client: Optional[ApiClient] = None # Store ApiClient instance
pass_cli_context = click.make_pass_decorator(CliContext, ensure=True)