Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 1b5807e

Browse files
committed
Add gendocs ci step
1 parent b9ebf97 commit 1b5807e

22 files changed

+118
-26
lines changed

ci/steps/gendocs.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
echo "Generating docs..."
3+
4+
cd "$(dirname "$0")"
5+
cd ../../
6+
7+
go run ./cmd/coder gen-docs ./docs
8+
9+
# remove cobra footer from each file
10+
for filename in ./docs/*.md; do
11+
trimmed=$(head -n -1 "$filename")
12+
echo "$trimmed" > $filename
13+
done
14+
15+
16+
if [ "$CI" != "" ]; then
17+
if [[ $(git ls-files --other --modified --exclude-standard) != "" ]]; then
18+
echo "Documentation needs generation:"
19+
git -c color.ui=always status | grep --color=no '\e\[31m'
20+
echo "Please run the following locally:"
21+
echo " ./ci/steps/gendocs.sh"
22+
exit 1
23+
fi
24+
fi

docs/coder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ coder provides a CLI for working with an existing Coder Enterprise installation
1414

1515
### SEE ALSO
1616

17+
* [coder completion](coder_completion.md) - Generate completion script
1718
* [coder config-ssh](coder_config-ssh.md) - Configure SSH to access Coder environments
1819
* [coder envs](coder_envs.md) - Interact with Coder environments
1920
* [coder login](coder_login.md) - Authenticate this client for future operations
@@ -23,4 +24,3 @@ coder provides a CLI for working with an existing Coder Enterprise installation
2324
* [coder sync](coder_sync.md) - Establish a one way directory sync to a Coder environment
2425
* [coder urls](coder_urls.md) - Interact with environment DevURLs
2526
* [coder users](coder_users.md) - Interact with Coder user accounts
26-

docs/coder_completion.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
## coder completion
2+
3+
Generate completion script
4+
5+
### Synopsis
6+
7+
To load completions:
8+
9+
Bash:
10+
11+
$ source <(coder completion bash)
12+
13+
To load completions for each session, execute once:
14+
Linux:
15+
$ coder completion bash > /etc/bash_completion.d/coder
16+
MacOS:
17+
$ coder completion bash > /usr/local/etc/bash_completion.d/coder
18+
19+
Zsh:
20+
21+
If shell completion is not already enabled in your environment you will need
22+
to enable it. You can execute the following once:
23+
24+
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
25+
26+
To load completions for each session, execute once:
27+
$ coder completion zsh > "${fpath[1]}/_coder"
28+
29+
You will need to start a new shell for this setup to take effect.
30+
31+
Fish:
32+
33+
$ coder completion fish | source
34+
35+
To load completions for each session, execute once:
36+
$ coder completion fish > ~/.config/fish/completions/coder.fish
37+
38+
39+
```
40+
coder completion [bash|zsh|fish|powershell]
41+
```
42+
43+
### Examples
44+
45+
```
46+
coder completion fish > ~/.config/fish/completions/coder.fish
47+
coder completion zsh > "${fpath[1]}/_coder"
48+
49+
Linux:
50+
$ coder completion bash > /etc/bash_completion.d/coder
51+
MacOS:
52+
$ coder completion bash > /usr/local/etc/bash_completion.d/coder
53+
```
54+
55+
### Options
56+
57+
```
58+
-h, --help help for completion
59+
```
60+
61+
### SEE ALSO
62+
63+
* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation

docs/coder_config-ssh.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ coder config-ssh [flags]
1313
### Options
1414

1515
```
16-
--filepath string overide the default path of your ssh config file (default "~/.ssh/config")
16+
--filepath string overide the default path of your ssh config file (default "/Users/charlesmoog/.ssh/config")
1717
-h, --help help for config-ssh
1818
--remove remove the auto-generated Coder Enterprise ssh config
1919
```
2020

2121
### SEE ALSO
2222

2323
* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
24-

docs/coder_envs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ Perform operations on the Coder environments owned by the active user.
1717

1818
* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
1919
* [coder envs ls](coder_envs_ls.md) - list all environments owned by the active user
20-

docs/coder_envs_ls.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ coder envs ls [flags]
2626
### SEE ALSO
2727

2828
* [coder envs](coder_envs.md) - Interact with Coder environments
29-

docs/coder_login.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ coder login [Coder Enterprise URL eg. http://my.coder.domain/] [flags]
1919
### SEE ALSO
2020

2121
* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
22-

docs/coder_logout.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ coder logout [flags]
1919
### SEE ALSO
2020

2121
* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation
22-

docs/coder_secrets.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Interact with secrets objects owned by the active user.
2020
* [coder secrets ls](coder_secrets_ls.md) - List all secrets owned by the active user
2121
* [coder secrets rm](coder_secrets_rm.md) - Remove one or more secrets by name
2222
* [coder secrets view](coder_secrets_view.md) - View a secret by name
23-

docs/coder_secrets_create.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@ coder secrets create aws-credentials --from-file ./credentials.json
3737
### SEE ALSO
3838

3939
* [coder secrets](coder_secrets.md) - Interact with Coder Secrets
40-

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy