Skip to content

milpa

milpa itself command-tree

Prints a tree of known commands

Usage

milpa itself command-tree [options] [PREFIX...]

Description

Prints out command names and descriptions, or optionally a nested representation of all properties of commands, serialized as json or yaml. Custom textual representations of commands can be obtained by using the --template option and specifying a go-template to be applied to every command. See chinampa/pkg.Command and milpa/internal/command.Meta for references on the structs available during template rendering.

Examples

# print all known subcommands
milpa itself command-tree

# print a tree of milpa itself sub-commands
milpa itself command-tree itself

# get all commands as a json tree
milpa itself command-tree --output json

# same, but as the yaml representation of this command itself
milpa itself command-tree --output json itself command-tree

# print out all commands, skipping groups
milpa itself command-tree --template '{{ if (not (eq .Command.Meta.Kind "virtual")) }}{{ .Command.FullName }}'$'\n''{{ end }}'

Arguments

Options

Global Options