feat: add --change-key flag to update API key

This commit is contained in:
2025-12-31 21:22:46 +05:30
parent e1974599c8
commit adfc426ede
3 changed files with 27 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ use noentropy::cli::{
Args,
orchestrator::{handle_organization, handle_undo},
};
use noentropy::settings::config::change_and_prompt_api_key;
use noentropy::settings::{get_or_prompt_config, get_or_prompt_download_folder};
#[tokio::main]
@@ -14,6 +15,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
handle_undo(args, download_path).await?;
return Ok(());
}
if args.change_key {
let api_key = change_and_prompt_api_key();
match api_key {
Ok(_key) => println!("Key saved"),
Err(e) => {
eprintln!("{e}")
}
}
}
let config = get_or_prompt_config()?;