resolveInitTaskDir returns the task directory path. If --task-dir was explicitly provided, uses that. If TTY, prompts the user. Otherwise uses the default.
(cmd *cobra.Command, isTTY bool)
| 214 | // If --task-dir was explicitly provided, uses that. |
| 215 | // If TTY, prompts the user. Otherwise uses the default. |
| 216 | func resolveInitTaskDir(cmd *cobra.Command, isTTY bool) (string, error) { |
| 217 | if cmd.Flags().Changed("task-dir") { |
| 218 | return projectInitTaskDir, nil |
| 219 | } |
| 220 | |
| 221 | if isTTY { |
| 222 | value := projectInitTaskDir // default for the prompt |
| 223 | err := huh.NewInput(). |
| 224 | Title("Task directory"). |
| 225 | Value(&value). |
| 226 | Run() |
| 227 | if err != nil { |
| 228 | return "", fmt.Errorf("prompt cancelled: %w", err) |
| 229 | } |
| 230 | return value, nil |
| 231 | } |
| 232 | |
| 233 | return projectInitTaskDir, nil |
| 234 | } |
| 235 | |
| 236 | // resolveInitAgents sets agent flags via prompt if none were explicitly set. |
| 237 | func resolveInitAgents(isTTY bool) { |