dcd724d6fc
For now we just have `id` which allows computing a libp2p peer id from an ed25519 public key.
38 lines
1016 B
Go
38 lines
1016 B
Go
// Package cmd provides cli commands for running a Data Mesher server or performing admin functions.
|
|
package cmd
|
|
|
|
import (
|
|
"git.clan.lol/clan/data-mesher/cmd/certificate"
|
|
"git.clan.lol/clan/data-mesher/cmd/file"
|
|
"git.clan.lol/clan/data-mesher/cmd/generate"
|
|
"git.clan.lol/clan/data-mesher/cmd/peer"
|
|
"git.clan.lol/clan/data-mesher/cmd/server"
|
|
"git.clan.lol/clan/data-mesher/pkg/build"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// NewRoot initializes and returns the root command for the CLI, including subcommands for server and network
|
|
// operations.
|
|
func NewRoot() *cobra.Command {
|
|
// create out root command
|
|
cmd := &cobra.Command{
|
|
Use: build.Name,
|
|
Short: "Data Mesher",
|
|
Version: build.Version,
|
|
}
|
|
|
|
// update version template
|
|
cmd.SetVersionTemplate("data-mesher {{.Version}}")
|
|
|
|
// add subcommands
|
|
cmd.AddCommand(generate.NewCmd())
|
|
cmd.AddCommand(certificate.NewCmd())
|
|
cmd.AddCommand(file.NewCmd())
|
|
cmd.AddCommand(server.NewCmd())
|
|
cmd.AddCommand(peer.NewCmd())
|
|
|
|
cmd.SilenceUsage = true
|
|
|
|
return cmd
|
|
}
|