Skip to content

[codex-rs] fix: exit code 1 if no api key #697

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

Merged
merged 3 commits into from
Apr 29, 2025
Merged

Conversation

fouad-openai
Copy link
Collaborator

No description provided.

Comment on lines 59 to 61
"\n\x1b[31mMissing OpenAI API key.\x1b[0m\n\n\
Set the environment variable \x1b[1mOPENAI_API_KEY\x1b[0m and re-run this command.\n\
You can create a key here: \x1b[1m\x1b[4mhttps://platform.openai.com/account/api-keys\x1b[0m\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick; we have owo-colors in the workspace already, this would read better if we stylized with that instead. See: https://docs.rs/owo-colors/latest/owo_colors/

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have good news for you: #719

Copy link
Collaborator

@oai-ragona oai-ragona left a comment

Choose a reason for hiding this comment

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

shippit!

@fouad-openai fouad-openai merged commit 19928bc into main Apr 29, 2025
8 checks passed
@fouad-openai fouad-openai deleted the rust-exit-if-no-oai-key branch April 29, 2025 04:42
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2025
@bolinfest
Copy link
Collaborator

has_api_key() seems like a general utility that could maybe live somewhere in core? Also, it does not really merit being at the top of the file...

@@ -24,3 +24,4 @@ tokio = { version = "1", features = [
] }
tracing = { version = "0.1.41", features = ["log"] }
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
owo-colors = "4.2.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: alpha sort

@@ -39,6 +51,20 @@ pub async fn run_main(cli: Cli) -> anyhow::Result<()> {
..
} = cli;

// ---------------------------------------------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

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

This header comment doesn't fit with the existing style.

@bolinfest
Copy link
Collaborator

I'm moving this around a bit in #719 FYI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants