secrethub-cli

module
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: Apache-2.0

README

SecretHub

CLI

GoDoc Travis CI GolangCI Go Report Card Version Discord

The SecretHub CLI provides the command-line interface to interact with SecretHub.

SecretHub is a developer tool to help you keep database passwords, API tokens, and other secrets out of IT automation scripts.

Installation

Download a binary distribution

Official binary distributions are available for the Linux, macOS, and Windows operating systems for both the 32-bit (386) and 64-bit (amd64) versions. You can find the latest release here.

To install the SecretHub CLI, download the archive file appropriate for your operating system and extract it e.g. to /usr/local/secrethub.

mkdir -p /usr/local/secrethub
tar -C /usr/local/secrethub -xzf secrethub-VERSION-OS-ARCH.tar.gz

Ensure the binary is accessible by symlinking to it from a directory that is on your PATH, e.g. /usr/local/bin:

ln -s /usr/local/secrethub/bin/secrethub /usr/local/bin/secrethub

Alternatively, you can add the folder containing the binary to your PATH environment variable:

export PATH=$PATH:/usr/local/secrethub/bin

Build from source

To build from source, GoLang is required.

To install the binary in the GOBIN directory, run:

make install

Alternatively, to build the binary in the current directory, run:

make build

Now you can move it into the PATH to use it from any directory:

mv ./secrethub /usr/local/bin/

Use a package manager

We plan to distribute secrethub via package managers (#27). Please feel free to join the discussion and let us know what package manager you are using.

Test your installation

Verify your installation works by running the following command:

secrethub --version

Install auto-completion

To install auto completion for the CLI, run one of the following commands depending on your shell of choice:

# Install bash completion
secrethub --completion-script-bash > /etc/bash_completion.d/secrethub
# Install zsh completion
secrethub --completion-script-zsh > ~/.zsh/completion/secrethub

Getting started

Checkout the getting started docs. Or have a look at the reference docs where each command is documented in detail.

Development

Pull requests from the community are welcome. If you'd like to contribute, please checkout the contributing guidelines.

Test

Run all tests:

make test

Run tests for one package:

go test ./internals/secrethub

Run a single test:

go test ./internals/secrethub -run TestWriteCommand_Run

Uninstalling

To remove an existing SecretHub installation from your system delete the secrethub directory. This is usually /usr/local/secrethub under Linux and macOS.

You should also remove the SecretHub directory from your PATH environment variable.

If you've installed auto-completion, you should remove either /etc/bash_completion.d/secrethub or ~/.zsh/completion/secrethub.

Getting help

Come chat with us on Discord or email us at support@secrethub.io

Directories

Path Synopsis
cmd
internals
cli
cli/clip
Package clip provides functionality to read from and write to the clipboard.
Package clip provides functionality to read from and write to the clipboard.
cli/clip/fakeclip
Package fakeclip provides fake implementations of the clip.Clipper interface to be used for testing.
Package fakeclip provides fake implementations of the clip.Clipper interface to be used for testing.
cli/cloneproc
Package cloneproc provides functionality to spawn a detached clone of the current process.
Package cloneproc provides functionality to spawn a detached clone of the current process.
cli/filemode
Package filemode provides a wrapper around os.FileMode so that it can be parsed from a CLI flag.
Package filemode provides a wrapper around os.FileMode so that it can be parsed from a CLI flag.
cli/mlock
Package mlock allows for locking memory, providing implementations for different operating systems.
Package mlock allows for locking memory, providing implementations for different operating systems.
cli/progress
Package progress provides a printer that writes dots at a configured interval.
Package progress provides a printer that writes dots at a configured interval.
cli/progress/fakeprogress
Package fakeprogress provides an implementation of the progress.Printer interface to be used in tests.
Package fakeprogress provides an implementation of the progress.Printer interface to be used in tests.
cli/ui
Package ui provides a simple way to interact with the user through the terminal, i.e.
Package ui provides a simple way to interact with the user through the terminal, i.e.
secrethub
Package secrethub provides the SecretHub CLI application.
Package secrethub provides the SecretHub CLI application.
secretspec
Package secretspec provides functionality to set and clear secrets in environment variables, files and fields in configuration files, based on a specification provided in a secrets.yml file.
Package secretspec provides functionality to set and clear secrets in environment variables, files and fields in configuration files, based on a specification provided in a secrets.yml file.
tpl
Package tpl provides a way to parse a template string and inject secret values into it.
Package tpl provides a way to parse a template string and inject secret values into it.

Jump to

Keyboard shortcuts

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