Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Runpod CLI (rp)

A small Bash CLI for managing Runpod infrastructure: network volumes, serverless endpoints, pods, templates, registries, billing, account balance, Hub listings, SSH keys, and live GPU stock. It speaks three Runpod APIs directly — REST API v2 for CRUD, GraphQL for account/hub/ssh/S3-datacentre stock, and the S3-compatible API for filling volumes.

Scope

rp is a personal, Bash-based wrapper around Runpod's APIs — not a replacement for the official runpodctl. I built it because a shell CLI is easy to extend and to wrap other tooling around — and because a few workflows (notably volume sync, plus catalog and cluster) and its single-key auth model aren't covered by runpodctl. Where commands overlap with runpodctl, the shared flag spellings are accepted as a convenience only.

Requirements

  • Bash 5+
  • Core tools (curl, jq, awk, head, paste) — rp checks for these on startup and names anything missing
  • aws CLI — only for rp volume sync / rp volume ls (S3 fill and list)
  • huggingface-cli — optional, only for rp volume sync --models

Install

macOS or Linux (extracts into ~/.rp and symlinks /usr/local/bin/rp, asking for sudo only for that symlink):

curl -fsSL https://raw.githubusercontent.com/objctp/runpod-cli/main/install.sh | bash

The installer verifies a SHA-256 checksum before extracting. Update later with rp upgrade (or re-run the one-liner); pin a version with curl ... | bash -s -- --version 0.1.0.

rp also checks for a newer release once a day and prints a one-line notice when one is available (it names the right command for your install method). Set RP_NO_UPDATE_CHECK=1 to disable the check.

macOS ships Bash 3.2, but rp needs Bash 5+. The installer detects this and refuses with the fix (brew install bash, then restart your shell).

For development (clone + symlink, no download required):

make install # symlinks bin/rp onto /usr/local/bin/rp (may need sudo)# or, without touching /usr/local/bin:export PATH="$PWD/bin:$PATH"

Alternative installs

The one-line installer above is the primary, recommended path. If you already live in a package manager, rp is also published to Homebrew and npm:

brew install objctp/tap/rp # macOS / Linux (Homebrew)
npm install -g @objctp/rp # Node 22+ (wraps the same bash CLI)

Both pull the same universal tarball and pin to the released rp-VERSION.tar.gz checksum; brew rewrites the shebang to a Bash 5+ and npm runs a startup preflight asserting Bash 5+/jq/curl.

Confirm it works:

rp version # installed version
rp _ping # ok: REST auth works (https://api.runpod.io/v2)

Configure

The simplest path is rp auth login, which stores your key in a per-user config (${XDG_CONFIG_HOME:-$HOME/.config}/rp) that survives any install method, including npm global installs. Multiple accounts are supported — each is a separate file, with one marked active:

rp auth login # prompts for the key; stored as "default"
rp auth login --name work --api-key <key># named account, marked active
rp auth list # show accounts
rp auth switch work # change the active account
rp auth status # show the active account + key source

--account <name> on any command uses a specific account for that call. Alternatively, set the variables directly (an exported RUNPOD_API_KEY always wins over the stored config):

VariableWhere to get itRequired for
RUNPOD_API_KEYConsole → Settings → API Keyseverything
RUNPOD_API_KEY_FILEpath to a file holding the key (e.g. a mounted K8s secret)everything (alternative to RUNPOD_API_KEY)
RUNPOD_S3_ACCESS_KEYConsole → Settings → S3 API Keys (your user_… id)volume sync / ls
RUNPOD_S3_SECRET_KEYConsole → Settings → S3 API Keys (an rps_… key, shown once)volume sync / ls
HF_TOKENhuggingface.co → Access Tokensvolume sync --models (gated models)
RP_MODEL_CACHEany writable directoryvolume sync --models download cache (default $RP_ROOT/.cache/models)

The S3 key pair is separate from the REST API key — create it from its own console page. rp auth login writes the key file at mode 600 (dir 700); the CLI also warns if a manually-placed .env is group- or world-readable.

Quick start

A representative tour — check stock, provision shared storage, run a pod, and stand up a scale-to-zero serverless endpoint:

rp stock dc # pick a datacentre, e.g. EU-RO-1
rp volume create --name shared-data --size 100 --dc EU-RO-1
rp pod create --name dev --image nvcr.io/nvidia/pytorch:23.10-py3 \
--gpu NVIDIA L4 --volume-gb 100
rp serverless create --name my-endpoint --template <id> \
--network-volume shared-data --gpus-from-volume shared-data \
--workers-min 0 --workers-max 3 --idle 600
rp serverless run <id> --input '{"prompt":"hello"}'# submit a job

--network-volume auto-scopes the endpoint to that volume's datacentre; --gpus-from-volume builds the GPU fallback list from types in stock, and the volume mounts at /runpod-volume on serverless workers. To deploy from a Hub listing instead of a template, use serverless create --hub-id <listing-id> (resolve listings with rp hub search / rp hub get).

For command reference and worked examples, use rp doc (in-shell) or the docs site — both are generated from the same source as the CLI, so they never fall behind a release:

  • docs/
  • In-shell: rp --help, rp <resource> --help, rp doc <command> [<verb>]

Things worth knowing

  • S3 fill needs an S3-API-supported datacentrerp stock dc reads the s3apiEnabled flag live, so its S3 column is always current; rp volume create warns if --dc is not S3-capable (and volume sync refuses).
  • Catalog stock is account-wide, not per-datacentrerp volume gpus and --gpus-from-volume reflect global availability; the volume's own datacentre still gates whether provisioning actually succeeds.
  • volume sync --models is a double hop (HuggingFace → local cache → S3). Fine for once-and-rarely fills; use --source <dir> for a single hop.
  • Idempotent createsvolume, template, and serverlesscreate return the existing resource when the name matches; pass --force to duplicate. pod and registrycreate always POST and may duplicate on re-run.
  • rp api is a raw escape hatchrp api <METHOD> <path> calls the same transport as the resource verbs, so it reaches any v2 route the typed commands don't wrap yet (e.g. a brand-new endpoint). It honours --body, --plane, --jq, --limit, and --cursor.
  • List paging is client-side — Runpod's REST v2 has no server-side pagination yet, so --limit / --cursor slice the already-fetched list locally. The flags mirror the cursor shape Runpod will add, so they forward server-side later without a CLI change.
  • Stock and prices drift — re-run the CLI before each booking.
  • runpodctl aliases — several commands also accept runpodctl-style flag spellings (e.g. --gpu-id, --data-center-ids) alongside rp's own. Run rp doc <command> <verb> to see which apply.
  • --insecure (alias -k, or RP_INSECURE_TLS=1) — skips TLS certificate verification for in-pod runs where the CA bundle can't validate the API. Traffic stays encrypted; the server identity is not checked. Distinct from RP_ALLOW_INSECURE_HTTP, which refuses plaintext http://.
  • Scriptable exit codes0 success · 1 transport/API/general · 2 usage · 3 auth (no key/creds) · 4 not-found. Branch on $? rather than grepping stderr.

Development

Lint, format, and tests are wired up via make:

make fmt # shfmt (2-space indents)
make lint # shellcheck
make test# bashunit (tests/)
make check # lint + test

See CONTRIBUTING.md for the repo layout, code style, and how to add a command or library helper.

About

A simple CLI for managing Runpod infrastructure.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages