fleet/cmd/fleetctl/fleetctl.go
blaedj be85377326
Add 'get hosts' command to fleetctl (#1977)
This commit:
 - adds a new sub-command for fetching hosts to `fleetctl get` command.

Why?
 - this allows for listing of all hosts via the fleetctl interface.
 There may be additional attributes of the host that we'd like to
 display, but this should be a good start.

Closes #1962
2019-01-03 16:19:23 -06:00

56 lines
1007 B
Go

package main
import (
"math/rand"
"time"
"github.com/kolide/kit/version"
"github.com/urfave/cli"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func main() {
app := cli.NewApp()
app.Name = "fleetctl"
app.Usage = "CLI for operating Kolide Fleet"
app.Version = version.Version().Version
cli.VersionPrinter = func(c *cli.Context) {
version.PrintFull()
}
app.Commands = []cli.Command{
applyCommand(),
deleteCommand(),
setupCommand(),
loginCommand(),
logoutCommand(),
queryCommand(),
cli.Command{
Name: "get",
Usage: "Get/list resources",
Subcommands: []cli.Command{
getQueriesCommand(),
getPacksCommand(),
getLabelsCommand(),
getOptionsCommand(),
getHostsCommand(),
getEnrollSecretCommand(),
},
},
cli.Command{
Name: "config",
Usage: "Modify how and which Fleet server to connect to",
Subcommands: []cli.Command{
configSetCommand(),
configGetCommand(),
},
},
convertCommand(),
}
app.RunAndExitOnError()
}