diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index b09e030621..ef519d9052 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -1,6 +1,7 @@ use std::collections::HashMap; use std::collections::VecDeque; use std::path::PathBuf; +use std::process::Command; use std::sync::Arc; use codex_core::config::Config; @@ -737,6 +738,14 @@ impl ChatWidget { SlashCommand::Approvals => { self.open_approvals_popup(); } + SlashCommand::Addprompt => { + let home = std::env::var("HOME").unwrap_or_else(|_| ".".to_string()); + let prompts_dir = format!("{home}/.codex/"); + + if let Err(e) = Command::new("open").arg(&prompts_dir).spawn() { + tracing::error!("failed to launch 'open prompts': {e}"); + } + } SlashCommand::Quit => { self.app_event_tx.send(AppEvent::ExitRequest); } diff --git a/codex-rs/tui/src/slash_command.rs b/codex-rs/tui/src/slash_command.rs index 6311661b28..ec7fee6a3d 100644 --- a/codex-rs/tui/src/slash_command.rs +++ b/codex-rs/tui/src/slash_command.rs @@ -14,6 +14,7 @@ pub enum SlashCommand { // more frequently used commands should be listed first. Model, Approvals, + Addprompt, New, Init, Compact, @@ -40,6 +41,7 @@ impl SlashCommand { SlashCommand::Status => "show current session configuration and token usage", SlashCommand::Model => "choose what model and reasoning effort to use", SlashCommand::Approvals => "choose what Codex can do without approval", + SlashCommand::Addprompt => "open the prompts folder", SlashCommand::Mcp => "list configured MCP tools", SlashCommand::Logout => "log out of Codex", #[cfg(debug_assertions)]