Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate docs on every commit #683

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/pushes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
permissions:
contents: write

continue-on-error: ${{ matrix.experimental || false }}
strategy:
# Debugging multi-platform builds, let them all complete (for now)
Expand All @@ -52,6 +55,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Set up Go
Expand Down Expand Up @@ -125,6 +129,17 @@ jobs:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.canonical

- name: Generate docs
run: go run ./ test doc docs
if: matrix.os == 'ubuntu-latest'

- name: Auto-commit generated docs
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto-commit docs
file_pattern: docs/**
if: matrix.os == 'ubuntu-latest'

- name: Bad versions creep defense
id: go-module-versions
# The go.mod includes tests, and some of our tests explicitly pull in jwtv1, which is unmaintained and has security issues.
Expand Down
14 changes: 10 additions & 4 deletions docs/nsc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

nsc creates NATS operators, accounts, users, and manage their permissions.

### Synopsis

nsc creates NATS operators, accounts, users, and manage their permissions.
```
nsc [flags]
```

### Options

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-h, --help help for nsc
Expand All @@ -17,27 +18,32 @@ nsc creates NATS operators, accounts, users, and manage their permissions.
-K, --private-key string Key used to sign. Can be specified as role (where applicable),
public key (private portion is retrieved)
or file path to a private key or private key
-v, --version version for nsc
```

### SEE ALSO

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users
* [nsc completion](nsc_completion.md) - Generate the autocompletion script for the specified shell
* [nsc delete](nsc_delete.md) - Delete imports and exports
* [nsc describe](nsc_describe.md) - Describe assets such as operators, accounts, users, and jwt files
* [nsc edit](nsc_edit.md) - Edit assets such as accounts, imports, and users
* [nsc env](nsc_env.md) - Prints and manage the nsc environment
* [nsc expirations](nsc_expirations.md) - Create a new expiration report
* [nsc export](nsc_export.md) - Export assets such as nkeys
* [nsc generate](nsc_generate.md) - Generate activations, creds, configs or nkeys
* [nsc import](nsc_import.md) - Import assets such as nkeys
* [nsc init](nsc_init.md) - Initialize an environment by creating an operator, account and user
* [nsc keys](nsc_keys.md) - Manage keys for operators, accounts, and users
* [nsc list](nsc_list.md) - List assets such as accounts, imports, users
* [nsc load](nsc_load.md) - install entities for an operator, account and key
* [nsc pull](nsc_pull.md) - Pull an operator or account jwt replacing the local jwt with the server's version
* [nsc push](nsc_push.md) - Push an account jwt to an Account JWT Server
* [nsc reissue](nsc_reissue.md) - Re-issue objects with a new identity key
* [nsc revocations](nsc_revocations.md) - Manage revocation for users and activations from an account
* [nsc select](nsc_select.md) - Set the current operator or account
* [nsc tool](nsc_tool.md) - NATS tools: pub, sub, req, rep, rtt
* [nsc update](nsc_update.md) - Update this tool to latest version
* [nsc validate](nsc_validate.md) - Validate an operator, account(s), and users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
7 changes: 2 additions & 5 deletions docs/nsc_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add assets such as accounts, imports, users

### Synopsis

Add assets such as accounts, imports, users

### Options

```
Expand All @@ -15,6 +11,7 @@ Add assets such as accounts, imports, users
### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -34,4 +31,4 @@ Add assets such as accounts, imports, users
* [nsc add operator](nsc_add_operator.md) - Add an operator
* [nsc add user](nsc_add_user.md) - Add an user to the account

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
11 changes: 4 additions & 7 deletions docs/nsc_add_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add an account

### Synopsis

Add an account

```
nsc add account [flags]
```
Expand All @@ -20,17 +16,18 @@ nsc add account [flags]
--deny-pub strings add deny publish default permissions - comma separated list or option can be specified multiple times
--deny-pubsub strings add deny publish and subscribe default permissions - comma separated list or option can be specified multiple times
--deny-sub strings add deny subscribe default permissions - comma separated list or option can be specified multiple times
--expiry string valid until ('0' is always, '2M' is two months) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears) (default "0")
--expiry string valid until ('0' is always, '2M' is two months) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears)
-h, --help help for account
-n, --name string account name
-k, --public-key string public key identifying the account
--response-ttl string the amount of time the default permissions is valid (global) - [#ms(millis) | #s(econds) | m(inutes) | h(ours)] - Default is no time limit.
--start string valid from ('0' is always, '3d' is three days) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears) (default "0")
--start string valid from ('0' is always, '3d' is three days) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears)
```

### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -44,4 +41,4 @@ nsc add account [flags]

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
8 changes: 3 additions & 5 deletions docs/nsc_add_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add an export

### Synopsis

Add an export

```
nsc add export [flags]
```
Expand All @@ -24,6 +20,7 @@ nsc add export --name myexport --subject a.b --service
```
-a, --account string account name
--account-token-position uint subject token position where account is expected (public exports only)
--allow-trace allow trace requests
-h, --help help for export
--latency string latency metrics subject (services only)
-n, --name string export name
Expand All @@ -38,6 +35,7 @@ nsc add export --name myexport --subject a.b --service
### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -51,4 +49,4 @@ nsc add export --name myexport --subject a.b --service

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
8 changes: 3 additions & 5 deletions docs/nsc_add_import.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add an import

### Synopsis

Add an import

```
nsc add import [flags]
```
Expand All @@ -23,6 +19,7 @@ nsc add import --src-account <account_pubkey> --remote-subject <remote-sub> --lo

```
-a, --account string account name
--allow-trace allow trace requests
-h, --help help for import
-s, --local-subject string local subject
-n, --name string import name
Expand All @@ -36,6 +33,7 @@ nsc add import --src-account <account_pubkey> --remote-subject <remote-sub> --lo
### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -49,4 +47,4 @@ nsc add import --src-account <account_pubkey> --remote-subject <remote-sub> --lo

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
7 changes: 2 additions & 5 deletions docs/nsc_add_mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add (or modify) a mapping entry

### Synopsis

Add (or modify) a mapping entry

```
nsc add mapping [flags]
```
Expand Down Expand Up @@ -35,6 +31,7 @@ nsc add mapping --from "a" --to "c" --weight 50
### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -48,4 +45,4 @@ nsc add mapping --from "a" --to "c" --weight 50

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
11 changes: 4 additions & 7 deletions docs/nsc_add_operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,27 @@

Add an operator

### Synopsis

Add an operator

```
nsc add operator [flags]
```

### Options

```
--expiry string valid until ('0' is always, '2M' is two months) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears) (default "0")
--expiry string valid until ('0' is always, '2M' is two months) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears)
--force on import, overwrite existing when already present
--generate-signing-key generate a signing key with the operator
-h, --help help for operator
-n, --name string operator name
--start string valid from ('0' is always, '3d' is three days) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears) (default "0")
--start string valid from ('0' is always, '3d' is three days) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears)
-s, --sys generate system account with the operator (if specified will be signed with signing key)
-u, --url string import from a jwt server url, file, or well known operator
```

### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -39,4 +36,4 @@ nsc add operator [flags]

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
11 changes: 4 additions & 7 deletions docs/nsc_add_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Add an user to the account

### Synopsis

Add an user to the account

```
nsc add user [flags]
```
Expand Down Expand Up @@ -58,19 +54,20 @@ nsc add user --name <n> --allow-pub-response=5
--deny-pub strings add deny publish permissions - comma separated list or option can be specified multiple times
--deny-pubsub strings add deny publish and subscribe permissions - comma separated list or option can be specified multiple times
--deny-sub strings add deny subscribe permissions - comma separated list or option can be specified multiple times
--expiry string valid until ('0' is always, '2M' is two months) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears) (default "0")
--expiry string valid until ('0' is always, '2M' is two months) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears)
-h, --help help for user
-n, --name string name to assign the user
-k, --public-key string public key identifying the user
--response-ttl string the amount of time the permissions is valid (global) - [#ms(millis) | #s(econds) | m(inutes) | h(ours)] - Default is no time limit.
--source-network strings source network for connection - comma separated list or option can be specified multiple times
--start string valid from ('0' is always, '3d' is three days) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears) (default "0")
--start string valid from ('0' is always, '3d' is three days) - yyyy-mm-dd, #m(inutes), #h(ours), #d(ays), #w(eeks), #M(onths), #y(ears)
--tag strings tags for user - comma separated list or option can be specified multiple times
```

### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
Expand All @@ -84,4 +81,4 @@ nsc add user --name <n> --allow-pub-response=5

* [nsc add](nsc_add.md) - Add assets such as accounts, imports, users

###### Auto generated by spf13/cobra on 25-Feb-2022
###### Auto generated by spf13/cobra on 18-Dec-2024
38 changes: 38 additions & 0 deletions docs/nsc_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## nsc completion

Generate the autocompletion script for the specified shell

### Synopsis

Generate the autocompletion script for nsc for the specified shell.
See each sub-command's help for details on how to use the generated script.


### Options

```
-h, --help help for completion
```

### Options inherited from parent commands

```
-H, --all-dirs string sets --config-dir, --data-dir, and --keystore-dir to the same value
--config-dir string nsc config directory
--data-dir string nsc data store directory
-i, --interactive ask questions for various settings
--keystore-dir string nsc keystore directory
-K, --private-key string Key used to sign. Can be specified as role (where applicable),
public key (private portion is retrieved)
or file path to a private key or private key
```

### SEE ALSO

* [nsc](nsc.md) - nsc creates NATS operators, accounts, users, and manage their permissions.
* [nsc completion bash](nsc_completion_bash.md) - Generate the autocompletion script for bash
* [nsc completion fish](nsc_completion_fish.md) - Generate the autocompletion script for fish
* [nsc completion powershell](nsc_completion_powershell.md) - Generate the autocompletion script for powershell
* [nsc completion zsh](nsc_completion_zsh.md) - Generate the autocompletion script for zsh

###### Auto generated by spf13/cobra on 18-Dec-2024
Loading
Loading