File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use std:: collections:: HashMap ;
22use std:: collections:: VecDeque ;
33use std:: path:: PathBuf ;
4+ use std:: process:: Command ;
45use std:: sync:: Arc ;
56
67use codex_core:: config:: Config ;
@@ -737,6 +738,14 @@ impl ChatWidget {
737738 SlashCommand :: Approvals => {
738739 self . open_approvals_popup ( ) ;
739740 }
741+ SlashCommand :: Addprompt => {
742+ let home = std:: env:: var ( "HOME" ) . unwrap_or_else ( |_| "." . to_string ( ) ) ;
743+ let prompts_dir = format ! ( "{home}/.codex/" ) ;
744+
745+ if let Err ( e) = Command :: new ( "open" ) . arg ( & prompts_dir) . spawn ( ) {
746+ tracing:: error!( "failed to launch 'open prompts': {e}" ) ;
747+ }
748+ }
740749 SlashCommand :: Quit => {
741750 self . app_event_tx . send ( AppEvent :: ExitRequest ) ;
742751 }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ pub enum SlashCommand {
1414 // more frequently used commands should be listed first.
1515 Model ,
1616 Approvals ,
17+ Addprompt ,
1718 New ,
1819 Init ,
1920 Compact ,
@@ -40,6 +41,7 @@ impl SlashCommand {
4041 SlashCommand :: Status => "show current session configuration and token usage" ,
4142 SlashCommand :: Model => "choose what model and reasoning effort to use" ,
4243 SlashCommand :: Approvals => "choose what Codex can do without approval" ,
44+ SlashCommand :: Addprompt => "open the prompts folder" ,
4345 SlashCommand :: Mcp => "list configured MCP tools" ,
4446 SlashCommand :: Logout => "log out of Codex" ,
4547 #[ cfg( debug_assertions) ]
You can’t perform that action at this time.
0 commit comments