Minimal PSR-compliant PHP 8.3 CLI project for managing RunPod pods through the official REST and GraphQL APIs.
- List pods with optional filters.
- Create pods from a JSON payload or CLI options.
- Delete pods by ID.
- List available GPU types from the GraphQL API.
- No framework dependency required to run the CLI.
- PHP 8.3
ext-curlext-json- A RunPod API key in
RUNPOD_API_KEY
The current docs used for this project are:
- RunPod REST
GET /pods: https://docs.runpod.io/api-reference/pods/GET/pods - RunPod REST
POST /pods: https://docs.runpod.io/api-reference/pods/POST/pods - RunPod REST
DELETE /pods/{podId}: https://docs.runpod.io/api-reference/pods/DELETE/pods/podId - RunPod GraphQL GPU types query: https://docs.runpod.io/sdks/graphql/manage-pods
bin/ CLI entrypoint
examples/ Example API payloads
src/ PSR-4 application code
autoload.php Fallback autoloader for local execution without Composer install
composer.json Package metadata and PHP 8.3 requirement
phpcs.xml.dist PSR-12 coding standard config
cp .env.example .env
export RUNPOD_API_KEY=your-api-key
chmod +x bin/runpod-clientIf you are using Composer with PHP 8.3 or newer:
composer installShow help:
bin/runpod-client helpList pods:
bin/runpod-client pods:list
bin/runpod-client pods:list --status=RUNNING --compute-type=GPU
bin/runpod-client pods:list --jsonCreate a pod from the included A5000 example payload:
bin/runpod-client pods:create --payload=examples/create-a5000-pod.jsonCreate a pod directly from CLI flags:
bin/runpod-client pods:create \
--name=a5000-pod \
--gpu-type-id="NVIDIA RTX A5000" \
--image=runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04 \
--gpu-count=1 \
--ports=8888/http,22/tcp \
--env=JUPYTER_PASSWORD=change-meDelete a pod:
bin/runpod-client pods:delete --id=<pod-id>List GPU types:
bin/runpod-client gpus:list
bin/runpod-client gpus:list --id="NVIDIA RTX A5000"
bin/runpod-client gpus:list --id="NVIDIA RTX A5000" --availability --secure-cloud=true --gpu-count=1examples/create-a5000-pod.jsonmirrors the documented RunPod REST payload for an A5000 pod.- Pod deletion uses
DELETE /v1/pods/{podId}and returns success on HTTP204. - GPU types are read from the documented GraphQL
gpuTypesquery so the CLI stays aligned with RunPod's exposed GPU IDs. - The local environment in this repository currently has PHP 8.3.6, which matches the minimum supported runtime.
MIT. See LICENSE.