WeKnora/cli/cmd/kb/kb.go

26 lines
730 B
Go

// Package kb holds the `weknora kb` command tree: list / view / create / delete.
// `view` is the primary read verb (gh repo view convention); `get` survives as
// a cobra alias on the view subcommand for v0.0/v0.1 callers.
package kb
import (
"github.com/spf13/cobra"
"github.com/Tencent/WeKnora/cli/internal/cmdutil"
)
// NewCmd builds the `weknora kb` parent command.
func NewCmd(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "kb",
Short: "Manage knowledge bases",
Args: cobra.NoArgs,
Run: func(c *cobra.Command, _ []string) { _ = c.Help() },
}
cmd.AddCommand(NewCmdList(f))
cmd.AddCommand(NewCmdView(f))
cmd.AddCommand(NewCmdCreate(f))
cmd.AddCommand(NewCmdDelete(f))
return cmd
}