Skip to content

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Aug 20, 2025

This PR fixes the CLI abort status bug by replacing all instances of typer.Abort() with typer.Exit(1).

Problem

When using typer.Abort(), the CLI would exit with an error but didn't allow specifying a custom exit code. This could cause issues with scripts that rely on specific exit codes.

Solution

  • Replaced all instances of typer.Abort() with typer.Exit(1) to ensure consistent exit codes
  • This affects the following files:
    • src/codegen/cli/errors.py
    • src/codegen/cli/auth/decorators.py
    • src/codegen/cli/auth/session.py

Testing

The CLI will now consistently return exit code 1 when encountering errors, which can be checked with echo \0 after running a command that fails.

Co-authored-by: Rushil Patel rpatel@codegen.com

This ensures consistent exit codes when the CLI encounters errors.

Co-authored-by: Rushil Patel <rpatel@codegen.com>
@codegen-sh codegen-sh bot requested review from a team and codegen-team as code owners August 20, 2025 04:25
@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/codegen/cli/auth/session.py 0.00% 3 Missing ⚠️
src/codegen/cli/errors.py 0.00% 1 Missing ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant