Skip to content

feat: add task download to save an agent's task artifacts to disk #33

Description

@msampathkumar

Goal: Let a user save an agent's file artifacts to local disk with one command, instead of only seeing them summarised in the terminal.
User story: As a developer whose agent produced files, I want task download to save the artifacts to disk, so that I can use the generated files directly instead of extracting base64 from JSON by hand.

Priority: P2 · Area: CLI code

Problem

The task command group covers get, list, subscribe, cancel, and push-config, but there is no way to save a task's file artifacts to disk. task get and send only render/report artifacts (and a file part currently shows as [binary N bytes]), so a caller who wants the actual bytes has no supported command.

task download does not exist today:

$ a2a task download --help
Work with tasks

Usage:
  a2a task [command]

Proposed behavior

Add a2a task download <taskId> that writes the task's artifacts to disk:

a2a task download <taskId> [--output-dir <dir>] [--artifact <id>]
  • Writes each file artifact to --output-dir (default: current directory), using the artifact's name and media type; falls back to a safe generated name when none is provided.
  • --artifact <id> (repeatable) downloads only the named artifact(s); default downloads all.
  • Data/text artifacts are written too (e.g. .json/.txt), so nothing is silently skipped.
  • Reports each path written; refuses to overwrite unless --force (or writes uniquely-named files).
  • Works across transports and honours -o json (emit the list of written paths as structured output).

Who benefits

  • Developers pulling generated files (reports, images, data) from an agent without hand-parsing JSON.
  • CI jobs that archive an agent's outputs as build artifacts.
  • AI coding agents that need the produced files on disk to continue a workflow.

Acceptance criteria

  • a2a task download <taskId> writes all artifacts to disk and prints the paths.
  • --output-dir and --artifact selection work.
  • File artifacts use name + media type; collisions handled safely.
  • -o json emits the written paths as structured output; exit code reflects success/failure.
  • Tests cover: all-artifacts download, single --artifact, and a missing task.

Environment

  • CLI version: a2a version v0.0.0-…1e29dfe94f95+dirty
  • OS: Linux x86_64

Notes

task list, task subscribe, and task push-config already exist — this request is scoped to the one missing member of the group, task download. The rendering of file parts by name/media-type/size is tracked separately and complements this command.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2 — ergonomics/polish with a workaroundenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions