Coverage for src / sentry_tool / cli.py: 88.00%
25 statements
« prev ^ index » next coverage.py v7.13.2, created at 2026-02-15 10:53 -0500
« prev ^ index » next coverage.py v7.13.2, created at 2026-02-15 10:53 -0500
1from typing import Annotated
3import typer
5from sentry_tool.commands import config, events, issues, projects, traces
6from sentry_tool.monitoring import setup_logging, setup_sentry
7from sentry_tool.utils import set_active_profile, set_active_project
9app = typer.Typer(
10 help="Sentry Tool - Query and manage Sentry issues.",
11 no_args_is_help=True,
12)
14app.add_typer(config.config_app, name="config")
16app.command("list")(issues.list_issues)
17app.command("show")(issues.show_issue)
18app.command("event")(events.show_event)
19app.command("events")(events.list_events)
20app.command("tags")(events.show_tags)
21app.command("transactions")(traces.list_transactions)
22app.command("trace")(traces.lookup_trace)
23app.command("transaction")(traces.show_transaction)
24app.command("list-projects")(projects.list_projects)
25app.command("open")(projects.open_sentry)
28@app.callback()
29def callback(
30 profile: Annotated[
31 str | None,
32 typer.Option("--profile", "-P", help="Use named profile from config"),
33 ] = None,
34 project: Annotated[
35 str | None,
36 typer.Option("--project", "-p", help="Override project slug from profile"),
37 ] = None,
38) -> None:
39 set_active_profile(profile)
40 set_active_project(project)
43def cli() -> None:
44 setup_logging()
45 setup_sentry(environment="local")
46 app()