huhtree

command module
v0.0.0-...-ea8472d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: Unlicense Imports: 6 Imported by: 0

README

huhtree

Combining cobra and huh for the ultimate CLI experience.

Thirty Second Demo

asciicast

Usage

Building

With Go installed, run the following command to compile the CLI and setup autocompletion.

# For bash
$ go build -o huhtree main.go && ./huhtree completion bash > /tmp/completion && source /tmp/completion

# For zsh
$ go build -o huhtree main.go && ./huhtree completion zsh > /tmp/completion && source /tmp/completion
Running

Once it's compiled, you can run the binary:

$ ./huhtree

Doing so with no arguments will ask you which command you wish to run from a list of options.

If you want to see the normal help command, you can still run:

$ ./huhtree -h
Command Autocomplete

The goal of this demo is to demonstrate how discoverable a CLI's different commands can be.

From the root command, there are three ways to discover the commands, with two being runnable:

  1. Output the help info of the root command.
  2. Run the root command with no arguments to choose from a list of subcommands.
  3. Hit after the CLI name to view and select from a list of subcommands.

When running a subcommand, there are again three ways to discover the options, with two bring runnable:

  1. Output the help info for the subcommands.
  2. Run the subcommand with no arguments to be prompted to fill out a "form" for each required argument.
  3. Hit after the subcommand's name in the CLI to view and select from a list of suggested arguments.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL