/addprompt

This commit is contained in:
Daniel Edrisian
2025-08-25 17:53:07 -07:00
parent 468a8b4c38
commit 0174e73537
2 changed files with 11 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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)]