Skip to content

Commit 1e91d73

Browse files
feat(tasks): Add --include-artifacts flag to tasks list command (#21)
- Add --include-artifacts flag to control artifact display in tasks list output - Artifacts are now excluded by default to reduce overwhelming output - Only show artifacts when the flag is explicitly provided - Maintains existing behavior for --include-history flag - Follows same pattern as other boolean flags in the codebase Resolves #18 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Eden Reich <[email protected]>
1 parent 6c9826f commit 1e91d73

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cli/cli.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func init() {
114114
listTasksCmd.Flags().Int("limit", 50, "Maximum number of tasks to return")
115115
listTasksCmd.Flags().Int("offset", 0, "Number of tasks to skip")
116116
listTasksCmd.Flags().Bool("include-history", false, "Include conversation history in the output")
117+
listTasksCmd.Flags().Bool("include-artifacts", false, "Include artifacts in the output")
117118
getTaskCmd.Flags().Int("history-length", 0, "Number of history messages to include")
118119
submitTaskCmd.Flags().String("context-id", "", "Context ID for the task (optional, will generate new context if not provided)")
119120
submitTaskCmd.Flags().String("task-id", "", "Task ID to resume (optional)")
@@ -352,6 +353,7 @@ var listTasksCmd = &cobra.Command{
352353
limit, _ := cmd.Flags().GetInt("limit")
353354
offset, _ := cmd.Flags().GetInt("offset")
354355
includeHistory, _ := cmd.Flags().GetBool("include-history")
356+
includeArtifacts, _ := cmd.Flags().GetBool("include-artifacts")
355357

356358
params := adk.TaskListParams{
357359
Limit: limit,
@@ -385,17 +387,22 @@ var listTasksCmd = &cobra.Command{
385387
}
386388

387389
tasks := taskList.Tasks
388-
if !includeHistory {
390+
if !includeHistory || !includeArtifacts {
389391
var filteredTasks []adk.Task
390392
for _, task := range tasks {
391393
filteredTask := adk.Task{
392394
ID: task.ID,
393395
Kind: task.Kind,
394396
ContextID: task.ContextID,
395397
Status: task.Status,
396-
Artifacts: task.Artifacts,
397398
Metadata: task.Metadata,
398399
}
400+
if includeArtifacts {
401+
filteredTask.Artifacts = task.Artifacts
402+
}
403+
if includeHistory {
404+
filteredTask.History = task.History
405+
}
399406
filteredTasks = append(filteredTasks, filteredTask)
400407
}
401408
tasks = filteredTasks

0 commit comments

Comments
 (0)