Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ynamazon/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
from rich.table import Table
from typer import Argument, Option, Typer
from ynab import Configuration
from typer import Context
from typer import run as typer_run
from rich import print as rprint

from .amazon_transactions import AmazonConfig, get_amazon_transactions
from .main import process_transactions
Expand Down Expand Up @@ -168,3 +171,15 @@ def ynamazon(
ynab_config=Configuration(access_token=ynab_api_key),
budget_id=ynab_budget_id,
)


@cli.callback(invoke_without_command=True)
def yna_callback(ctx: Context) -> None:
"""
[bold cyan]Run 'yna' to match and update transactions using the arguements in .env. [/]

[yellow i]Use 'yna ynamazon [ARGS]' to use command-line arguements to override .env. [/]
"""
rprint("[bold cyan]Starting YNAmazon processing...[/]")
if ctx.invoked_subcommand is None:
typer_run(function=ynamazon)