Skip to content

Commit 539608d

Browse files
committed
Adds refernce for CLI Docs
1 parent b361d48 commit 539608d

21 files changed

+748
-0
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.exclude": {
3+
"**/.git": false
4+
}
5+
}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ yarn lint
4444

4545
This will check the documentation for any issues or inconsistencies based on the defined linting rules.
4646

47+
## Update runpodctl docs
48+
49+
The CLI reference documentation for runpodctl are configured by using the `runpodctl-docs.py` file.
50+
51+
```bash
52+
python3 runpodctl-docs.py
53+
```
54+
4755
## Creating a New Version
4856

4957
Versioning is crucial for tracking changes and releases.

runpodctl-docs.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import os
2+
import subprocess
3+
import glob
4+
from datetime import datetime
5+
6+
7+
# Function to run shell commands
8+
def run_command(command):
9+
process = subprocess.Popen(
10+
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
11+
)
12+
out, err = process.communicate()
13+
if process.returncode != 0:
14+
print(f"Error: {err}")
15+
return out.decode().strip()
16+
17+
18+
# Function to generate metadata header
19+
def generate_metadata_header(title, slug):
20+
current_time = datetime.utcnow().strftime(
21+
"%a %b %d %Y %H:%M:%S GMT+0000 (Coordinated Universal Time)"
22+
)
23+
return f'---\ntitle: "{title}"\nslug: {slug}\nexcerpt: "{title}"\ncategory: "References"\nhidden: false\nmetadata: \n image: []\n robots: "index"\ncreatedAt: "{current_time}"\nupdatedAt: "{current_time}"\n---\n\n'
24+
25+
26+
# 1. Check if Git module already exists and add if not
27+
print("Checking for existing Git module...")
28+
module_path = "runpodctl"
29+
if not os.path.exists(module_path):
30+
print("Adding Git module...")
31+
run_command("gh repo clone runpod/runpodctl runpodctl")
32+
else:
33+
print("Git module already exists. Skipping addition.")
34+
35+
# 2. Move Markdown files
36+
print("Moving Markdown files...")
37+
source_dir = "runpodctl/doc/"
38+
target_dir = "v1.0/References/runpodctl/"
39+
os.makedirs(target_dir, exist_ok=True)
40+
for md_file in glob.glob(f"{source_dir}*.md"):
41+
os.rename(md_file, f"{target_dir}{os.path.basename(md_file)}")
42+
43+
# 3. Update each Markdown file
44+
print("Editing Markdown files...")
45+
for md_file in glob.glob(f"{target_dir}*.md"):
46+
title = (
47+
os.path.basename(md_file)
48+
.replace("runpodctl", "")
49+
.replace(".md", "")
50+
.replace("-", " ")
51+
.replace("_", " ")
52+
.strip()
53+
.title()
54+
)
55+
if title == "":
56+
title = "Runpodctl"
57+
slug = os.path.basename(md_file).replace(".md", "").replace("_", "-")
58+
with open(md_file, "r") as file:
59+
lines = file.readlines()
60+
with open(md_file, "w") as file:
61+
file.write(generate_metadata_header(title, slug))
62+
for line in lines:
63+
if "###### Auto generated by" not in line:
64+
file.write(line)
65+
66+
# 4. Clean up
67+
print("Cleaning up...")
68+
run_command("rm -rf runpodctl")
69+
70+
print("Script completed.")
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "Runpodctl"
3+
slug: runpodctl
4+
excerpt: "Runpodctl"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl
15+
16+
runpodctl for runpod.io
17+
18+
### Synopsis
19+
20+
runpodctl is a CLI tool to manage your pods for runpod.io
21+
22+
### Options
23+
24+
```
25+
-h, --help help for runpodctl
26+
```
27+
28+
### SEE ALSO
29+
30+
* [runpodctl config](runpodctl_config.md) - CLI Config
31+
* [runpodctl create](runpodctl_create.md) - create a resource
32+
* [runpodctl get](runpodctl_get.md) - get resource
33+
* [runpodctl receive](runpodctl_receive.md) - receive file(s), or folder
34+
* [runpodctl remove](runpodctl_remove.md) - remove a resource
35+
* [runpodctl send](runpodctl_send.md) - send file(s), or folder
36+
* [runpodctl start](runpodctl_start.md) - start a resource
37+
* [runpodctl stop](runpodctl_stop.md) - stop a resource
38+
* [runpodctl version](runpodctl_version.md) - runpodctl version
39+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: "Config"
3+
slug: runpodctl-config
4+
excerpt: "Config"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl config
15+
16+
CLI Config
17+
18+
### Synopsis
19+
20+
RunPod CLI Config Settings
21+
22+
```
23+
runpodctl config [flags]
24+
```
25+
26+
### Options
27+
28+
```
29+
--apiKey string runpod api key
30+
--apiUrl string runpod api url
31+
-h, --help help for config
32+
```
33+
34+
### SEE ALSO
35+
36+
* [runpodctl](runpodctl.md) - runpodctl for runpod.io
37+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: "Create"
3+
slug: runpodctl-create
4+
excerpt: "Create"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl create
15+
16+
create a resource
17+
18+
### Synopsis
19+
20+
create a resource in runpod.io
21+
22+
### Options
23+
24+
```
25+
-h, --help help for create
26+
```
27+
28+
### SEE ALSO
29+
30+
* [runpodctl](runpodctl.md) - runpodctl for runpod.io
31+
* [runpodctl create pod](runpodctl_create_pod.md) - start a pod
32+
* [runpodctl create pods](runpodctl_create_pods.md) - create a group of pods
33+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "Create Pod"
3+
slug: runpodctl-create-pod
4+
excerpt: "Create Pod"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl create pod
15+
16+
start a pod
17+
18+
### Synopsis
19+
20+
start a pod from runpod.io
21+
22+
```
23+
runpodctl create pod [flags]
24+
```
25+
26+
### Options
27+
28+
```
29+
--args string container arguments
30+
--communityCloud create in community cloud
31+
--containerDiskSize int container disk size in GB (default 20)
32+
--cost float32 $/hr price ceiling, if not defined, pod will be created with lowest price available
33+
--env strings container arguments
34+
--gpuCount int number of GPUs for the pod (default 1)
35+
--gpuType string gpu type id, e.g. 'NVIDIA GeForce RTX 3090'
36+
-h, --help help for pod
37+
--imageName string container image name
38+
--mem int minimum system memory needed (default 20)
39+
--name string any pod name for easy reference
40+
--ports strings ports to expose; max only 1 http and 1 tcp allowed; e.g. '8888/http'
41+
--secureCloud create in secure cloud
42+
--templateId string templateId to use with the pod
43+
--vcpu int minimum vCPUs needed (default 1)
44+
--volumePath string container volume path (default "/runpod")
45+
--volumeSize int persistent volume disk size in GB (default 1)
46+
```
47+
48+
### SEE ALSO
49+
50+
* [runpodctl create](runpodctl_create.md) - create a resource
51+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "Create Pods"
3+
slug: runpodctl-create-pods
4+
excerpt: "Create Pods"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl create pods
15+
16+
create a group of pods
17+
18+
### Synopsis
19+
20+
create a group of pods on runpod.io
21+
22+
```
23+
runpodctl create pods [flags]
24+
```
25+
26+
### Options
27+
28+
```
29+
--args string container arguments
30+
--communityCloud create in community cloud
31+
--containerDiskSize int container disk size in GB (default 20)
32+
--cost float32 $/hr price ceiling, if not defined, pod will be created with lowest price available
33+
--env strings container arguments
34+
--gpuCount int number of GPUs for the pod (default 1)
35+
--gpuType string gpu type id, e.g. 'NVIDIA GeForce RTX 3090'
36+
-h, --help help for pods
37+
--imageName string container image name
38+
--mem int minimum system memory needed (default 20)
39+
--name string any pod name for easy reference
40+
--podCount int number of pods to create with the same name (default 1)
41+
--ports strings ports to expose; max only 1 http and 1 tcp allowed; e.g. '8888/http'
42+
--secureCloud create in secure cloud
43+
--vcpu int minimum vCPUs needed (default 1)
44+
--volumePath string container volume path (default "/runpod")
45+
--volumeSize int persistent volume disk size in GB (default 1)
46+
```
47+
48+
### SEE ALSO
49+
50+
* [runpodctl create](runpodctl_create.md) - create a resource
51+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: "Get"
3+
slug: runpodctl-get
4+
excerpt: "Get"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl get
15+
16+
get resource
17+
18+
### Synopsis
19+
20+
get resources for pods
21+
22+
### Options
23+
24+
```
25+
-h, --help help for get
26+
```
27+
28+
### SEE ALSO
29+
30+
* [runpodctl](runpodctl.md) - runpodctl for runpod.io
31+
* [runpodctl get cloud](runpodctl_get_cloud.md) - get all cloud gpus
32+
* [runpodctl get pod](runpodctl_get_pod.md) - get all pods
33+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Get Cloud"
3+
slug: runpodctl-get-cloud
4+
excerpt: "Get Cloud"
5+
category: "References"
6+
hidden: false
7+
metadata:
8+
image: []
9+
robots: "index"
10+
createdAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
11+
updatedAt: "Fri Dec 29 2023 18:27:25 GMT+0000 (Coordinated Universal Time)"
12+
---
13+
14+
## runpodctl get cloud
15+
16+
get all cloud gpus
17+
18+
### Synopsis
19+
20+
get all cloud gpus available on runpod.io
21+
22+
```
23+
runpodctl get cloud [gpuCount] [flags]
24+
```
25+
26+
### Options
27+
28+
```
29+
-c, --community show listings from community cloud only
30+
--disk int minimum disk size in GB you need
31+
-h, --help help for cloud
32+
--mem int minimum sys memory size in GB you need
33+
-s, --secure show listings from secure cloud only
34+
--vcpu int minimum vCPUs you need
35+
```
36+
37+
### SEE ALSO
38+
39+
* [runpodctl get](runpodctl_get.md) - get resource
40+

0 commit comments

Comments
 (0)