Skip to content

Commit 35fb30f

Browse files
feat: Add automated CLI documentation generator
- Create cli-docs-generator.py script to auto-generate W&B CLI reference docs - Script introspects wandb.cli.cli using Click framework - Generates Hugo-compatible markdown with proper front matter - Features: - Hierarchical directory structure for nested commands - Command tables with brief descriptions on index pages - Preserves whitespace/paragraph breaks from original docstrings - Alphabetical ordering of commands - Suppresses auto-generated lists on index pages (no_list: true) - Clears output directory before regeneration to prevent vestigial files - Interactive mode (-i) option, defaults to auto-overwrite - Custom output directory (-o) option - Removes unnecessary Examples sections from command pages - Updates all existing CLI documentation with consistent formatting
1 parent 21a23ca commit 35fb30f

41 files changed

Lines changed: 1046 additions & 561 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/en/ref/cli/_index.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
---
22
title: Command Line Interface
3-
weight: 2
3+
no_list: true
44
---
55

6-
**Usage**
6+
## Usage
77

8-
`wandb [OPTIONS] COMMAND [ARGS]...`
8+
```bash
9+
wandb [OPTIONS] COMMAND [ARGS]...
10+
```
911

12+
## Options
1013

11-
12-
**Options**
13-
14-
| **Option** | **Description** |
14+
| Option | Description |
1515
| :--- | :--- |
16-
| `--version` | Show the version and exit. |
16+
| `--version` | Show the version and exit. (default: False) |
1717

18+
## Commands
1819

19-
**Commands**
20-
21-
| **Command** | **Description** |
20+
| Command | Description |
2221
| :--- | :--- |
23-
| agent | Run the W&B agent |
24-
| artifact | Commands for interacting with artifacts |
25-
| beta | Beta versions of wandb CLI commands. |
26-
| controller | Run the W&B local sweep controller |
27-
| disabled | Disable W&B. |
28-
| docker | Run your code in a docker container. |
29-
| docker-run | Wrap `docker run` and adds WANDB_API_KEY and WANDB_DOCKER... |
30-
| enabled | Enable W&B. |
31-
| init | Configure a directory with Weights & Biases |
32-
| job | Commands for managing and viewing W&B jobs |
33-
| launch | Launch or queue a W&B Job. |
34-
| launch-agent | Run a W&B launch agent. |
35-
| launch-sweep | Run a W&B launch sweep (Experimental). |
36-
| login | Login to Weights & Biases |
37-
| offline | Disable W&B sync |
38-
| online | Enable W&B sync |
39-
| pull | Pull files from Weights & Biases |
40-
| restore | Restore code, config and docker state for a run |
41-
| scheduler | Run a W&B launch sweep scheduler (Experimental) |
42-
| server | Commands for operating a local W&B server |
43-
| status | Show configuration settings |
44-
| sweep | Initialize a hyperparameter sweep. |
45-
| sync | Upload an offline training directory to W&B |
46-
| verify | Verify your local instance |
47-
22+
| [agent]({{< relref "wandb-agent" >}}) | Run the W&B agent |
23+
| [artifact]({{< relref "wandb-artifact" >}}) | Commands for interacting with artifacts |
24+
| [beta]({{< relref "wandb-beta" >}}) | Beta versions of wandb CLI commands. |
25+
| [controller]({{< relref "wandb-controller" >}}) | Run the W&B local sweep controller |
26+
| [disabled]({{< relref "wandb-disabled" >}}) | Disable W&B. |
27+
| [docker]({{< relref "wandb-docker" >}}) | Run your code in a docker container. |
28+
| [docker-run]({{< relref "wandb-docker-run" >}}) | Wrap `docker run` and adds WANDB_API_KEY and WANDB_DOCKER environment variables. |
29+
| [enabled]({{< relref "wandb-enabled" >}}) | Enable W&B. |
30+
| [init]({{< relref "wandb-init" >}}) | Configure a directory with Weights & Biases |
31+
| [job]({{< relref "wandb-job" >}}) | Commands for managing and viewing W&B jobs |
32+
| [launch]({{< relref "wandb-launch" >}}) | Launch or queue a W&B Job. |
33+
| [launch-agent]({{< relref "wandb-launch-agent" >}}) | Run a W&B launch agent. |
34+
| [launch-sweep]({{< relref "wandb-launch-sweep" >}}) | Run a W&B launch sweep (Experimental). |
35+
| [local]({{< relref "wandb-local" >}}) | Start a local W&B container (deprecated, see wandb server --help) |
36+
| [login]({{< relref "wandb-login" >}}) | Login to Weights & Biases |
37+
| [off]({{< relref "wandb-off" >}}) | No description available |
38+
| [offline]({{< relref "wandb-offline" >}}) | Disable W&B sync |
39+
| [on]({{< relref "wandb-on" >}}) | No description available |
40+
| [online]({{< relref "wandb-online" >}}) | Enable W&B sync |
41+
| [projects]({{< relref "wandb-projects" >}}) | List projects |
42+
| [pull]({{< relref "wandb-pull" >}}) | Pull files from Weights & Biases |
43+
| [restore]({{< relref "wandb-restore" >}}) | Restore code, config and docker state for a run. |
44+
| [scheduler]({{< relref "wandb-scheduler" >}}) | Run a W&B launch sweep scheduler (Experimental) |
45+
| [server]({{< relref "wandb-server" >}}) | Commands for operating a local W&B server |
46+
| [status]({{< relref "wandb-status" >}}) | Show configuration settings |
47+
| [sweep]({{< relref "wandb-sweep" >}}) | Initialize a hyperparameter sweep. |
48+
| [sync]({{< relref "wandb-sync" >}}) | Upload an offline training directory to W&B |
49+
| [verify]({{< relref "wandb-verify" >}}) | Checks and verifies local instance of W&B. |

