Initial implementation of /init (#1822)

Basic /init command that appends an instruction to create AGENTS.md to
the conversation history.
This commit is contained in:
Charlie Weems
2025-08-06 09:10:23 -07:00
committed by GitHub
parent dc468d563f
commit ffe24991b7
6 changed files with 138 additions and 0 deletions

View File

@@ -300,6 +300,13 @@ impl App<'_> {
self.app_state = AppState::Chat { widget: new_widget };
self.app_event_tx.send(AppEvent::RequestRedraw);
}
SlashCommand::Init => {
// Guard: do not run if a task is active.
if let AppState::Chat { widget } = &mut self.app_state {
const INIT_PROMPT: &str = include_str!("../../../INIT.md");
widget.submit_text_message(INIT_PROMPT.to_string());
}
}
SlashCommand::Compact => {
if let AppState::Chat { widget } = &mut self.app_state {
widget.clear_token_usage();