Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add a README #26

Merged
merged 26 commits into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7ef3ddc
Add a README
SimonBarendse Mar 26, 2019
bc9f725
Rephrase server => API in the readme
SimonBarendse Mar 27, 2019
2ee0750
Update issue number of package manager distribution issue
SimonBarendse Mar 27, 2019
cffa43b
Add make commands to build and install from source
SimonBarendse Mar 27, 2019
4495196
Add more complete installation instructions
SimonBarendse Mar 27, 2019
1df55e3
Add instructions on installing auto-completion
SimonBarendse Mar 27, 2019
94552c9
Rephrase reference docs line
SimonBarendse Mar 27, 2019
b7e9f0c
Rename Usage header to Getting started
SimonBarendse Mar 27, 2019
62d30a5
Add ticks around PATH
SimonBarendse Mar 27, 2019
f6ff70f
Adapt installation headers
SimonBarendse Mar 27, 2019
dd27a15
Add make build and explain go install requirements
SimonBarendse Mar 27, 2019
723befd
Add test under development
SimonBarendse Mar 27, 2019
1d7066c
Add a getting help section to the readme
SimonBarendse Mar 27, 2019
ac88f28
Add uninstalling instructions
SimonBarendse Mar 27, 2019
ab2ef31
Move verification of the installation to its own section
SimonBarendse Mar 27, 2019
02b9151
Add a table of contents
SimonBarendse Mar 27, 2019
7a7f9b9
Swap discord URL with an invite URL
SimonBarendse Mar 27, 2019
662cdb5
Add a Discord badge
SimonBarendse Mar 27, 2019
407a5c9
Revert "Add a table of contents"
SimonBarendse Mar 27, 2019
5b2e2fa
Update the discord URL to one where you're invited by SecretHub
SimonBarendse Mar 27, 2019
a9705a0
Rephrase the getting help sentence
SimonBarendse Mar 27, 2019
820a821
Only name linux and macos in uninstall instructions
SimonBarendse Mar 27, 2019
ab293b0
Add ticks around the PATH
SimonBarendse Mar 27, 2019
72431a9
Use ticks around the secrethub directory name
SimonBarendse Mar 27, 2019
25d17cb
Rephrase install in the GOBIN directory
SimonBarendse Mar 27, 2019
c62f415
Use the new standard of the readme header
SimonBarendse Mar 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ format-tools:

lint-tools:
@curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.15.0

COMMIT=`git rev-parse --short HEAD`
VERSION=`git describe --always`
BUILD_FLAGS=-ldflags "-s -w -X main.commit=${COMMIT} -X main.version=${VERSION}" -tags=production

build:
go build ${BUILD_FLAGS} ./cmd/secrethub

install:
go install ${BUILD_FLAGS} ./cmd/secrethub
126 changes: 124 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,124 @@
# secrethub-cli
Command-line interface for SecretHub
<p align="center">
<img src="https://secrethub.io/img/secrethub-logo.svg" alt="SecretHub" width="400px"/>
</p>
<h2 align="center">
<i>CLI</i>
</h2>

[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)][godoc]
[![Travis CI](https://travis-ci.org/secrethub/secrethub-cli.svg?branch=master)][travis-ci]
[![GolangCI](https://golangci.com/badges/github.com/secrethub/secrethub-cli.svg)][golang-ci]
[![Go Report Card](https://goreportcard.com/badge/github.com/secrethub/secrethub-cli)][goreportcard]
[![Discord](https://img.shields.io/badge/discord-SecretHub-7289da.svg?logo=discord)][discord]

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

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

SimonBarendse marked this conversation as resolved.
Show resolved Hide resolved
## 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][releases].

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

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

Ensure it is accessible through the `PATH` environment variable.
```sh
export PATH=$PATH:/usr/local/secrethub
```

### Build from source

To build from source, [GoLang](https://golang.org) is required.

To install the binary in the [GOBIN](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable) directory, run:
```sh
make install
```

Alternatively, to build the binary in the current directory, run:
```sh
make build
```

Now you can move it into the `PATH` to use it from any directory:
```sh
mv ./secrethub /usr/local/bin/
```

### Use a package manager

We plan to distribute secrethub via package managers ([#27](https://github.com/secrethub/secrethub-cli/issues/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:
```sh
secrethub --version
```

## Install auto-completion

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

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

## Getting started

Checkout the [getting started docs](https://secrethub.io/docs/getting-started/).
Or have a look at the [reference docs](https://secrethub.io/docs/reference/) 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](./CONTRIBUTING.md).

### 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
SimonBarendse marked this conversation as resolved.
Show resolved Hide resolved

SimonBarendse marked this conversation as resolved.
Show resolved Hide resolved
## 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][discord] or email us at [[email protected]](mailto:[email protected])

[secrethub]: https://secrethub.io
[releases]: https://github.com/secrethub/secrethub-cli/releases
[godoc]: http://godoc.org/github.com/secrethub/secrethub-cli
[golang-ci]: https://golangci.com/r/github.com/secrethub/secrethub-cli
[goreportcard]: https://goreportcard.com/report/github.com/secrethub/secrethub-cli
[travis-ci]: https://travis-ci.org/secrethub/secrethub-cli
[discord]: https://discord.gg/gyQXAFU