diff --git a/.goreleaser.yml b/.goreleaser.yml index c7a36e9..c223bf7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -61,8 +61,12 @@ snapcrafts: Simple tool that allows you to use vault in a way that's not possible from the UI or the command line, like recursive searching, tree and recursive delete. grade: stable - confinement: classic + confinement: strict publish: true + plugs: + personal-files: + read: + - $HOME/.vault-token brews: - github: diff --git a/README.md b/README.md index 8adde81..54752da 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ Usage: vht [command] Available Commands: + completion Generates bash completion scripts delete Delete a path recursively help Help about any command search Search in the secrets data @@ -37,3 +38,25 @@ Flags: Use "vht [command] --help" for more information about a command. ``` + +## Install + +### Pre-compiled binary + +#### manually + +Download the pre-compiled binaries from the [releases](https://github.com/ilijamt/vht/releases) page and copy to the desired location. + +#### macos (homebrew) + +```bash +brew tap ilijamt/tap +brew install vht +``` + +#### snapcraft + +```bash +snap install vht +``` + diff --git a/cmd/vht/cmd/completion.go b/cmd/vht/cmd/completion.go new file mode 100644 index 0000000..afc8638 --- /dev/null +++ b/cmd/vht/cmd/completion.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/spf13/cobra" +) + +// completionCmd represents the completion command +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generates bash completion scripts", + Long: `To load completion run + +. <(vht completion) + +To configure your bash shell to load completions for each session add to your bashrc + +# ~/.bashrc or ~/.profile +. <(vht completion) +`, + Run: func(cmd *cobra.Command, args []string) { + _ = rootCmd.GenBashCompletion(cmd.OutOrStdout()); + }, +} + +func init() { + rootCmd.AddCommand(completionCmd) +}