45 lines
886 B
Go
45 lines
886 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var examplesCmd = &cobra.Command{
|
|
Use: "examples",
|
|
Short: "Show common usage examples",
|
|
Args: cobra.NoArgs,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Print(`Add notes:
|
|
kb addnote "Remember to update DNS records"
|
|
kb addnote "Server room is building 3" --tags ops
|
|
kb addnote "Deploy checklist" --wait
|
|
|
|
Add files:
|
|
kb addfile report.pdf
|
|
kb addfile ~/docs/ --recursive --tags reference
|
|
kb addfile report.pdf --wait
|
|
|
|
Search:
|
|
kb search "how to restart nginx"
|
|
kb search "deploy" --tags ops --top 5
|
|
kb find "quarterly report" --type pdf
|
|
|
|
Update notes:
|
|
kb updatenote 42 "revised note content"
|
|
|
|
Manage documents:
|
|
kb list --type pdf
|
|
kb list --filename report.pdf
|
|
kb info 3 --no-chunks
|
|
kb tag 3 --add important,ops
|
|
kb remove 3 --yes
|
|
`)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(examplesCmd)
|
|
}
|