From 390428539146eb43726db7cda9abc092779fa649 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Tue, 2 Jun 2026 11:29:20 +0200 Subject: [PATCH] main: bail at startup if we don't have an openai api key --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index b93804b..f81a8ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -509,6 +509,12 @@ enum AudioRecordRequest { #[tokio::main] async fn main() { color_eyre::install().unwrap(); + + if option_env!("OPENAI_API_KEY").is_none() { + eprintln!("Error: OPENAI_API_KEY environment variable not set. The application will not function without it."); + return; + } + let mut terminal: Terminal> = ratatui::init(); let (prediction_in, mut prediction_out) = tokio::sync::watch::channel(None);