Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Add Command to Generate CLI Documentation
Browse files Browse the repository at this point in the history
This commands uses embedded info to generate markdown
documentation for the CLI.
  • Loading branch information
mainawycliffe committed Apr 12, 2020
1 parent 23409d9 commit 272f5c2
Show file tree
Hide file tree
Showing 17 changed files with 530 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmd/docsGen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"log"

"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
)

// docsGenCmd represents the docsGen command
var docsGenCmd = &cobra.Command{
Use: "docsGen",
Short: "Generate Kamanda Documentation",
Run: func(cmd *cobra.Command, args []string) {
err := doc.GenMarkdownTree(rootCmd, "./docs")
if err != nil {
log.Fatal(err)
}
},
}

func init() {
rootCmd.AddCommand(docsGenCmd)
}
35 changes: 35 additions & 0 deletions docs/kamanda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## kamanda

Kamanda is an extender Firebase Tools CLI

### Synopsis

Kamanda is a Firebase CLI Tool extender and should be used alongside it.

Kamanda provides additional functionality currently not available to via the
Firebase CLI Tool such as User Management, Cloud Firestore Management etc from the CLI.

For instance, it allows you to easily create users with custom tokens,
which is always a trick preposition.

### Options

```
--config string config file (default is $HOME/.kamanda/config.json)
-h, --help help for kamanda
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
-t, --toggle Help message for toggle
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations
* [kamanda docsGen](kamanda_docsGen.md) - Generate Kamanda Documentation
* [kamanda login](kamanda_login.md) - Log kamanda into firebase
* [kamanda login:ci](kamanda_login:ci.md) - generate an access token for use in non-interactive environments
* [kamanda logout](kamanda_logout.md) - Logout kamanda from Firebase
* [kamanda version](kamanda_version.md) - Version will output the current build information

###### Auto generated by spf13/cobra on 13-Apr-2020
34 changes: 34 additions & 0 deletions docs/kamanda_auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## kamanda auth

Perform Firebase Auth Operations

### Synopsis

Perform Firebase Auth Operations

### Options

```
-h, --help help for auth
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda](kamanda.md) - Kamanda is an extender Firebase Tools CLI
* [kamanda auth addUser](kamanda_auth_addUser.md) - Add a new Firebase user
* [kamanda auth addUsers](kamanda_auth_addUsers.md) - Add multiple users from file (JSON/YAML)
* [kamanda auth customClaims](kamanda_auth_customClaims.md) - Add custom claims to firebase user or users
* [kamanda auth deleteUsers](kamanda_auth_deleteUsers.md) - Delete multiple Firebase Auth User by their UID
* [kamanda auth find](kamanda_auth_find.md) - Find a user by uid. To find user by email or by phone use `find byEmail` or `find byPhone`
* [kamanda auth users](kamanda_auth_users.md) - Get a list of users in firebase auth.

###### Auto generated by spf13/cobra on 13-Apr-2020
41 changes: 41 additions & 0 deletions docs/kamanda_auth_addUser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## kamanda auth addUser

Add a new Firebase user

### Synopsis

Add a new Firebase user

```
kamanda auth addUser [flags]
```

### Options

```
-c, --customClaims stringToString user custom claims i.e. --customClaims "admin=true" (default [])
--email string the email of the new user
--emailVerified is the email verified
-h, --help help for addUser
--isDisabled is the user account disabled
--name string the name of the user
--password string the password of the new user
--phone string the phone number of the user
--photoURL string the photo url of the user
--uid string the uid of the user. autogenerated if absent
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations

###### Auto generated by spf13/cobra on 13-Apr-2020
34 changes: 34 additions & 0 deletions docs/kamanda_auth_addUsers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## kamanda auth addUsers

Add multiple users from file (JSON/YAML)

### Synopsis

Add multiple users from file (JSON/YAML)

```
kamanda auth addUsers [flags]
```

### Options

```
-e, --extension string Source file type - json or yaml (default "yaml")
-h, --help help for addUsers
-s, --source string file with list of users to create
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations

###### Auto generated by spf13/cobra on 13-Apr-2020
33 changes: 33 additions & 0 deletions docs/kamanda_auth_customClaims.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## kamanda auth customClaims

Add custom claims to firebase user or users

### Synopsis

Add custom claims to firebase user or users

```
kamanda auth customClaims [flags]
```

### Options

```
-c, --customClaims stringToString user custom claims i.e. --customClaims "admin=true" (default [])
-h, --help help for customClaims
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations

###### Auto generated by spf13/cobra on 13-Apr-2020
32 changes: 32 additions & 0 deletions docs/kamanda_auth_deleteUsers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## kamanda auth deleteUsers

Delete multiple Firebase Auth User by their UID

### Synopsis

Delete multiple Firebase Auth User by their UID

```
kamanda auth deleteUsers [flags]
```

### Options

```
-h, --help help for deleteUsers
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations

###### Auto generated by spf13/cobra on 13-Apr-2020
35 changes: 35 additions & 0 deletions docs/kamanda_auth_find.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## kamanda auth find

Find a user by uid. To find user by email or by phone use `find byEmail` or `find byPhone`

### Synopsis

Find a user by uid. To find user by email or by phone use `find byEmail` or `find byPhone`

```
kamanda auth find [flags]
```

### Options

```
-h, --help help for find
-t, --toggle Help message for toggle
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations
* [kamanda auth find byEmail](kamanda_auth_find_byEmail.md) - find a user by email address
* [kamanda auth find byPhone](kamanda_auth_find_byPhone.md) - find a user by phone number

###### Auto generated by spf13/cobra on 13-Apr-2020
32 changes: 32 additions & 0 deletions docs/kamanda_auth_find_byEmail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## kamanda auth find byEmail

find a user by email address

### Synopsis

find a user by email address

```
kamanda auth find byEmail [flags]
```

### Options

```
-h, --help help for byEmail
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth find](kamanda_auth_find.md) - Find a user by uid. To find user by email or by phone use `find byEmail` or `find byPhone`

###### Auto generated by spf13/cobra on 13-Apr-2020
32 changes: 32 additions & 0 deletions docs/kamanda_auth_find_byPhone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## kamanda auth find byPhone

find a user by phone number

### Synopsis

find a user by phone number

```
kamanda auth find byPhone [flags]
```

### Options

```
-h, --help help for byPhone
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth find](kamanda_auth_find.md) - Find a user by uid. To find user by email or by phone use `find byEmail` or `find byPhone`

###### Auto generated by spf13/cobra on 13-Apr-2020
33 changes: 33 additions & 0 deletions docs/kamanda_auth_users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## kamanda auth users

Get a list of users in firebase auth.

### Synopsis

Get a list of users in firebase auth.

```
kamanda auth users [flags]
```

### Options

```
-h, --help help for users
-n, --nextPageToken string Fetch next set of results
```

### Options inherited from parent commands

```
--config string config file (default is $HOME/.kamanda/config.json)
-o, --output string A file where data from firebase will be saved.
-P, --project string The firebase project to use (default "default")
--token string firebase token to use for authentication
```

### SEE ALSO

* [kamanda auth](kamanda_auth.md) - Perform Firebase Auth Operations

###### Auto generated by spf13/cobra on 13-Apr-2020
Loading

0 comments on commit 272f5c2

Please sign in to comment.