-
Notifications
You must be signed in to change notification settings - Fork 3
release: v1.0.14 refactor cli startup and update version #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,13 @@ All notable changes to Refactron will be documented in this file. | |||||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||||||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||||||
|
|
||||||
| ## [1.0.13] - 2026-01-29 | ||||||
| ## [1.0.14] - 2026-01-30 | ||||||
|
|
||||||
| ### Changed | ||||||
| - Refactored CLI startup sequence to display animation before authentication prompt. | ||||||
| - Improved dependency management (added `astroid`). | ||||||
|
|
||||||
| ## [1.0.13] - 2026-01-30 | ||||||
|
||||||
| ## [1.0.13] - 2026-01-30 | |
| ## [1.0.13] - 2026-01-29 |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -90,7 +90,7 @@ def _auth_banner(title: str) -> None: | |||||||||
| style="panel.border", | ||||||||||
| box=box.ROUNDED, | ||||||||||
| padding=(1, 2), | ||||||||||
| subtitle="[secondary]v1.0.13[/secondary]", | ||||||||||
| subtitle="[secondary]v1.0.14[/secondary]", | ||||||||||
| subtitle_align="right", | ||||||||||
| ) | ||||||||||
| ) | ||||||||||
|
|
@@ -736,45 +736,54 @@ def main(ctx: click.Context) -> None: | |||||||||
| # Check authentication for all commands except login/logout | ||||||||||
| exempt_commands = ["login", "logout", "auth"] | ||||||||||
|
|
||||||||||
| if ctx.invoked_subcommand not in exempt_commands: | ||||||||||
| creds = load_credentials() | ||||||||||
| is_authenticated = False | ||||||||||
| if creds and creds.access_token: | ||||||||||
| now = datetime.now(timezone.utc) | ||||||||||
| if not creds.expires_at or creds.expires_at > now: | ||||||||||
| is_authenticated = True | ||||||||||
| # 1. Pre-check authentication status | ||||||||||
| creds = load_credentials() | ||||||||||
| is_authenticated = False | ||||||||||
| if creds and creds.access_token: | ||||||||||
| now = datetime.now(timezone.utc) | ||||||||||
| if not creds.expires_at or creds.expires_at > now: | ||||||||||
| is_authenticated = True | ||||||||||
|
|
||||||||||
| # 2. Show animation if dashboard mode OR if auth is required and missing | ||||||||||
| should_show_animation = ctx.invoked_subcommand is None or ( | ||||||||||
| ctx.invoked_subcommand not in exempt_commands and not is_authenticated | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| if not is_authenticated: | ||||||||||
| # If it's a subcommand, we might want a slightly different message | ||||||||||
| if ctx.invoked_subcommand: | ||||||||||
| console.print( | ||||||||||
| f"\n[yellow]Authentication required to run '{ctx.invoked_subcommand}'[/yellow]" | ||||||||||
| if should_show_animation: | ||||||||||
| _run_startup_animation() | ||||||||||
|
|
||||||||||
| # 3. Handle authentication requirement | ||||||||||
| if ctx.invoked_subcommand not in exempt_commands and not is_authenticated: | ||||||||||
| # If it's a subcommand, we might want a slightly different message | ||||||||||
| if ctx.invoked_subcommand: | ||||||||||
| console.print( | ||||||||||
| f"\n[yellow]Authentication required to run '{ctx.invoked_subcommand}'[/yellow]" | ||||||||||
| ) | ||||||||||
| else: | ||||||||||
| console.print(Align.center(Text("\nAuthentication Required", style="bold"))) | ||||||||||
|
|
||||||||||
| if Prompt.ask("\nLog in to continue?", choices=["y", "n"], default="y") == "y": | ||||||||||
| try: | ||||||||||
| ctx.invoke( | ||||||||||
| login, | ||||||||||
| api_base_url=DEFAULT_API_BASE_URL, | ||||||||||
| no_browser=False, | ||||||||||
| timeout=300, | ||||||||||
| force=False, | ||||||||||
| ) | ||||||||||
| else: | ||||||||||
| console.print(Align.center(Text("\nAuthentication Required", style="bold"))) | ||||||||||
|
|
||||||||||
| if Prompt.ask("\nLog in to continue?", choices=["y", "n"], default="y") == "y": | ||||||||||
| try: | ||||||||||
| ctx.invoke( | ||||||||||
| login, | ||||||||||
| api_base_url=DEFAULT_API_BASE_URL, | ||||||||||
| no_browser=False, | ||||||||||
| timeout=300, | ||||||||||
| force=False, | ||||||||||
| ) | ||||||||||
| # Re-check credentials | ||||||||||
| creds = load_credentials() | ||||||||||
| if creds and creds.access_token: | ||||||||||
| is_authenticated = True | ||||||||||
| except SystemExit: | ||||||||||
| pass | ||||||||||
| # Re-check credentials | ||||||||||
| creds = load_credentials() | ||||||||||
| if creds and creds.access_token: | ||||||||||
| is_authenticated = True | ||||||||||
| except SystemExit: | ||||||||||
|
||||||||||
| except SystemExit: | |
| except SystemExit: | |
| # Intentionally ignore SystemExit from the login command so that | |
| # we can fall through and handle the unauthenticated case below. |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an unnecessary pass statement at the end of the main function. Since the function already has substantive code, this pass statement serves no purpose and should be removed for cleaner code.
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency addition note is somewhat vague. Since astroid is added to pyproject.toml and requirements.txt but isn't actually used anywhere in the codebase (based on the diff), it would be helpful to clarify in the CHANGELOG why this dependency is being added. Is it preparation for future work, or is there an implicit need that's not obvious from the code changes?