Skip to content

Commit 791700a

Browse files
d4ncerclaude
andcommitted
feat(cli): print confirmation messages on task/feature create exit
After `ralph task create`, report each newly created task ID by diffing task IDs before and after the interactive session. After `ralph feature create`, change the completion message to clearly confirm creation ("Created feature ..."). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 44b4a26 commit 791700a

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/main.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ async fn handle_feature(action: cli::FeatureAction, ui_mode: ui::UiMode) -> Resu
660660
feature::update_feature_status(&db, &feat.id, "ready")?;
661661

662662
output::formatter::print_info(&format!(
663-
"Feature '{}' is ready. Run 'ralph run {}' to start.",
663+
"Created feature \"{}\". Run 'ralph run {}' to start.",
664664
name, name
665665
));
666666

@@ -827,6 +827,10 @@ async fn handle_task(action: cli::TaskAction, ui_mode: ui::UiMode) -> Result<Exi
827827
.or_else(|| std::env::var("RALPH_AGENT").ok())
828828
.unwrap_or_else(|| project.config.agent.command.clone());
829829

830+
// Snapshot existing task IDs before the session
831+
let before_ids: std::collections::HashSet<String> =
832+
dag::get_all_tasks(&db)?.into_iter().map(|t| t.id).collect();
833+
830834
// Gather project context including standalone tasks
831835
let context = gather_project_context(&project, &db, true);
832836

@@ -845,7 +849,20 @@ async fn handle_task(action: cli::TaskAction, ui_mode: ui::UiMode) -> Result<Exi
845849
None, // no write path restrictions
846850
)
847851
.await?;
848-
output::formatter::print_info("Task creation session complete.");
852+
853+
// Report newly created tasks
854+
let new_tasks: Vec<dag::Task> = dag::get_all_tasks(&db)?
855+
.into_iter()
856+
.filter(|t| !before_ids.contains(&t.id))
857+
.collect();
858+
if new_tasks.is_empty() {
859+
output::formatter::print_info("Task creation session complete. No tasks created.");
860+
} else {
861+
for task in &new_tasks {
862+
output::formatter::print_info(&format!("Created task {}", task.id));
863+
}
864+
}
865+
849866
if ui_guard.is_active() {
850867
drop(ui_guard);
851868
}

0 commit comments

Comments
 (0)