Skip to content

Commit 4c441d5

Browse files
committed
Link subcommands
1 parent 376c38a commit 4c441d5

File tree

11 files changed

+64
-57
lines changed

11 files changed

+64
-57
lines changed

docs/cli.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,30 @@ coder [flags]
2424
## Subcommands
2525
| Name | Purpose |
2626
| ---- | ----- |
27-
| <code>config-ssh</code> | Add an SSH Host entry for your workspaces "ssh coder.workspace" |
28-
| <code>create</code> | Create a workspace |
29-
| <code>delete</code> | Delete a workspace |
30-
| <code>dotfiles</code> | Checkout and install a dotfiles repository from a Git URL |
31-
| <code>list</code> | List workspaces |
32-
| <code>login</code> | Authenticate with Coder deployment |
33-
| <code>logout</code> | Unauthenticate your local session |
34-
| <code>ping</code> | Ping a workspace |
35-
| <code>port-forward</code> | Forward ports from machine to a workspace |
36-
| <code>publickey</code> | Output your Coder public key used for Git operations |
37-
| <code>rename</code> | Rename a workspace |
38-
| <code>reset-password</code> | Directly connect to the database to reset a user's password |
39-
| <code>restart</code> | Restart a workspace |
40-
| <code>scaletest</code> | Run a scale test against the Coder API |
41-
| <code>schedule</code> | Schedule automated start and stop times for workspaces |
42-
| <code>server</code> | Start a Coder server |
43-
| <code>show</code> | Display details of a workspace's resources and agents |
44-
| <code>speedtest</code> | Run upload and download tests from your machine to a workspace |
45-
| <code>ssh</code> | Start a shell into a workspace |
46-
| <code>start</code> | Start a workspace |
47-
| <code>state</code> | Manually manage Terraform state to fix broken workspaces |
48-
| <code>stop</code> | Stop a workspace |
49-
| <code>templates</code> | Manage templates |
50-
| <code>tokens</code> | Manage personal access tokens |
51-
| <code>update</code> | Update a workspace |
52-
| <code>users</code> | Manage users |
53-
| <code>version</code> | Show coder version |
27+
| [<code>config-ssh</code>](./cli/coder_config-ssh) | Add an SSH Host entry for your workspaces "ssh coder.workspace" |
28+
| [<code>create</code>](./cli/coder_create) | Create a workspace |
29+
| [<code>delete</code>](./cli/coder_delete) | Delete a workspace |
30+
| [<code>dotfiles</code>](./cli/coder_dotfiles) | Checkout and install a dotfiles repository from a Git URL |
31+
| [<code>list</code>](./cli/coder_list) | List workspaces |
32+
| [<code>login</code>](./cli/coder_login) | Authenticate with Coder deployment |
33+
| [<code>logout</code>](./cli/coder_logout) | Unauthenticate your local session |
34+
| [<code>ping</code>](./cli/coder_ping) | Ping a workspace |
35+
| [<code>port-forward</code>](./cli/coder_port-forward) | Forward ports from machine to a workspace |
36+
| [<code>publickey</code>](./cli/coder_publickey) | Output your Coder public key used for Git operations |
37+
| [<code>rename</code>](./cli/coder_rename) | Rename a workspace |
38+
| [<code>reset-password</code>](./cli/coder_reset-password) | Directly connect to the database to reset a user's password |
39+
| [<code>restart</code>](./cli/coder_restart) | Restart a workspace |
40+
| [<code>scaletest</code>](./cli/coder_scaletest) | Run a scale test against the Coder API |
41+
| [<code>schedule</code>](./cli/coder_schedule) | Schedule automated start and stop times for workspaces |
42+
| [<code>server</code>](./cli/coder_server) | Start a Coder server |
43+
| [<code>show</code>](./cli/coder_show) | Display details of a workspace's resources and agents |
44+
| [<code>speedtest</code>](./cli/coder_speedtest) | Run upload and download tests from your machine to a workspace |
45+
| [<code>ssh</code>](./cli/coder_ssh) | Start a shell into a workspace |
46+
| [<code>start</code>](./cli/coder_start) | Start a workspace |
47+
| [<code>state</code>](./cli/coder_state) | Manually manage Terraform state to fix broken workspaces |
48+
| [<code>stop</code>](./cli/coder_stop) | Stop a workspace |
49+
| [<code>templates</code>](./cli/coder_templates) | Manage templates |
50+
| [<code>tokens</code>](./cli/coder_tokens) | Manage personal access tokens |
51+
| [<code>update</code>](./cli/coder_update) | Update a workspace |
52+
| [<code>users</code>](./cli/coder_users) | Manage users |
53+
| [<code>version</code>](./cli/coder_version) | Show coder version |

docs/cli/coder_scaletest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ coder scaletest [flags]
1212
## Subcommands
1313
| Name | Purpose |
1414
| ---- | ----- |
15-
| <code>cleanup</code> | Cleanup any orphaned scaletest resources |
16-
| <code>create-workspaces</code> | Creates many workspaces and waits for them to be ready |
15+
| [<code>cleanup</code>](./coder_scaletest_cleanup) | Cleanup any orphaned scaletest resources |
16+
| [<code>create-workspaces</code>](./coder_scaletest_create-workspaces) | Creates many workspaces and waits for them to be ready |

docs/cli/coder_schedule.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ coder schedule { show | start | stop | override } <workspace> [flags]
1212
## Subcommands
1313
| Name | Purpose |
1414
| ---- | ----- |
15-
| <code>override-stop</code> | Edit stop time of active workspace |
16-
| <code>show</code> | Show workspace schedule |
17-
| <code>start</code> | Edit workspace start schedule |
18-
| <code>stop</code> | Edit workspace stop schedule |
15+
| [<code>override-stop</code>](./coder_schedule_override-stop) | Edit stop time of active workspace |
16+
| [<code>show</code>](./coder_schedule_show) | Show workspace schedule |
17+
| [<code>start</code>](./coder_schedule_start) | Edit workspace start schedule |
18+
| [<code>stop</code>](./coder_schedule_stop) | Edit workspace stop schedule |

docs/cli/coder_server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ coder server [flags]
1212
## Subcommands
1313
| Name | Purpose |
1414
| ---- | ----- |
15-
| <code>create-admin-user</code> | Create a new admin user with the given username, email and password and adds it to every organization. |
16-
| <code>postgres-builtin-serve</code> | Run the built-in PostgreSQL deployment. |
17-
| <code>postgres-builtin-url</code> | Output the connection URL for the built-in PostgreSQL deployment. |
15+
| [<code>create-admin-user</code>](./coder_server_create-admin-user) | Create a new admin user with the given username, email and password and adds it to every organization. |
16+
| [<code>postgres-builtin-serve</code>](./coder_server_postgres-builtin-serve) | Run the built-in PostgreSQL deployment. |
17+
| [<code>postgres-builtin-url</code>](./coder_server_postgres-builtin-url) | Output the connection URL for the built-in PostgreSQL deployment. |
1818

1919
## Flags
2020
### --access-url

docs/cli/coder_state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ coder state [flags]
1212
## Subcommands
1313
| Name | Purpose |
1414
| ---- | ----- |
15-
| <code>pull</code> | Pull a Terraform state file from a workspace. |
16-
| <code>push</code> | Push a Terraform state file to a workspace. |
15+
| [<code>pull</code>](./coder_state_pull) | Pull a Terraform state file from a workspace. |
16+
| [<code>push</code>](./coder_state_push) | Push a Terraform state file to a workspace. |

