Skip to content
Task
AGH RuntimeTask

agh task next

Claim the next task run for the current agent session

Audience
Operators running durable agent work
Focus
Task guidance shaped for scanability, day-two clarity, and operator context.

agh task next

Claim the next task run for the current agent session

agh task next [flags]

Examples

  # Claim the next available run for this session
  agh task next

  # Wait until matching work is claimable and request a five-minute lease
  agh task next --wait --lease-seconds 300 -o json

  # Filter by required caller capability
  agh task next --capability go.test --priority-min 10

Options

      --capability stringArray   Caller capability filter (repeatable)
  -h, --help                     help for next
      --idempotency-key string   Optional idempotency key
      --lease-seconds int        Lease duration in seconds
      --priority-min int         Minimum task priority
      --wait                     Wait until work is claimable
      --workspace-id string      Workspace ID override; defaults to caller workspace

Options inherited from parent commands

      --json            Emit JSON output
  -o, --output string   Output format: human, json, jsonl, or toon (default "human")

Output Formats

Every AGH command supports -o, --output:

  • human for interactive terminal use
  • json for scripts and other machine-readable consumers
  • jsonl for wait or streaming commands that emit one JSON record per line
  • toon for compact agent-readable summaries

Example:

agh task next -o json

On this page