Skip to content

Commit 0174e73

Browse files
committed
/addprompt
1 parent 468a8b4 commit 0174e73

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎codex-rs/tui/src/chatwidget.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::collections::HashMap;
22
use std::collections::VecDeque;
33
use std::path::PathBuf;
4+
use std::process::Command;
45
use std::sync::Arc;
56

67
use 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
}

‎codex-rs/tui/src/slash_command.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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)]

0 commit comments

Comments
 (0)