feat(cli)!: rename --prompt to --temp-role

Completes the .prompt/.temp-role split: --prompt set an ad-hoc system
role, which is what .temp-role now means everywhere. The --prompt name
is left unbound so a future one-shot MCP prompt flag can take it with
properly designed non-interactive semantics. use_prompt follows the
rename as use_temp_role.

BREAKING CHANGE: invocations using --prompt <text> must switch to
--temp-role <text>; clap rejects the old flag loudly.
This commit is contained in:
2026-08-25 12:04:45 -06:00
parent e55120dac6
commit 3c9f443bce
4 changed files with 12 additions and 12 deletions
+3 -3
View File
@@ -2341,7 +2341,7 @@ impl RequestContext {
Ok(())
}
pub fn use_prompt(&mut self, _app: &AppConfig, prompt: &str) -> Result<()> {
pub fn use_temp_role(&mut self, _app: &AppConfig, prompt: &str) -> Result<()> {
let mut role = Role::new(TEMP_ROLE_NAME, prompt);
role.set_model(self.current_model().clone());
self.use_role_obj(role)
@@ -4852,10 +4852,10 @@ mod tests {
}
#[test]
fn use_prompt_creates_temp_role() {
fn use_temp_role_creates_temp_role() {
let mut ctx = create_test_ctx();
let app = ctx.app.config.clone();
ctx.use_prompt(&app, "you are a pirate").unwrap();
ctx.use_temp_role(&app, "you are a pirate").unwrap();
assert!(ctx.role.is_some());
assert_eq!(ctx.role.as_ref().unwrap().name(), "temp");
assert!(