Repository navigation
Keep dashed CLI flags off the TUI - #40
Conversation
Bare github-usage still opens the Textual app. scripts/check now feeds unittest stdin from /dev/null and kills a run that exceeds 180s, so a routing regression cannot hang the harness. Co-authored-by: Cursor <cursoragent@cursor.com>
Reviewer's GuideImplementationRestrict automatic TUI launch to bare invocations in a TTY, leaving dashed arguments for CLI handling.
ConfigurationMake the check and coverage harnesses run with stdin redirected so tests cannot hang on terminal input.
DocumentationRecord the CLI routing change and its behavior in the changelog.
TestsCover dashed arguments on a TTY and verify they bypass the TUI while preserving argv.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Secrets | Nov 14, 2026 9:09p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
|
[Medium impact] The PR appears safe to merge.
|
|
@coderabbitai review |
Action performed
|



Summary
github-usagewhen both stdin and stdout are TTYs. Dashed arguments such as--export,--no-interactive, and-vstay on the CLI.scripts/checkruns unittest with stdin from/dev/nulland a 180skill -9cap, so a routing regression cannot hang the harness. The coverage discover gets the same stdin redirect../start.sh -vis unchanged: the shell script already maps-vto--versionbefore Python routing. Version stays0.1.0; the note is under[Unreleased].Test plan
tests.test_gui_modelscovers dashed argv on a forced TTY (run_tuinot called, argv preserved) and still covers the bare-TTY launch.test_export_does_not_call_user_when_session_returns_dataexitsokinstead of drawing the TUI.github-usage --export json --no-interactivewith an emptyHOME, no token env, andPATH=/usr/bin:/binexits 1 with "No GitHub token found" and does not draw the TUI.python -m github_usage </dev/nullprints help and exits 0.unittest discoverwith stdin from/dev/nullpasses (OK (skipped=2)).scripts/check, coverage, and complexity gates passed.A full discover attached to a PTY still blocks later in
test_token_positional_only, which callsinput()for an export format when stdin is a TTY and--no-interactiveis absent. That prompt is separate from the TUI hang.scripts/checkdoes not hit it because stdin is/dev/null.Made with Cursor
Summary by Sourcery
Restrict TUI startup to bare interactive invocations and make automated checks resilient to interactive hangs.
Bug Fixes:
Documentation:
Tests:
Summary by CodeRabbit
--export,--no-interactive, and-vnow stay in CLI mode when run in a terminal. Runninggithub-usagealone in a terminal continues to launch the interactive app.