docs/cli/coder_templates.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ coder templates [flags]
2727
## Subcommands
2828
| Name | Purpose |
2929
| ---- | ----- |
30-
| <code>create</code> | Create a template from the current directory or as specified by flag |
31-
| <code>delete</code> | Delete templates |
32-
| <code>edit</code> | Edit the metadata of a template by name. |
33-
| <code>init</code> | Get started with a templated template. |
34-
| <code>list</code> | List all the templates available for the organization |
35-
| <code>plan</code> | Plan a template push from the current directory |
36-
| <code>pull</code> | Download the latest version of a template to a path. |
37-
| <code>push</code> | Push a new template version from the current directory or as specified by flag |
38-
| <code>versions</code> | Manage different versions of the specified template |
30+
| [<code>create</code>](./coder_templates_create) | Create a template from the current directory or as specified by flag |
31+
| [<code>delete</code>](./coder_templates_delete) | Delete templates |
32+
| [<code>edit</code>](./coder_templates_edit) | Edit the metadata of a template by name. |
33+
| [<code>init</code>](./coder_templates_init) | Get started with a templated template. |
34+
| [<code>list</code>](./coder_templates_list) | List all the templates available for the organization |
35+
| [<code>plan</code>](./coder_templates_plan) | Plan a template push from the current directory |
36+
| [<code>pull</code>](./coder_templates_pull) | Download the latest version of a template to a path. |
37+
| [<code>push</code>](./coder_templates_push) | Push a new template version from the current directory or as specified by flag |
38+
| [<code>versions</code>](./coder_templates_versions) | Manage different versions of the specified template |

docs/cli/coder_templates_versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ coder templates versions [flags]
1919
## Subcommands
2020
| Name | Purpose |
2121
| ---- | ----- |
22-
| <code>list</code> | List all the versions of the specified template |
22+
| [<code>list</code>](./coder_templates_versions_list) | List all the versions of the specified template |

docs/cli/coder_tokens.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ coder tokens [flags]
2727
## Subcommands
2828
| Name | Purpose |
2929
| ---- | ----- |
30-
| <code>create</code> | Create a tokens |
31-
| <code>list</code> | List tokens |
32-
| <code>remove</code> | Delete a token |
30+
| [<code>create</code>](./coder_tokens_create) | Create a tokens |
31+
| [<code>list</code>](./coder_tokens_list) | List tokens |
32+
| [<code>remove</code>](./coder_tokens_remove) | Delete a token |

docs/cli/coder_users.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ coder users [flags]
1212
## Subcommands
1313
| Name | Purpose |
1414
| ---- | ----- |
15-
| <code>activate</code> | Update a user's status to 'active'. Active users can fully interact with the platform |
16-
| <code>create</code> | |
17-
| <code>list</code> | |
18-
| <code>show</code> | Show a single user. Use 'me' to indicate the currently authenticated user. |
19-
| <code>suspend</code> | Update a user's status to 'suspended'. A suspended user cannot log into the platform |
15+
| [<code>activate</code>](./coder_users_activate) | Update a user's status to 'active'. Active users can fully interact with the platform |
16+
| [<code>create</code>](./coder_users_create) | |
17+
| [<code>list</code>](./coder_users_list) | |
18+
| [<code>show</code>](./coder_users_show) | Show a single user. Use 'me' to indicate the currently authenticated user. |
19+
| [<code>suspend</code>](./coder_users_suspend) | Update a user's status to 'suspended'. A suspended user cannot log into the platform |

scripts/clidocgen/command.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
| Name | Purpose |
2828
| ---- | ----- |
2929
{{- end }}
30-
| {{ $cmd.Name | wrapCode }} | {{ $cmd.Short }} |
30+
| [{{ $cmd.Name | wrapCode }}](./{{if $.AtRoot}}cli/{{end}}{{commandURI $cmd}}) | {{ $cmd.Short }} |
3131
{{- end}}
3232
{{ "" }}
3333
{{- range $index, $flag := .Flags }}

scripts/clidocgen/gen.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ func init() {
5555
},
5656
"parseEnv": parseEnv,
5757
"stripEnv": stripEnv,
58+
"commandURI": func(cmd *cobra.Command) string {
59+
return strings.TrimSuffix(
60+
fmtDocFilename(cmd),
61+
".md",
62+
)
63+
},
5864
},
5965
).Parse(strings.TrimSpace(commandTemplateRaw)),
6066
)
@@ -83,6 +89,7 @@ func writeCommand(w io.Writer, cmd *cobra.Command) error {
8389
"Cmd": cmd,
8490
"Flags": flags,
8591
"InheritedFlags": inheritedFlags,
92+
"AtRoot": cmd.Parent() == nil,
8693
"VisibleSubcommands": func() []*cobra.Command {
8794
var scs []*cobra.Command
8895
for _, sub := range cmd.Commands() {

0 commit comments

Comments
 (0)