content/en/ref/cli/wandb-agent.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22
title: wandb agent
33
---
44

5-
**Usage**
5+
Run the W&B agent
66

7-
`wandb agent [OPTIONS] SWEEP_ID`
7+
## Usage
88

9-
**Summary**
9+
```bash
10+
wandb agent SWEEP_ID [OPTIONS]
11+
```
1012

11-
Run the W&B agent
13+
## Arguments
1214

15+
| Argument | Description | Required |
16+
| :--- | :--- | :--- |
17+
| `SWEEP_ID` | No description available | Yes |
1318

14-
**Options**
19+
## Options
1520

16-
| **Option** | **Description** |
21+
| Option | Description |
1722
| :--- | :--- |
18-
| `-p, --project` | The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled 'Uncategorized'. |
19-
| `-e, --entity` | The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. |
23+
| `--project`, `-p` | The name of the project where W&B runs created from the sweep are sent to. If the project is not specified, the run is sent to a project labeled 'Uncategorized'. |
24+
| `--entity`, `-e` | The username or team name where you want to send W&B runs created by the sweep to. Ensure that the entity you specify already exists. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. |
2025
| `--count` | The max number of runs for this agent. |
21-
22-
23-
Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
---
22
title: wandb artifact
3+
no_list: true
34
---
45

5-
**Usage**
6-
7-
`wandb artifact [OPTIONS] COMMAND [ARGS]...`
8-
9-
**Summary**
10-
116
Commands for interacting with artifacts
127

8+
## Usage
139

14-
**Options**
10+
```bash
11+
wandb artifact COMMAND [ARGS]...
12+
```
1513

16-
| **Option** | **Description** |
17-
| :--- | :--- |
14+
## Commands
1815

19-
20-
**Commands**
21-
22-
| **Command** | **Description** |
16+
| Command | Description |
2317
| :--- | :--- |
24-
| cache | Commands for interacting with the artifact cache |
25-
| get | Download an artifact from wandb |
26-
| ls | List all artifacts in a wandb project |
27-
| put | Upload an artifact to wandb |
28-
18+
| [cache]({{< relref "wandb-artifact-cache/_index" >}}) | Commands for interacting with the artifact cache |
19+
| [get]({{< relref "wandb-artifact-get" >}}) | Download an artifact from wandb |
20+
| [ls]({{< relref "wandb-artifact-ls" >}}) | List all artifacts in a wandb project |
21+
| [put]({{< relref "wandb-artifact-put" >}}) | Upload an artifact to wandb |
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
---
22
title: wandb artifact cache
3+
no_list: true
34
---
45

5-
**Usage**
6-
7-
`wandb artifact cache [OPTIONS] COMMAND [ARGS]...`
8-
9-
**Summary**
10-
116
Commands for interacting with the artifact cache
127

8+
## Usage
139

14-
**Options**
10+
```bash
11+
wandb artifact cache COMMAND [ARGS]...
12+
```
1513

16-
| **Option** | **Description** |
17-
| :--- | :--- |
14+
## Commands
1815

19-
20-
**Commands**
21-
22-
| **Command** | **Description** |
16+
| Command | Description |
2317
| :--- | :--- |
24-
| cleanup | Clean up less frequently used files from the artifacts cache |
25-
18+
| [cleanup]({{< relref "wandb-artifact-cache-cleanup" >}}) | Clean up less frequently used files from the artifacts cache |

content/en/ref/cli/wandb-artifact/wandb-artifact-cache/wandb-artifact-cache-cleanup.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
title: wandb artifact cache cleanup
33
---
44

5-
**Usage**
6-
7-
`wandb artifact cache cleanup [OPTIONS] TARGET_SIZE`
8-
9-
**Summary**
10-
115
Clean up less frequently used files from the artifacts cache
126

7+
## Usage
138

14-
**Options**
9+
```bash
10+
wandb cleanup TARGET_SIZE [OPTIONS]
11+
```
1512

