From 2fdeb0fd42801026afe178a75ce68d0df29de9f7 Mon Sep 17 00:00:00 2001 From: Dominik Schulz Date: Sat, 20 Mar 2021 20:46:09 +0100 Subject: [PATCH] Generate manpage and completion on release (#1860) Shipping pre-generated manpage and completion files simplifies packaging gopass. RELEASE_NOTES=n/a Signed-off-by: Dominik Schulz --- .gitignore | 3 - Makefile | 91 ++--- bash.completion | 11 + docs/usecases/secure-otp/sign-in.puml | 2 +- fish.completion | 287 +++++++++++++++ gopass.1 | 480 ++++++++++++++++++++++++++ helpers/release/main.go | 24 ++ zsh.completion | 340 ++++++++++++++++++ 8 files changed, 1165 insertions(+), 73 deletions(-) create mode 100644 bash.completion create mode 100644 fish.completion create mode 100644 gopass.1 create mode 100644 zsh.completion diff --git a/.gitignore b/.gitignore index 66208bfc7c..388b60ee24 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ gopass -gopass.1 gopass-*-amd64 gopass-full dev.sh @@ -49,8 +48,6 @@ _testmain.go releases/ dist/ -*.completion -gopass_wrapper.sh manifest-*.json # go-fuzz diff --git a/Makefile b/Makefile index fb1ad2aef9..0572c9a05f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ FIRST_GOPATH := $(firstword $(subst :, ,$(GOPATH))) PKGS := $(shell go list ./... | grep -v /tests | grep -v /xcpb | grep -v /gpb) GOFILES_NOVENDOR := $(shell find . -name vendor -prune -o -type f -name '*.go' -not -name '*.pb.go' -print) GOFILES_BUILD := $(shell find . -type f -name '*.go' -not -name '*_test.go') -PROTOFILES := $(shell find . -name vendor -prune -o -type f -name '*.proto' -print) GOPASS_VERSION ?= $(shell cat VERSION) GOPASS_OUTPUT ?= gopass GOPASS_REVISION := $(shell cat COMMIT 2>/dev/null || git rev-parse --short=8 HEAD) @@ -26,30 +25,28 @@ export GO111MODULE=on OK := $(shell tput setaf 6; echo ' [OK]'; tput sgr0;) -all: sysinfo build completion man +all: sysinfo build build: $(GOPASS_OUTPUT) completion: $(BASH_COMPLETION_OUTPUT) $(FISH_COMPLETION_OUTPUT) $(ZSH_COMPLETION_OUTPUT) -travis: sysinfo crosscompile build fulltest codequality completion full -travis-osx: sysinfo build test completion full +travis: sysinfo crosscompile build fulltest codequality completion +travis-osx: sysinfo build test completion travis-windows: sysinfo build test-win completion sysinfo: @echo ">> SYSTEM INFORMATION" - @echo -n " PLATFORM: $(shell uname -a)" + @echo -n " PLATFORM : $(shell uname -a)" @printf '%s\n' '$(OK)' - @echo -n " PWD: : $(shell pwd)" + @echo -n " PWD: : $(shell pwd)" @printf '%s\n' '$(OK)' - @echo -n " GO : $(shell go version)" + @echo -n " GO : $(shell go version)" @printf '%s\n' '$(OK)' - @echo -n " BUILDFLAGS: $(BUILDFLAGS)" + @echo -n " BUILDFLAGS : $(BUILDFLAGS)" @printf '%s\n' '$(OK)' - @echo -n " GIT : $(shell git version)" + @echo -n " GIT : $(shell git version)" @printf '%s\n' '$(OK)' - @echo -n " GPG1 : $(shell which gpg) $(shell gpg --version | head -1)" + @echo -n " GPG : $(shell which gpg) $(shell gpg --version | head -1)" @printf '%s\n' '$(OK)' - @echo -n " GPG2 : $(shell which gpg2) $(shell gpg2 --version | head -1)" - @printf '%s\n' '$(OK)' - @echo -n " GPG-Agent : $(shell which gpg-agent) $(shell gpg-agent --version | head -1)" + @echo -n " GPGAgent : $(shell which gpg-agent) $(shell gpg-agent --version | head -1)" @printf '%s\n' '$(OK)' clean: @@ -82,28 +79,23 @@ install: all install-completion install-man @install -m 0755 $(GOPASS_OUTPUT) $(DESTDIR)$(BINDIR)/gopass @printf '%s\n' '$(OK)' -fulltest: $(GOPASS_OUTPUT) - @echo ">> TEST, \"full-mode\": race detector off, build tags: xc" - @echo "mode: atomic" > coverage-all.out - @$(foreach pkg, $(PKGS),\ - echo -n " ";\ - go test -run '(Test|Example)' $(BUILDFLAGS) $(TESTFLAGS) -coverprofile=coverage.out -covermode=atomic $(pkg) || exit 1;\ - tail -n +2 coverage.out >> coverage-all.out;) - @$(GO) tool cover -html=coverage-all.out -o coverage-all.html +install-completion: + @install -d $(DESTDIR)$(PREFIX)/share/zsh/site-functions $(DESTDIR)$(PREFIX)/share/bash-completion/completions $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d + @install -m 0755 $(ZSH_COMPLETION_OUTPUT) $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_gopass + @install -m 0755 $(BASH_COMPLETION_OUTPUT) $(DESTDIR)$(PREFIX)/share/bash-completion/completions/gopass + @install -m 0755 $(FISH_COMPLETION_OUTPUT) $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/gopass.fish + @printf '%s\n' '$(OK)' -fulltest-nocover: $(GOPASS_OUTPUT) - @echo ">> TEST, \"full-mode-no-coverage\": race detector off, build tags: xc" - @echo "mode: atomic" > coverage-all.out - @$(foreach pkg, $(PKGS),\ - echo -n " ";\ - go test -run '(Test|Example)' $(TESTFLAGS) $(pkg) || exit 1;) +install-man: gopass.1 + @install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man1 + @install -m 0644 gopass.1 $(DESTDIR)$(PREFIX)/share/man/man1/gopass.1 -racetest: $(GOPASS_OUTPUT) - @echo ">> TEST, \"full-mode\": race detector on" +fulltest: $(GOPASS_OUTPUT) + @echo ">> TEST, \"full-mode\": race detector off" @echo "mode: atomic" > coverage-all.out @$(foreach pkg, $(PKGS),\ echo -n " ";\ - go test -run '(Test|Example)' $(BUILDFLAGS) $(TESTFLAGS) -race -coverprofile=coverage.out -covermode=atomic $(pkg) || exit 1;\ + go test -run '(Test|Example)' $(BUILDFLAGS) $(TESTFLAGS) -coverprofile=coverage.out -covermode=atomic $(pkg) || exit 1;\ tail -n +2 coverage.out >> coverage-all.out;) @$(GO) tool cover -html=coverage-all.out -o coverage-all.html @@ -132,22 +124,11 @@ crosscompile: @GOOS=windows GOARCH=amd64 $(GO) build -o $(GOPASS_OUTPUT)-windows-amd64 @printf '%s\n' '$(OK)' -full: - @echo -n ">> COMPILE linux/amd64 xc" - $(GO) build -o $(GOPASS_OUTPUT)-full - %.completion: $(GOPASS_OUTPUT) @printf ">> $* completion, output = $@" @./gopass completion $* > $@ @printf "%s\n" "$(OK)" -install-completion: completion - @install -d $(DESTDIR)$(PREFIX)/share/zsh/site-functions $(DESTDIR)$(PREFIX)/share/bash-completion/completions $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d - @install -m 0755 $(ZSH_COMPLETION_OUTPUT) $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_gopass - @install -m 0755 $(BASH_COMPLETION_OUTPUT) $(DESTDIR)$(PREFIX)/share/bash-completion/completions/gopass - @install -m 0755 $(FISH_COMPLETION_OUTPUT) $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/gopass.fish - @printf '%s\n' '$(OK)' - codequality: @echo ">> CODE QUALITY" @@ -163,11 +144,6 @@ codequality: out=$$(gofmt -s -l -d -e $(gofile) | tee /dev/stderr); if [ -n "$$out" ]; then exit 1; fi;) @printf '%s\n' '$(OK)' - @echo -n " CLANGFMT " - @$(foreach pbfile, $(PROTOFILES),\ - if [ $$(clang-format -output-replacements-xml $(pbfile) | wc -l) -gt 3 ]; then exit 1; fi;) - @printf '%s\n' '$(OK)' - @echo -n " VET " @$(GO) vet ./... @printf '%s\n' '$(OK)' @@ -223,27 +199,8 @@ gen: fmt: @gofmt -s -l -w $(GOFILES_NOVENDOR) @goimports -l -w $(GOFILES_NOVENDOR) - @which clang-format > /dev/null; if [ $$? -eq 0 ]; then \ - clang-format -i $(PROTOFILES); \ - fi @go mod tidy -fuzz-gpg: - mkdir -p workdir/gpg-cli/corpus - go-fuzz-build github.com/gopasspw/gopass/backend/gpg/cli - go-fuzz -bin=cli-fuzz.zip -workdir=workdir/gpg-cli - -check-release-env: -ifndef GITHUB_TOKEN - $(error GITHUB_TOKEN is undefined) -endif - -release: goreleaser - -goreleaser: check-release-env travis clean - @echo ">> RELEASE, goreleaser" - @goreleaser - deps: @go build -v ./... @@ -253,8 +210,4 @@ upgrade: gen fmt man: @go run helpers/man/main.go > gopass.1 -install-man: man - @install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man1 - @install -m 0644 gopass.1 $(DESTDIR)$(PREFIX)/share/man/man1/gopass.1 - .PHONY: clean build completion install sysinfo crosscompile test codequality release goreleaser debsign man diff --git a/bash.completion b/bash.completion new file mode 100644 index 0000000000..a3ea75ef0e --- /dev/null +++ b/bash.completion @@ -0,0 +1,11 @@ +_gopass_bash_autocomplete() { + local cur opts base + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) + local IFS=$'\n' + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + } + +complete -F _gopass_bash_autocomplete gopass diff --git a/docs/usecases/secure-otp/sign-in.puml b/docs/usecases/secure-otp/sign-in.puml index ebf3829ba7..94f563db48 100644 --- a/docs/usecases/secure-otp/sign-in.puml +++ b/docs/usecases/secure-otp/sign-in.puml @@ -28,4 +28,4 @@ User -> Website: enter (otp-code) Website -> Website: validate (otp-code,website-time,otp-token) User <-- Website: success -@enduml \ No newline at end of file +@enduml diff --git a/fish.completion b/fish.completion new file mode 100644 index 0000000000..a4217d8763 --- /dev/null +++ b/fish.completion @@ -0,0 +1,287 @@ +#!/usr/bin/env fish +set PROG 'gopass' + +function __fish_gopass_needs_command + set -l cmd (commandline -opc) + if [ (count $cmd) -eq 1 -a $cmd[1] = $PROG ] + return 0 + end + return 1 +end + +function __fish_gopass_uses_command + set cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + +function __fish_gopass_print_gpg_keys + gpg2 --list-keys | grep uid | sed 's/.*<\(.*\)>/\1/' +end + +function __fish_gopass_print_entries + gopass ls --flat +end + +function __fish_gopass_print_dir + for i in (gopass ls --flat) + echo (dirname $i) + end | sort -u +end + +# erase any existing completions for gopass +complete -c $PROG -e +complete -c $PROG -f -n '__fish_gopass_needs_command' -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -s c -l clip -r -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a alias -d 'Command: Manage domain aliases' +complete -c $PROG -f -n '__fish_gopass_uses_command alias' -a add -d 'Subcommand: Add a new alias' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias add -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias' -a remove -d 'Subcommand: Remove an alias from a domain' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias remove -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias' -a delete -d 'Subcommand: Delete an entire domain' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command alias delete -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a audit -d 'Command: Decrypt all secrets and scan for weak or leaked passwords' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a cat -d 'Command: Print content of a secret to stdout, or insert from stdin' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a clone -d 'Command: Clone a password store from a git repository' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a completion -d 'Command: Bash and ZSH completion' +complete -c $PROG -f -n '__fish_gopass_uses_command completion' -a bash -d 'Subcommand: Source for auto completion in bash' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion bash -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion' -a zsh -d 'Subcommand: Source for auto completion in zsh' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion zsh -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion' -a fish -d 'Subcommand: Source for auto completion in fish' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion fish -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion' -a openbsdksh -d 'Subcommand: Source for auto completion in OpenBSD's ksh' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command completion openbsdksh -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a config -d 'Command: Display and edit the configuration file' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a convert -d 'Command: Convert a store to different backends' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a copy -d 'Command: Copy secrets from one location to another' +complete -c $PROG -f -n '__fish_gopass_uses_command copy' -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a create -d 'Command: Easy creation of new secrets' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a delete -d 'Command: Remove one or many secrets from the store' +complete -c $PROG -f -n '__fish_gopass_uses_command delete' -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a edit -d 'Command: Edit new or existing secrets' +complete -c $PROG -f -n '__fish_gopass_uses_command edit' -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a env -d 'Command: Run a subprocess with a pre-populated environment' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a find -d 'Command: Search for secrets' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a fsck -d 'Command: Check store integrity' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a fscopy -d 'Command: Copy files from or to the password store' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a fsmove -d 'Command: Move files from or to the password store' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a generate -d 'Command: Generate a new password' +complete -c $PROG -f -n '__fish_gopass_uses_command generate' -a "(__fish_gopass_print_dir)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a git -d 'Command: Run a git command inside a password store (init, remote, push, pull)' +complete -c $PROG -f -n '__fish_gopass_uses_command git' -a init -d 'Subcommand: Init git repo' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l store -d "Store to operate on"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l sign-key -d "GPG Key to sign commits"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l name -d "Git Author Name"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l email -d "Git Author Email"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l storage -d "Select storage backend [fs gitfs]"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command git init -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command git' -a remote -d 'Subcommand: Manage git remotes' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command git remote -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command git' -a push -d 'Subcommand: Push to remote' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l store -d "Store to operate on"' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command git push -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command git' -a pull -d 'Subcommand: Pull from remote' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l store -d "Store to operate on"' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command git pull -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command git' -a status -d 'Subcommand: RCS status' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l store -d "Store to operate on"' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command git status -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a grep -d 'Command: Search for secrets files containing search-string when decrypted.' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a history -d 'Command: Show password history' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a init -d 'Command: Initialize new password store.' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a insert -d 'Command: Insert a new secret' +complete -c $PROG -f -n '__fish_gopass_uses_command insert' -a "(__fish_gopass_print_dir)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a list -d 'Command: List existing secrets' +complete -c $PROG -f -n '__fish_gopass_uses_command list' -a "(__fish_gopass_print_dir)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a mounts -d 'Command: Edit mounted stores' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts' -a add -d 'Subcommand: Mount a password store' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts add -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts' -a remove -d 'Subcommand: Umount an mounted password store' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command mounts remove -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a move -d 'Command: Move secrets from one location to another' +complete -c $PROG -f -n '__fish_gopass_uses_command move' -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a otp -d 'Command: Generate time- or hmac-based tokens' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a pwgen -d 'Command: Generate passwords' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a recipients -d 'Command: Edit recipient permissions' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients' -a add -d 'Subcommand: Add any number of Recipients to any store' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l store -d "Store to operate on"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l force -d "Force adding non-existing keys"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients add -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients' -a remove -d 'Subcommand: Remove any number of Recipients from any store' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l store -d "Store to operate on"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l force -d "Force adding non-existing keys"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command recipients remove -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a setup -d 'Command: Initialize a new password store' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a show -d 'Command: Display the content of a secret' +complete -c $PROG -f -n '__fish_gopass_uses_command show' -a "(__fish_gopass_print_entries)" +complete -c $PROG -f -n '__fish_gopass_needs_command' -a sum -d 'Command: Compute the SHA256 checksum' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a sync -d 'Command: Sync all local stores with their remotes' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a templates -d 'Command: Edit templates' +complete -c $PROG -f -n '__fish_gopass_uses_command templates' -a show -d 'Subcommand: Show a secret template.' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates show -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates' -a edit -d 'Subcommand: Edit secret templates.' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates edit -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates' -a remove -d 'Subcommand: Remove secret templates.' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l clip -d "Copy the password value into the clipboard"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l alsoclip -d "Copy the password and show everything"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l qr -d "Print the password as a QR Code"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l unsafe -d "Display unsafe content (e.g. the password) even if safecontent is enabled"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l password -d "Display only the password. Takes precedence over all other flags."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l revision -d "Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l noparsing -d "Do not parse the output."' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l help -d "show help"' +complete -c $PROG -f -n '__fish_gopass_uses_command templates remove -l version -d "print the version"' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a unclip -d 'Command: Internal command to clear clipboard' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a update -d 'Command: Check for updates' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a version -d 'Command: Display version' +complete -c $PROG -f -n '__fish_gopass_needs_command' -a help -d 'Command: Shows a list of commands or help for one command' diff --git a/gopass.1 b/gopass.1 new file mode 100644 index 0000000000..b2818381e7 --- /dev/null +++ b/gopass.1 @@ -0,0 +1,480 @@ + +.TH GOPASS "1" "March 2021" "gopass (github.com/gopasspw/gopass) 1.12.2" "User Commands" +.SH NAME +gopass - The standard Unix password manager +.SH SYNOPSIS +.B gopass +[\fI\,global options\/\fR] \fI\,command\/\fR [\fI\,command options\/\fR] [\fI,arguments\/\fR...] +.SH GLOBAL OPTIONS + +.TP +\fB\-\-alsoclip\fR, +\fB\-\-C\fR, +Copy the password and show everything +.TP +\fB\-\-clip\fR, +\fB\-\-c\fR, +Copy the password value into the clipboard +.TP +\fB\-\-noparsing\fR, +\fB\-\-n\fR, +Do not parse the output. +.TP +\fB\-\-password\fR, +\fB\-\-o\fR, +Display only the password. Takes precedence over all other flags. +.TP +\fB\-\-qr\fR, +Print the password as a QR Code +.TP +\fB\-\-revision\fR, +Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry. +.TP +\fB\-\-unsafe\fR, +\fB\-\-u\fR, +\fB\-\-force\fR, +\fB\-\-f\fR, +Display unsafe content (e.g. the password) even if safecontent is enabled +.SH COMMANDS + +.SS alias +Manage domain aliases + +Manages domain aliases. Note: this command might change or go away. +.SS audit +Decrypt all secrets and scan for weak or leaked passwords + +This command decrypts all secrets and checks for common flaws and (optionally) against a list of previously leaked passwords. +.SS cat +Print content of a secret to stdout, or insert from stdin + +This command is similar to the way cat works on the command line. It can either be used to retrieve the decoded content of a secret similar to 'cat file' or vice versa to encode the content from STDIN to a secret. +.SS clone +Clone a password store from a git repository + +This command clones an existing password store from a git remote to a local password store. Can be either used to initialize a new root store or to add a new mounted sub-store.Needs at least one argument (git URL) to clone from. Accepts a second argument (mount location) to clone and mount a sub-store, e.g. 'gopass clone git@example.com/store.git foo/bar' + +.B Flags +.TP +\fB\-\-crypto\fR, +Select crypto backend [age] +.TP +\fB\-\-path\fR, +Path to clone the repo to +.SS config +Display and edit the configuration file + +This command allows for easy printing and editing of the configuration. Without argument, the entire config is printed. With a single argument, a single key can be printed. With two arguments a setting specified by key can be set to value. +.SS convert +Convert a store to different backends + +Convert a store to a different set of backends + +.B Flags +.TP +\fB\-\-crypto\fR, +Which crypto backend? [age] +.TP +\fB\-\-move\fR, +Replace store? +.TP +\fB\-\-storage\fR, +Which storage backend? [] +.TP +\fB\-\-store\fR, +Specify which store to convert +.SS copy +Copy secrets from one location to another + +This command copies an existing secret in the store to another location. This also works across different sub-stores. If the source is a directory it will automatically copy recursively. In that case, the source directory is re-created at the destination if no trailing slash is found, otherwise the contents are flattened (similar to rsync). + +.B Flags +.TP +\fB\-\-force\fR, +\fB\-\-f\fR, +Force to copy the secret and overwrite existing one +.SS create +Easy creation of new secrets + +This command starts a wizard to aid in creation of new secrets. + +.B Flags +.TP +\fB\-\-store\fR, +\fB\-\-s\fR, +Which store to use +.SS delete +Remove one or many secrets from the store + +This command removes secrets. It can work recursively on folders. Recursing across stores is purposefully not supported. + +.B Flags +.TP +\fB\-\-force\fR, +\fB\-\-f\fR, +Force to delete the secret +.TP +\fB\-\-recursive\fR, +\fB\-\-r\fR, +Recursive delete files and folders +.SS edit +Edit new or existing secrets + +Use this command to insert a new secret or edit an existing one using your $EDITOR. It will attempt to create a secure temporary directory for storing your secret while the editor is accessing it. Please make sure your editor doesn't leak sensitive data to other locations while editing. + +.B Flags +.TP +\fB\-\-create\fR, +\fB\-\-c\fR, +Create a new secret if none found +.TP +\fB\-\-editor\fR, +\fB\-\-e\fR, +Use this editor binary +.SS env +Run a subprocess with a pre-populated environment + +This command runs a sub process with the environment populated from the keys of a secret. +.SS find +Search for secrets + +This command will first attempt a simple pattern match on the name of the secret. If there is an exact match it will be shown directly; if there are multiple matches, a selection will be shown. + +.B Flags +.TP +\fB\-\-clip\fR, +\fB\-\-c\fR, +Copy the password into the clipboard +.TP +\fB\-\-unsafe\fR, +\fB\-\-u\fR, +\fB\-\-force\fR, +\fB\-\-f\fR, +In the case of an exact match, display the password even if safecontent is enabled +.SS fsck +Check store integrity + +Check the integrity of the given sub-store or all stores if none are specified. Will automatically fix all issues found. + +.B Flags +.TP +\fB\-\-decrypt\fR, +Decrypt and reencryt during fsck. +WARNING: This will update the secret content to the latest format. This might be incompatible with other implementations. Use with caution! +.SS fscopy +Copy files from or to the password store + +This command either reads a file from the filesystem and writes the encoded and encrypted version in the store or it decrypts and decodes a secret and writes the result to a file. Either source or destination must be a file and the other one a secret. If you want the source to be securely removed after copying, use 'gopass binary move' +.SS fsmove +Move files from or to the password store + +This command either reads a file from the filesystem and writes the encoded and encrypted version in the store or it decrypts and decodes a secret and writes the result to a file. Either source or destination must be a file and the other one a secret. The source will be wiped from disk or from the store after it has been copied successfully and validated. If you don't want the source to be removed use 'gopass binary copy' +.SS generate +Generate a new password + +Generate a new password of the specified length, optionally with no symbols. Alternatively, a xkcd style password can be generated (https://xkcd.com/936/). Optionally put it on the clipboard and clear clipboard after 45 seconds. Prompt before overwriting existing password unless forced. It will replace only the first line of an existing file with a new password. + +.B Flags +.TP +\fB\-\-clip\fR, +\fB\-\-c\fR, +Copy the generated password to the clipboard +.TP +\fB\-\-edit\fR, +\fB\-\-e\fR, +Open secret for editing after generating a password +.TP +\fB\-\-force\fR, +\fB\-\-f\fR, +Force to overwrite existing password +.TP +\fB\-\-generator\fR, +\fB\-\-g\fR, +Choose a password generator, use one of: cryptic, memorable, xkcd or external. Default: cryptic +.TP +\fB\-\-lang\fR, +\fB\-\-xkcdlang\fR, +\fB\-\-xl\fR, +Language to generate password from, currently de (german) and en (english, default) are supported +.TP +\fB\-\-print\fR, +\fB\-\-p\fR, +Print the generated password to the terminal +.TP +\fB\-\-sep\fR, +\fB\-\-xkcdsep\fR, +\fB\-\-xs\fR, +Word separator for generated passwords. If no separator is specified, the words are combined without spaces/separator and the first character of words is capitalised. +.TP +\fB\-\-strict\fR, +Require strict character class rules +.TP +\fB\-\-symbols\fR, +\fB\-\-s\fR, +Use symbols in the password +.SS git +Run a git command inside a password store (init, remote, push, pull) + +If the password store is a git repository, execute a git command specified by git-command-args.WARNING: Deprecated. Please use gopass sync. +.SS grep +Search for secrets files containing search-string when decrypted. + +This command decrypts all secrets and performs a pattern matching on the content. + +.B Flags +.TP +\fB\-\-regexp\fR, +\fB\-\-r\fR, +Interpret pattern as RE2 regular expression +.SS history +Show password history + +Display the change history for a secret + +.B Flags +.TP +\fB\-\-password\fR, +\fB\-\-p\fR, +Include passwords in output +.SS init +Initialize new password store. + +Initialize new password storage and use gpg-id for encryption. + +.B Flags +.TP +\fB\-\-crypto\fR, +Select crypto backend [age] +.TP +\fB\-\-path\fR, +\fB\-\-p\fR, +Set the sub-store path to operate on +.TP +\fB\-\-storage\fR, +Select storage backend [] +.TP +\fB\-\-store\fR, +\fB\-\-s\fR, +Set the name of the sub-store +.SS insert +Insert a new secret + +Insert a new secret. Optionally, echo the secret back to the console during entry. Or, optionally, the entry may be multiline. Prompt before overwriting existing secret unless forced. + +.B Flags +.TP +\fB\-\-append\fR, +\fB\-\-a\fR, +Append data read from STDIN to existing data +.TP +\fB\-\-echo\fR, +\fB\-\-e\fR, +Display secret while typing +.TP +\fB\-\-force\fR, +\fB\-\-f\fR, +Overwrite any existing secret and do not prompt to confirm recipients +.TP +\fB\-\-multiline\fR, +\fB\-\-m\fR, +Insert using $EDITOR +.SS list +List existing secrets + +This command will list all existing secrets. Provide a folder prefix to list only certain subfolders of the store. + +.B Flags +.TP +\fB\-\-flat\fR, +\fB\-\-f\fR, +Print a flat list +.TP +\fB\-\-folders\fR, +\fB\-\-d\fR, +Print a flat list of folders +.TP +\fB\-\-limit\fR, +\fB\-\-l\fR, +Display no more than this many levels of the tree +.TP +\fB\-\-strip-prefix\fR, +\fB\-\-s\fR, +Strip this prefix from filtered entries +.SS mounts +Edit mounted stores + +This command displays all mounted password stores. It offers several subcommands to create or remove mounts. +.SS move +Move secrets from one location to another + +This command moves a secret from one path to another. This also works across different sub-stores. If the source is a directory, the source directory is re-created at the destination if no trailing slash is found, otherwise the contents are flattened (similar to rsync). + +.B Flags +.TP +\fB\-\-force\fR, +\fB\-\-f\fR, +Force to move the secret and overwrite existing one +.SS otp +Generate time- or hmac-based tokens + +Tries to parse an OTP URL (otpauth://). URL can be TOTP or HOTP. The URL can be provided on its own line or on a key value line with a key named 'totp'. + +.B Flags +.TP +\fB\-\-clip\fR, +\fB\-\-c\fR, +Copy the time-based token into the clipboard +.TP +\fB\-\-password\fR, +\fB\-\-o\fR, +Only display the token +.TP +\fB\-\-qr\fR, +\fB\-\-q\fR, +Write QR code to FILE +.SS pwgen +Generate passwords + +Print any number of password to the console. + +.B Flags +.TP +\fB\-\-ambiguous\fR, +\fB\-\-B\fR, +Do not include characters that could be easily confused with each other, like '1' and 'l' or '0' and 'O' +.TP +\fB\-\-lang\fR, +\fB\-\-xkcdlang\fR, +\fB\-\-xl\fR, +Language to generate password from, currently de (german) and en (english, default) are supported +.TP +\fB\-\-no-capitalize\fR, +\fB\-\-A\fR, +Do not include capital letter in the generated passwords. +.TP +\fB\-\-no-numerals\fR, +\fB\-\-0\fR, +Do not include numerals in the generated passwords. +.TP +\fB\-\-one-per-line\fR, +\fB\-\-1\fR, +Print one password per line +.TP +\fB\-\-sep\fR, +\fB\-\-xkcdsep\fR, +\fB\-\-xs\fR, +Word separator for generated xkcd style password. If no separator is specified, the words are combined without spaces/separator and the first character of words is capitalised. This flag implies -xkcd +.TP +\fB\-\-xkcd\fR, +\fB\-\-x\fR, +Use multiple random english words combined to a password. By default, space is used as separator and all words are lowercase +.SS recipients +Edit recipient permissions + +This command displays all existing recipients for all mounted stores. The subcommands allow adding or removing recipients. +.SS setup +Initialize a new password store + +This command is automatically invoked if gopass is started without any existing password store. This command exists so users can be provided with simple one-command setup instructions. + +.B Flags +.TP +\fB\-\-alias\fR, +Local mount point for the given remote +.TP +\fB\-\-create\fR, +Create a new team (default: false, i.e. join an existing team) +.TP +\fB\-\-crypto\fR, +Select crypto backend [age] +.TP +\fB\-\-email\fR, +EMail for unattended GPG key generation +.TP +\fB\-\-name\fR, +Firstname and Lastname for unattended GPG key generation +.TP +\fB\-\-remote\fR, +URL to a git remote, will attempt to join this team +.TP +\fB\-\-storage\fR, +Select storage backend [] +.SS show +Display the content of a secret + +Show an existing secret and optionally put its first line on the clipboard. If put on the clipboard, it will be cleared after 45 seconds. + +.B Flags +.TP +\fB\-\-alsoclip\fR, +\fB\-\-C\fR, +Copy the password and show everything +.TP +\fB\-\-clip\fR, +\fB\-\-c\fR, +Copy the password value into the clipboard +.TP +\fB\-\-noparsing\fR, +\fB\-\-n\fR, +Do not parse the output. +.TP +\fB\-\-password\fR, +\fB\-\-o\fR, +Display only the password. Takes precedence over all other flags. +.TP +\fB\-\-qr\fR, +Print the password as a QR Code +.TP +\fB\-\-revision\fR, +Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry. +.TP +\fB\-\-unsafe\fR, +\fB\-\-u\fR, +\fB\-\-force\fR, +\fB\-\-f\fR, +Display unsafe content (e.g. the password) even if safecontent is enabled +.SS sum +Compute the SHA256 checksum + +This command decodes an Base64 encoded secret and computes the SHA256 checksum over the decoded data. This is useful to verify the integrity of an inserted secret. +.SS sync +Sync all local stores with their remotes + +Sync all local stores with their git remotes, if any, and check any possibly affected gpg keys. + +.B Flags +.TP +\fB\-\-store\fR, +\fB\-\-s\fR, +Select the store to sync +.SS templates +Edit templates + +List existing templates in the password store and allow for editing and creating them. +.SS unclip +Internal command to clear clipboard + +Clear the clipboard if the content matches the checksum. + +.B Flags +.TP +\fB\-\-force\fR, +Clear clipboard even if checksum mismatches +.TP +\fB\-\-timeout\fR, +Time to wait +.SS update +Check for updates + +This command checks for gopass updates at GitHub and automatically downloads and installs any missing update. +.SS version +Display version + +This command displays version and build time information along with version information of important external commands. Please provide the output when reporting issues. + +.SH "REPORTING BUGS" +Report bugs to +.SH "COPYRIGHT" +Copyright \(co 2021 Gopass Authors +This program is free software; you may redistribute it under the terms of +the MIT license. This program has absolutely no warranty. diff --git a/helpers/release/main.go b/helpers/release/main.go index 70d3f4d125..3dc3f5a1d0 100644 --- a/helpers/release/main.go +++ b/helpers/release/main.go @@ -105,6 +105,18 @@ func main() { } fmt.Println("✅ Updated CHANGELOG.md") time.Sleep(sleep) + // - update shell completions + if err := updateCompletion(); err != nil { + panic(err) + } + fmt.Println("✅ Updated shell completions") + time.Sleep(sleep) + // - update man page + if err := updateManpage(); err != nil { + panic(err) + } + fmt.Println("✅ Updated man page") + time.Sleep(sleep) // - create PR // git checkout -b release/vX.Y.Z @@ -272,6 +284,18 @@ func writeChangelog(prev, next semver.Version) error { return os.Rename("CHANGELOG.new", "CHANGELOG.md") } +func updateCompletion() error { + cmd := exec.Command("make", "completion") + cmd.Stderr = os.Stderr + return cmd.Run() +} + +func updateManpage() error { + cmd := exec.Command("make", "man") + cmd.Stderr = os.Stderr + return cmd.Run() +} + func writeVersion(v semver.Version) error { return os.WriteFile("VERSION", []byte(v.String()+"\n"), 0644) } diff --git a/zsh.completion b/zsh.completion new file mode 100644 index 0000000000..80d6955587 --- /dev/null +++ b/zsh.completion @@ -0,0 +1,340 @@ +#compdef gopass + +_gopass () { + local cmd + if (( CURRENT > 2)); then + cmd=${words[2]} + curcontext="${curcontext%:*:*}:gopass-$cmd" + (( CURRENT-- )) + shift words + case "${cmd}" in + alias) + local -a subcommands + subcommands=( + "add:Add a new alias" + "remove:Remove an alias from a domain" + "delete:Delete an entire domain" + ) + + _describe -t commands "gopass alias" subcommands + + + ;; + audit) + + _describe -t commands "gopass audit" subcommands + + + ;; + cat) + + _describe -t commands "gopass cat" subcommands + + + ;; + clone) + _arguments : "--path[Path to clone the repo to]" "--crypto[Select crypto backend [age gpgcli plain]]" + _describe -t commands "gopass clone" subcommands + + + ;; + completion) + local -a subcommands + subcommands=( + "bash:Source for auto completion in bash" + "zsh:Source for auto completion in zsh" + "fish:Source for auto completion in fish" + "openbsdksh:Source for auto completion in OpenBSD's ksh" + ) + + _describe -t commands "gopass completion" subcommands + + + ;; + config) + + _describe -t commands "gopass config" subcommands + + + ;; + convert) + _arguments : "--store[Specify which store to convert]" "--move[Replace store?]" "--crypto[Which crypto backend? [age gpgcli plain]]" "--storage[Which storage backend? [fs gitfs]]" + _describe -t commands "gopass convert" subcommands + + + ;; + copy|cp) + _arguments : "--force[Force to copy the secret and overwrite existing one]" + _describe -t commands "gopass copy" subcommands + + _gopass_complete_passwords + ;; + create|new) + _arguments : "--store[Which store to use]" + _describe -t commands "gopass create" subcommands + + + ;; + delete|remove|rm) + _arguments : "--recursive[Recursive delete files and folders]" "--force[Force to delete the secret]" + _describe -t commands "gopass delete" subcommands + + _gopass_complete_passwords + ;; + edit|set) + _arguments : "--editor[Use this editor binary]" "--create[Create a new secret if none found]" + _describe -t commands "gopass edit" subcommands + + _gopass_complete_passwords + ;; + env) + + _describe -t commands "gopass env" subcommands + + + ;; + find|search) + _arguments : "--clip[Copy the password into the clipboard]" "--unsafe[In the case of an exact match, display the password even if safecontent is enabled]" + _describe -t commands "gopass find" subcommands + + + ;; + fsck) + _arguments : "--decrypt[Decrypt and reencryt during fsck. +WARNING: This will update the secret content to the latest format. This might be incompatible with other implementations. Use with caution!]" + _describe -t commands "gopass fsck" subcommands + + + ;; + fscopy) + + _describe -t commands "gopass fscopy" subcommands + + + ;; + fsmove) + + _describe -t commands "gopass fsmove" subcommands + + + ;; + generate) + _arguments : "--clip[Copy the generated password to the clipboard]" "--print[Print the generated password to the terminal]" "--force[Force to overwrite existing password]" "--edit[Open secret for editing after generating a password]" "--symbols[Use symbols in the password]" "--generator[Choose a password generator, use one of: cryptic, memorable, xkcd or external. Default: cryptic]" "--strict[Require strict character class rules]" "--sep[Word separator for generated passwords. If no separator is specified, the words are combined without spaces/separator and the first character of words is capitalised.]" "--lang[Language to generate password from, currently de (german) and en (english, default) are supported]" + _describe -t commands "gopass generate" subcommands + _gopass_complete_folders + _gopass_complete_passwords + ;; + git) + local -a subcommands + subcommands=( + "init:Init git repo" + "remote:Manage git remotes" + "push:Push to remote" + "pull:Pull from remote" + "status:RCS status" + ) + + _describe -t commands "gopass git" subcommands + + + ;; + grep) + _arguments : "--regexp[Interpret pattern as RE2 regular expression]" + _describe -t commands "gopass grep" subcommands + + + ;; + history|hist) + _arguments : "--password[Include passwords in output]" + _describe -t commands "gopass history" subcommands + + + ;; + init) + _arguments : "--path[Set the sub-store path to operate on]" "--store[Set the name of the sub-store]" "--crypto[Select crypto backend [age gpgcli plain]]" "--storage[Select storage backend [fs gitfs]]" + _describe -t commands "gopass init" subcommands + + + ;; + insert) + _arguments : "--echo[Display secret while typing]" "--multiline[Insert using $EDITOR]" "--force[Overwrite any existing secret and do not prompt to confirm recipients]" "--append[Append data read from STDIN to existing data]" + _describe -t commands "gopass insert" subcommands + _gopass_complete_folders + _gopass_complete_passwords + ;; + list|ls) + _arguments : "--limit[Display no more than this many levels of the tree]" "--flat[Print a flat list]" "--folders[Print a flat list of folders]" "--strip-prefix[Strip this prefix from filtered entries]" + _describe -t commands "gopass list" subcommands + _gopass_complete_folders + + ;; + mounts) + local -a subcommands + subcommands=( + "add:Mount a password store" + "remove:Umount an mounted password store" + ) + + _describe -t commands "gopass mounts" subcommands + + + ;; + move|mv) + _arguments : "--force[Force to move the secret and overwrite existing one]" + _describe -t commands "gopass move" subcommands + + _gopass_complete_passwords + ;; + otp|totp|hotp) + _arguments : "--clip[Copy the time-based token into the clipboard]" "--qr[Write QR code to FILE]" "--password[Only display the token]" + _describe -t commands "gopass otp" subcommands + + + ;; + pwgen) + _arguments : "--no-numerals[Do not include numerals in the generated passwords.]" "--no-capitalize[Do not include capital letter in the generated passwords.]" "--ambiguous[Do not include characters that could be easily confused with each other, like '1' and 'l' or '0' and 'O']" "--one-per-line[Print one password per line]" "--xkcd[Use multiple random english words combined to a password. By default, space is used as separator and all words are lowercase]" "--sep[Word separator for generated xkcd style password. If no separator is specified, the words are combined without spaces/separator and the first character of words is capitalised. This flag implies -xkcd]" "--lang[Language to generate password from, currently de (german) and en (english, default) are supported]" + _describe -t commands "gopass pwgen" subcommands + + + ;; + recipients) + local -a subcommands + subcommands=( + "add:Add any number of Recipients to any store" + "remove:Remove any number of Recipients from any store" + ) + + _describe -t commands "gopass recipients" subcommands + + + ;; + setup) + _arguments : "--remote[URL to a git remote, will attempt to join this team]" "--alias[Local mount point for the given remote]" "--create[Create a new team (default: false, i.e. join an existing team)]" "--name[Firstname and Lastname for unattended GPG key generation]" "--email[EMail for unattended GPG key generation]" "--crypto[Select crypto backend [age gpgcli plain]]" "--storage[Select storage backend [fs gitfs]]" + _describe -t commands "gopass setup" subcommands + + + ;; + show) + _arguments : "--clip[Copy the password value into the clipboard]" "--alsoclip[Copy the password and show everything]" "--qr[Print the password as a QR Code]" "--unsafe[Display unsafe content (e.g. the password) even if safecontent is enabled]" "--password[Display only the password. Takes precedence over all other flags.]" "--revision[Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry.]" "--noparsing[Do not parse the output.]" + _describe -t commands "gopass show" subcommands + + _gopass_complete_passwords + ;; + sum|sha|sha256) + + _describe -t commands "gopass sum" subcommands + + + ;; + sync) + _arguments : "--store[Select the store to sync]" + _describe -t commands "gopass sync" subcommands + + + ;; + templates) + local -a subcommands + subcommands=( + "show:Show a secret template." + "edit:Edit secret templates." + "remove:Remove secret templates." + ) + + _describe -t commands "gopass templates" subcommands + + + ;; + unclip) + _arguments : "--timeout[Time to wait]" "--force[Clear clipboard even if checksum mismatches]" + _describe -t commands "gopass unclip" subcommands + + + ;; + update) + + _describe -t commands "gopass update" subcommands + + + ;; + version) + + _describe -t commands "gopass version" subcommands + + + ;; + help|h) + + _describe -t commands "gopass help" subcommands + + + ;; + *) + _gopass_complete_passwords + ;; + esac + else + local -a subcommands + subcommands=( + "alias:Manage domain aliases" + "audit:Decrypt all secrets and scan for weak or leaked passwords" + "cat:Print content of a secret to stdout, or insert from stdin" + "clone:Clone a password store from a git repository" + "completion:Bash and ZSH completion" + "config:Display and edit the configuration file" + "convert:Convert a store to different backends" + "copy:Copy secrets from one location to another" + "create:Easy creation of new secrets" + "delete:Remove one or many secrets from the store" + "edit:Edit new or existing secrets" + "env:Run a subprocess with a pre-populated environment" + "find:Search for secrets" + "fsck:Check store integrity" + "fscopy:Copy files from or to the password store" + "fsmove:Move files from or to the password store" + "generate:Generate a new password" + "git:Run a git command inside a password store (init, remote, push, pull)" + "grep:Search for secrets files containing search-string when decrypted." + "history:Show password history" + "init:Initialize new password store." + "insert:Insert a new secret" + "list:List existing secrets" + "mounts:Edit mounted stores" + "move:Move secrets from one location to another" + "otp:Generate time- or hmac-based tokens" + "pwgen:Generate passwords" + "recipients:Edit recipient permissions" + "setup:Initialize a new password store" + "show:Display the content of a secret" + "sum:Compute the SHA256 checksum" + "sync:Sync all local stores with their remotes" + "templates:Edit templates" + "unclip:Internal command to clear clipboard" + "update:Check for updates" + "version:Display version" + "help:Shows a list of commands or help for one command" + ) + _describe -t command 'gopass' subcommands + _arguments : "--clip[Copy the password value into the clipboard]" "--alsoclip[Copy the password and show everything]" "--qr[Print the password as a QR Code]" "--unsafe[Display unsafe content (e.g. the password) even if safecontent is enabled]" "--password[Display only the password. Takes precedence over all other flags.]" "--revision[Show a past revision. Does NOT support RCS specific shortcuts. Use exact revision or -N to select the Nth oldest revision of this entry.]" "--noparsing[Do not parse the output.]" "--help[show help]" "--version[print the version]" + _gopass_complete_passwords + fi +} + +_gopass_complete_keys () { + local IFS=$'\n' + _values 'gpg keys' $(gpg2 --list-secret-keys --with-colons 2> /dev/null | cut -d : -f 10 | sort -u | sed '/^$/d') +} + +_gopass_complete_passwords () { + local IFS=$'\n' + _arguments : \ + "--clip[Copy the first line of the secret into the clipboard]" + _values 'passwords' $(gopass ls --flat) +} + +_gopass_complete_folders () { + local -a folders + folders=("${(@f)$(gopass ls --folders --flat)}") + _describe -t folders "folders" folders -qS / +} + +_gopass