@@ -203,29 +203,33 @@ def write_config_file(config_data):
203203
204204 if config_data ["openai_api_key" ] is None :
205205 console .print (
206- "An OpenAI API key is required to use AICodeBot. You can get one for free on the OpenAI website.\n "
206+ "You need an OpenAI API Key for AICodeBot. You can get one on the OpenAI website." ,
207+ style = bot_style ,
207208 )
208209 openai_api_key_url = "https://platform.openai.com/account/api-keys"
209- if click .confirm ("Open the OpenAI API keys page for you in a browser?" , default = False ):
210+ if click .confirm ("Open the api keys page in a browser?" , default = False ):
210211 webbrowser .open (openai_api_key_url )
211212
212- config_data ["openai_api_key" ] = input_prompt ("Please enter your OpenAI API key" )
213+ config_data ["openai_api_key" ] = click . prompt ("Please enter your OpenAI API key" ). strip ( )
213214
214215 # Validate the API key
215216 try :
216217 openai .api_key = config_data ["openai_api_key" ]
217- click . echo ("Validating the OpenAI API key" )
218- engine .Engine .list ()
218+ with console . status ("Validating the OpenAI API key" , spinner = DEFAULT_SPINNER ):
219+ engine .Engine .list ()
219220 except Exception as e :
220221 raise click .ClickException (f"Failed to validate the API key: { str (e )} " ) from e
221- click . echo ("✅ The API key is valid." )
222+ console . print ("✅ The API key is valid." )
222223
223224 # ---------------------- Collect the personality choice ---------------------- #
224225
225226 # Pull the choices from the name from each of the PERSONALITIES
226- personality_choices = "\n How would you like your AI to act? You can choose from the following personalities:\n "
227+ console .print (
228+ "\n How would you like your AI to act? You can choose from the following personalities:\n " , style = bot_style
229+ )
230+ personality_choices = ""
227231 for key , personality in PERSONALITIES .items ():
228- personality_choices += f"\t { key } - { personality .description } \n "
232+ personality_choices += f"\t [b] { key } [/b] - { personality .description } \n "
229233 console .print (personality_choices )
230234
231235 config_data ["personality" ] = click .prompt (
@@ -237,14 +241,6 @@ def write_config_file(config_data):
237241 write_config_file (config_data )
238242 console .print ("✅ Configuration complete, you're ready to run aicodebot!\n " )
239243
240- # After writing the config file, print the usage for the top-level group
241- ctx = click .get_current_context ()
242- while ctx .parent is not None :
243- ctx = ctx .parent
244- console .print (ctx .get_help ())
245-
246- console .print ("\n Don't know where to start? Try running `aicodebot alignment`." )
247-
248244
249245@cli .command (context_settings = {"ignore_unknown_options" : True })
250246@click .argument ("command" , nargs = - 1 )
@@ -375,11 +371,10 @@ def sidekick(request, verbose, response_token_size, files):
375371 EXPERIMENTAL: Coding help from your AI sidekick\n
376372 FILES: List of files to be used as context for the session
377373 """
378-
379- console .print ("This is an experimental feature. Play with it, but don't count on it." , style = warning_style )
380-
381374 setup_config ()
382375
376+ console .print ("This is an experimental feature" , style = warning_style )
377+
383378 # Pull in context. Right now it's just the contents of files that we passed in.
384379 # Soon, we could add vector embeddings of:
385380 # imported code / modules / libraries
@@ -441,7 +436,7 @@ def sidekick(request, verbose, response_token_size, files):
441436def setup_config ():
442437 existing_config = read_config ()
443438 if not existing_config :
444- console .print ("No config file found. Running configure... \n " )
439+ console .print ("Welcome to AI Code Bot! 🤖. Let's set up your config file. \n " , style = bot_style )
445440 configure .callback (openai_api_key = None , verbose = 0 )
446441 sys .exit ()
447442 else :
0 commit comments