@@ -106,8 +106,10 @@ func runSetGoal(cmd *cobra.Command, _ []string) error {
_, _ = fmt.Fprintln(out, "Study the goal and its description carefully.")
_, _ = fmt.Fprintln(out, "Review referenced tickets and files to gather context before planning changes.")
_, _ = fmt.Fprintln(out, "Add tasks once you understand the approach:")
+ _, _ = fmt.Fprintln(out, " Prefer batch: `np t a -t \"first\" -d \"details\" -t \"second\" -d \"more details\"`")
_, _ = fmt.Fprintln(out, " Single task: `np t a -t \"task title\" -d \"details\"`")
- _, _ = fmt.Fprintln(out, " Multiple tasks: `np t a -t \"first\" -d \"details\" -t \"second\" -d \"more details\"`")
+ _, _ = fmt.Fprintln(out, "")
+ _, _ = fmt.Fprintln(out, "If adding tasks one at a time, run `np t` after the batch to see the resulting list.")
return nil
}
@@ -148,18 +148,26 @@ func runAddTasks(cmd *cobra.Command, _ []string) error {
return err
}
+ if addedCount == 0 {
+ return nil
+ }
+
+ if addedCount == 1 {
+ _, _ = fmt.Fprintln(cmd.OutOrStdout(), "Added")
+ return nil
+ }
+
+ // Multiple tasks added, show full plan
if _, err := shared.PrintPlan(cmd, env, sessionDoc.SID); err != nil {
return err
}
- if addedCount > 0 {
- out := cmd.OutOrStdout()
- _, _ = fmt.Fprintln(out, "")
- _, _ = fmt.Fprintf(out, "Added %d task(s).\n", addedCount)
- _, _ = fmt.Fprintln(out, "Update task statuses as you work:")
- _, _ = fmt.Fprintln(out, " Single: `np t u -i task-id -s in_progress|completed|failed|cancelled`")
- _, _ = fmt.Fprintln(out, " Batch: `np t u -i abc123 -s completed -i def456 -s in_progress`")
- }
+ out := cmd.OutOrStdout()
+ _, _ = fmt.Fprintln(out, "")
+ _, _ = fmt.Fprintf(out, "Added %d task(s).\n", addedCount)
+ _, _ = fmt.Fprintln(out, "Update task statuses as you work:")
+ _, _ = fmt.Fprintln(out, " Single: `np t u -i task-id -s in_progress|completed|failed|cancelled`")
+ _, _ = fmt.Fprintln(out, " Batch: `np t u -i abc123 -s completed -i def456 -s in_progress`")
return nil
}