| 33 | } |
| 34 | |
| 35 | func newTasksListCmd() *cobra.Command { |
| 36 | cmd := &cobra.Command{ |
| 37 | Use: "list", |
| 38 | Short: "List recent cluster tasks", |
| 39 | Long: "List recent Proxmox cluster tasks across all nodes.", |
| 40 | Example: ` # JSON output (default, last 20 tasks) |
| 41 | pvetui tasks list |
| 42 | |
| 43 | # Show last 50 tasks in table format |
| 44 | pvetui tasks list --recent 50 --output table |
| 45 | |
| 46 | # Use a specific profile |
| 47 | pvetui --profile prod tasks list`, |
| 48 | RunE: runTasksList, |
| 49 | } |
| 50 | |
| 51 | cmd.Flags().Int("recent", 20, "Limit output to the N most recent tasks") |
| 52 | |
| 53 | return cmd |
| 54 | } |
| 55 | |
| 56 | func runTasksList(cmd *cobra.Command, _ []string) error { |
| 57 | session, err := initCLISession(cmd) |