16-
| **Option** | **Description** |
17-
| :--- | :--- |
18-
| `--remove-temp / --no-remove-temp` | Remove temp files |
13+
## Arguments
1914

15+
| Argument | Description | Required |
16+
| :--- | :--- | :--- |
17+
| `TARGET_SIZE` | No description available | Yes |
2018

19+
## Options
2120

21+
| Option | Description |
22+
| :--- | :--- |
23+
| `--remove-temp` | Remove temp files (default: False) |

content/en/ref/cli/wandb-artifact/wandb-artifact-get.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
title: wandb artifact get
33
---
44

5-
**Usage**
5+
Download an artifact from wandb
66

7-
`wandb artifact get [OPTIONS] PATH`
7+
## Usage
88

9-
**Summary**
9+
```bash
10+
wandb get PATH [OPTIONS]
11+
```
1012

11-
Download an artifact from wandb
13+
## Arguments
1214

15+
| Argument | Description | Required |
16+
| :--- | :--- | :--- |
17+
| `PATH` | No description available | Yes |
1318

14-
**Options**
19+
## Options
1520

16-
| **Option** | **Description** |
21+
| Option | Description |
1722
| :--- | :--- |
1823
| `--root` | The directory you want to download the artifact to |
1924
| `--type` | The type of artifact you are downloading |
20-
21-
22-

content/en/ref/cli/wandb-artifact/wandb-artifact-ls.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
title: wandb artifact ls
33
---
44

5-
**Usage**
6-
7-
`wandb artifact ls [OPTIONS] PATH`
8-
9-
**Summary**
10-
115
List all artifacts in a wandb project
126

7+
## Usage
138

14-
**Options**
9+
```bash
10+
wandb ls PATH [OPTIONS]
11+
```
1512

16-
| **Option** | **Description** |
17-
| :--- | :--- |
18-
| `-t, --type` | The type of artifacts to list |
13+
## Arguments
1914

15+
| Argument | Description | Required |
16+
| :--- | :--- | :--- |
17+
| `PATH` | No description available | Yes |
2018

19+
## Options
2120

21+
| Option | Description |
22+
| :--- | :--- |
23+
| `--type`, `-t` | The type of artifacts to list |

content/en/ref/cli/wandb-artifact/wandb-artifact-put.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
22
title: wandb artifact put
33
---
44

5-
**Usage**
5+
Upload an artifact to wandb
66

7-
`wandb artifact put [OPTIONS] PATH`
7+
## Usage
88

9-
**Summary**
9+
```bash
10+
wandb put PATH [OPTIONS]
11+
```
1012

11-
Upload an artifact to wandb
13+
## Arguments
1214

15+
| Argument | Description | Required |
16+
| :--- | :--- | :--- |
17+
| `PATH` | No description available | Yes |
1318

14-
**Options**
19+
## Options
1520

16-
| **Option** | **Description** |
21+
| Option | Description |
1722
| :--- | :--- |
18-
| `-n, --name` | The name of the artifact to push: project/artifact_name |
19-
| `-d, --description` | A description of this artifact |
20-
| `-t, --type` | The type of the artifact |
21-
| `-a, --alias` | An alias to apply to this artifact |
23+
| `--name`, `-n` | The name of the artifact to push: project/artifact_name |
24+
| `--description`, `-d` | A description of this artifact |
25+
| `--type`, `-t` | The type of the artifact (default: dataset) |
26+
| `--alias`, `-a` | An alias to apply to this artifact (default: ['latest']) |
2227
| `--id` | The run you want to upload to. |
23-
| `--resume` | Resume the last run from your current directory. |
24-
| `--skip_cache` | Skip caching while uploading artifact files. |
25-
| `--policy [mutable|immutable]` | Set the storage policy while uploading artifact files. |
26-
27-
28-
28+
| `--resume` | Resume the last run from your current directory. |
29+
| `--skip_cache` | Skip caching while uploading artifact files. (default: False) |
30+
| `--policy` | Set the storage policy while uploading artifact files. (default: mutable) |
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
---
22
title: wandb beta
3+
no_list: true
34
---
45

5-
**Usage**
6-
7-
`wandb beta [OPTIONS] COMMAND [ARGS]...`
8-
9-
**Summary**
10-
116
Beta versions of wandb CLI commands. Requires wandb-core.
127

8+
## Usage
139

14-
**Options**
10+
```bash
11+
wandb beta COMMAND [ARGS]...
12+
```
1513

16-
| **Option** | **Description** |
17-
| :--- | :--- |
14+
## Commands
1815

19-
20-
**Commands**
21-
22-
| **Command** | **Description** |
16+
| Command | Description |
2317
| :--- | :--- |
24-
| sync | Upload a training run to W&B |
25-
18+
| [sync]({{< relref "wandb-beta-sync" >}}) | Upload a training run to W&B |

0 commit comments

Comments
 (0)