Skip to content

Conversation

@jojje
Copy link
Contributor

@jojje jojje commented Jan 22, 2026

Add json format option to get pod command

Always produces a list output, even if a specific pod ID is provided. Stays semantically aligned with the text table view which also shows collection outputs regardless of matched pod(s).

Addresses #148 (comment) but not the entire issue #148 which seems to ask for json output for all commands.

How I tested it

  • Unit test
  • Manual integration test against backend api

Example output

runpodctl get pod --json

output:

[
  {
    "Id": "wwp6rwl5wucng8",
    "ContainerDiskInGb": 20,
    "CostPerHr": 0.24,
    "DesiredStatus": "RUNNING",
    "DataCenterId": "",
    "DockerArgs": "",
    "Env": [
      "PUBLIC_KEY=ssh..."
    ],
    "GpuCount": 1,
    "ImageName": "runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04",
    "MemoryInGb": 31,
    "Name": "young_purple_kangaroo",
    "PodType": "RESERVED",
    "Ports": "8888/http,22/tcp",
    "VcpuCount": 6,
    "VolumeInGb": 20,
    "VolumeMountPath": "/workspace",
    "Machine": {
      "GpuDisplayName": "RTX 2000 Ada",
      "Location": "RO"
    },
    "Runtime": {
      "Ports": [
        {
          "Ip": "100.65.24.183",
          "IsIpPublic": false,
          "PrivatePort": 19123,
          "PublicPort": 60755,
          "PortType": "http"
        },
        {
          "Ip": "213.173.102.150",
          "IsIpPublic": true,
          "PrivatePort": 22,
          "PublicPort": 31696,
          "PortType": "tcp"
        },
        {
          "Ip": "100.65.24.183",
          "IsIpPublic": false,
          "PrivatePort": 8888,
          "PublicPort": 60754,
          "PortType": "http"
        }
      ]
    }
  }
]

jojje added 3 commits January 22, 2026 14:15
Prepare for supporting multiple output formats
Decompose rendering and filtering to enable consistent pod filtering
irrespective of output rendering format.
@jojje jojje changed the title Feat getpod json feat: get pod json Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant