2828import zipfile
2929import tempfile
3030import shutil
31+ import shlex
3132import json
3233from pathlib import Path
3334from typing import Optional , Tuple
@@ -983,12 +984,24 @@ def init(
983984 # Boxed "Next steps" section
984985 steps_lines = []
985986 if not here :
986- steps_lines .append (f"1. [bold green ]cd { project_name } [/bold green ]" )
987+ steps_lines .append (f"1. Go to the project folder: [cyan ]cd { project_name } [/cyan ]" )
987988 step_num = 2
988989 else :
989990 steps_lines .append ("1. You're already in the project directory!" )
990991 step_num = 2
991992
993+ # Add Codex-specific setup step if needed
994+ if selected_ai == "codex" :
995+ codex_path = project_path / ".codex"
996+ quoted_path = shlex .quote (str (codex_path ))
997+ if os .name == "nt" : # Windows
998+ cmd = f"setx CODEX_HOME { quoted_path } "
999+ else : # Unix-like systems
1000+ cmd = f"export CODEX_HOME={ quoted_path } "
1001+
1002+ steps_lines .append (f"{ step_num } . Set [cyan]CODEX_HOME[/cyan] environment variable before running Codex: [cyan]{ cmd } [/cyan]" )
1003+ step_num += 1
1004+
9921005 steps_lines .append (f"{ step_num } . Start using slash commands with your AI agent:" )
9931006 steps_lines .append (" 2.1 [cyan]/constitution[/] - Establish project principles" )
9941007 steps_lines .append (" 2.2 [cyan]/specify[/] - Create specifications" )
@@ -1000,6 +1013,20 @@ def init(
10001013 console .print ()
10011014 console .print (steps_panel )
10021015
1016+ # Add Codex warning if using Codex
1017+ if selected_ai == "codex" :
1018+ warning_text = """[bold yellow]Important Note:[/bold yellow]
1019+
1020+ Custom prompts do not yet support arguments in Codex. You may need to manually
1021+ specify additional project instructions directly in prompt files located in
1022+ [cyan].codex/prompts/[/cyan].
1023+
1024+ For more information, see: [cyan]https://github.com/openai/codex/issues/2890[/cyan]"""
1025+
1026+ warning_panel = Panel (warning_text , title = "Slash Commands in Codex" , border_style = "yellow" , padding = (1 ,2 ))
1027+ console .print ()
1028+ console .print (warning_panel )
1029+
10031030@app .command ()
10041031def check ():
10051032 """Check that all required tools are installed."""
0 commit comments