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
3 changes: 2 additions & 1 deletion codeflash/cli_cmds/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from rich.table import Table
from rich.text import Text

from codeflash.api.cfapi import is_github_app_installed_on_repo
from codeflash.api.cfapi import get_user_id, is_github_app_installed_on_repo
from codeflash.cli_cmds.cli_common import apologize_and_exit
from codeflash.cli_cmds.console import console, logger
from codeflash.cli_cmds.extension import install_vscode_extension
Expand Down Expand Up @@ -1216,6 +1216,7 @@ def enter_api_key_and_save_to_rc() -> None:
# On Windows, create a batch file in the user's home directory (not auto-run, just used to store api key)
shell_rc_path.touch()
click.echo(f"✅ Created {shell_rc_path}")
get_user_id(api_key=api_key) # Used to verify whether the API key is valid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HeshamHM28 how are you using the result of get_user_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside get_user_id, if the API key is invalid, we log ‘Invalid Codeflash API key’ and exit. Screenshot 2025-11-19 at 9 15 08 PM

result = save_api_key_to_rc(api_key)
if is_successful(result):
click.echo(result.unwrap())
Expand Down
Loading