### Install gopass from source Source: https://github.com/gopasspw/gopass/blob/master/README.md Install the latest development version of gopass using `go install`. Note that `latest` is not a stable release; released versions are recommended. ```shell go install github.com/gopasspw/gopass@latest ``` -------------------------------- ### Install gopass on Gentoo Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Install gopass on Gentoo using the go-overlay and emerge. ```bash layman -a go-overlay emerge -av gopass ``` -------------------------------- ### Example: Copy file and view content Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/fscopy.md This example demonstrates copying a file into the password store and then viewing its content using the `cat` command. ```bash $ gopass fscopy ~/test/file data/test/file-entry $ gopass cat data/test/file-entry ``` -------------------------------- ### Setup Gopass with Age Backend using Wizard Source: https://github.com/gopasspw/gopass/blob/master/docs/backends/age.md Use the setup wizard to create a new age keypair and initialize the gopass store with the age crypto backend. ```bash $ gopass setup --crypto age ``` -------------------------------- ### Install gopass on Windows with winget Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Install gopass on Windows using the winget package manager. ```powershell winget install gopass.gopass ``` -------------------------------- ### Install gopass on FreeBSD/OpenBSD Source: https://github.com/gopasspw/gopass/blob/master/README.md Install gopass from the ports collection on FreeBSD or OpenBSD. ```shell cd /usr/ports/security/gopass make install ``` -------------------------------- ### Install gopass on OpenBSD Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs gopass using the pkg_add command for OpenBSD -current. For older versions, use 'go install'. ```shell pkg_add gopass ``` -------------------------------- ### Install gopass dependencies on macOS Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs gnupg2 and git using Homebrew. Ensure Homebrew is installed before running this command. ```bash brew install gnupg2 git ``` -------------------------------- ### Install gopass via dpkg Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Manually install the gopass .deb package after downloading it from the releases page. ```bash wget [the URL of the latest .deb release] sudo dpkg -i gopass-1.2.0-linux-amd64.deb ``` -------------------------------- ### Install gopass with Homebrew Source: https://github.com/gopasspw/gopass/blob/master/README.md Use Homebrew to install gopass on Linux or macOS. Ensure Homebrew is installed first. ```shell brew install gopass ``` -------------------------------- ### Install gopass on Windows with Scoop Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Install gopass on Windows using the Scoop package manager. ```powershell scoop install gopass ``` -------------------------------- ### Install gopass dependencies on Windows with Scoop Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs git and gpg4win using the Scoop package manager. Ensure Scoop and the 'extras' bucket are set up. ```powershell scoop install git # add Extras bucket, if you haven't already # scoop bucket add extras scoop install gpg4win ``` -------------------------------- ### Password Template Examples Source: https://github.com/gopasspw/gopass/blob/master/docs/features.md Provides examples of Go template syntax for generating dynamic content within password templates. These templates can reference existing secrets or compute hashes. ```text # Insert the password of an arbitrary secret Password-value of existing entry: {{ getpw "foo" }} # Insert the full body of another secret Content of the new entry: {{ .Content }} # MD5 hash (hex) Md5sum of the new password: {{ .Content | md5sum }} # SHA1 hash (hex) Sha1sum of the new password: {{ .Content | sha1sum }} # MD5Crypt (hex) Md5crypt of the new password: {{ .Content | md5crypt }} # Salted-SHA1 SSHA of the new password: {{ .Content | ssha }} # Salted-SHA256 SSHA256 of the new password: {{ .Content | ssha256 }} # Salted-SHA512 SSHA512 of the new password: {{ .Content | ssha512 }} # Argon2i Argon2i of the new password: {{ .Content | argon2i }} # Argon2id Argon2id of the new password: {{ .Content | argon2id }} # Bcrypt Bcrypt of the new password: {{ .Content | bcrypt }} ``` -------------------------------- ### Install gopass dependencies on Windows with Winget Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs Git and Gpg4win using the Windows Package Manager (winget). ```powershell winget install Git.Git winget install GnuPG.Gpg4win ``` -------------------------------- ### Install gopass on Windows using package managers Source: https://github.com/gopasspw/gopass/blob/master/README.md Install gopass on Windows using WinGet, Chocolatey, or Scoop. GnuPG is also recommended. ```shell # WinGet winget install Git.Git winget install GnuPG.Gpg4win winget install gopass.gopass # Chocolatey choco install gpg4win choco install gopass # Alternatively scoop install gopass ``` -------------------------------- ### Install gopass with MacPorts Source: https://github.com/gopasspw/gopass/blob/master/README.md Use MacPorts to install gopass on macOS. Ensure MacPorts is installed first. ```shell sudo port install gopass ``` -------------------------------- ### Convert Store to Filesystem with Plain Encryption Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/convert.md This example demonstrates converting a substore to the plain filesystem storage backend without moving the original substore. This is useful for testing or simple migrations. ```bash $ gopass convert --store=bar --move=false --storage=fs --crypto=plain ``` -------------------------------- ### Install gopass dependencies on Windows with Chocolatey Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs git and gpg4win using the Chocolatey package manager. Ensure Chocolatey is installed and configured. ```powershell choco install git choco install gpg4win ``` -------------------------------- ### Initialize gpgcli Backend Source: https://github.com/gopasspw/gopass/blob/master/docs/backends/gpg.md Initialize a new gopass store using the gpgcli crypto backend and add a recipient. Ensure GPG is installed and a keyring is initialized. ```bash gopass init --crypto gpgcli gopass recipients add 0xDEADBEEF ``` -------------------------------- ### Install gopass on Arch Linux Source: https://github.com/gopasspw/gopass/blob/master/README.md Install gopass from the Arch Linux extra repository using pacman. ```shell pacman -S gopass ``` -------------------------------- ### Install gopass on FreeBSD Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs gopass using the pkg command for FreeBSD 11 and newer. ```shell pkg install gopass ``` -------------------------------- ### Gopass Command Structure and Examples Source: https://github.com/gopasspw/gopass/blob/master/README.md Provides an overview of the gopass command structure and demonstrates various common commands including finding entries, listing mounts and recipients, syncing, and setting up a store. ```shell # Command structure gopass [] [options] [args] # Shortcut for gopass show [] gopass [] # Enter the gopass REPL gopass # Find all entries matching the search string gopass find github # List your store gopass ls # List all mounts gopass mounts # List all recipients gopass recipients # Sync with all remotes gopass sync # Setup a new store gopass setup ``` -------------------------------- ### Install gopass dependencies on Arch Linux Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs gnupg2, git, and rng-tools using pacman. This command updates the package database and installs the specified packages. ```bash pacman -S gnupg2 git rng-tools ``` -------------------------------- ### Install gopass on Windows with Chocolatey Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Install gopass on Windows using the Chocolatey package manager. ```powershell choco install gopass ``` -------------------------------- ### Install gopass on Fedora/RedHat/CentOS Source: https://github.com/gopasspw/gopass/blob/master/README.md Install gopass using dnf. You may need to enable the COPR repository first. ```shell dnf install gopass ``` -------------------------------- ### Install gopass on Alpine Linux Source: https://github.com/gopasspw/gopass/blob/master/README.md Install gopass on Alpine Linux using the apk package manager. ```shell apk add gopass ``` -------------------------------- ### Install and Configure age-plugin-yubikey Source: https://github.com/gopasspw/gopass/blob/master/docs/backends/age.md Install the age-plugin-yubikey and configure it to use a YubiKey for age encryption. This involves setting up a PIV slot and obtaining identity and recipient information. ```bash $ cargo install age-plugin-yubikey $ age-plugin-yubikey -i $ age-plugin-yubikey ✨ Let's get your YubiKey set up for age! ✨ $ age-plugin-yubikey -i ``` -------------------------------- ### Install gopass dependencies on Ubuntu/Debian Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs git, gnupg, and rng-tools using apt-get. Ensure your package list is updated first. ```bash apt-get update apt-get install git gnupg rng-tools ``` -------------------------------- ### Setup isolated GPG development environment Source: https://github.com/gopasspw/gopass/blob/master/docs/hacking.md Configure environment variables for GPG-based isolated development. Ensure the correct GPG keyring is used and generate a new key if necessary. Build the project and set up the password store. ```bash $ export GOPASS_DEBUG_LOG=/tmp/gp1.log $ export GOPASS_HOMEDIR=/tmp/gp1 $ mkdir -p $GOPASS_HOMEDIR $ export GNUPGHOME=$GOPASS_HOMEDIR/.gnupg # Make sure that you're using the correct keyring. $ gpg -K gpg: directory '/tmp/gp1/.gnupg' created gpg: keybox '/tmp/gp1/.gnupg/pubring.kbx' created gpg: /tmp/gp1/.gnupg/trustdb.gpg: trustdb created $ gpg --gen-key $ go build && ./gopass setup --crypto gpg --storage gitfs ``` -------------------------------- ### Display all gopass configuration values Source: https://github.com/gopasspw/gopass/blob/master/docs/config.md Use this command to view all current gopass configuration settings. This is useful for understanding the current state of your gopass setup. ```bash gopass config ``` -------------------------------- ### Setup New Git Password Store Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Use this command to initialize a new gopass store with gitfs storage. You will be prompted to provide an existing, empty git remote URL. ```bash $ gopass setup --crypto gpg --storage gitfs # used by default [...] # provide an existing, empty git remote, e.g. git@gitlab.example.org:john/passwords.git ``` -------------------------------- ### Setup Password Store with Google Drive Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Configure gopass to use the filesystem storage, move the store to a Google Drive directory, and update the configuration to point to the new path. ```bash gopass setup --storage fs mv .password-store/ "Google Drive/Password-Store" gopass config mounts.path "~/Google Drive/Password-Store" ``` -------------------------------- ### Install gopass dependencies on RHEL/CentOS Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs gnupg2, git, and rng-tools using yum. Ensure your system is up-to-date. ```bash yum install gnupg2 git rng-tools ``` -------------------------------- ### Add gopass repository and install on Debian-based systems Source: https://github.com/gopasspw/gopass/blob/master/README.md Add the official gopass APT repository and install gopass and its keyring on Debian, Ubuntu, and Raspbian. Avoid using the default repository version. ```shell curl https://packages.gopass.pw/repos/gopass/gopass-archive-keyring.gpg | sudo tee /usr/share/keyrings/gopass-archive-keyring.gpg >/dev/null cat << EOF | sudo tee /etc/apt/sources.list.d/gopass.sources Types: deb URIs: https://packages.gopass.pw/repos/gopass Suites: stable Architectures: all amd64 arm64 armhf Components: main Signed-By: /usr/share/keyrings/gopass-archive-keyring.gpg EOF sudo apt update sudo apt install gopass gopass-archive-keyring ``` -------------------------------- ### Setup isolated age development environment Source: https://github.com/gopasspw/gopass/blob/master/docs/hacking.md Configure environment variables for an age-based isolated development environment. Build the project and set up the password store using age for cryptography. ```bash $ export GOPASS_DEBUG_LOG=/tmp/gp1.log $ export GOPASS_HOMEDIR=/tmp/gp1 $ mkdir -p $GOPASS_HOMEDIR $ go build && ./gopass setup --crypto age --storage gitfs ``` -------------------------------- ### Install gopass on Red Hat / CentOS Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Install gopass on Red Hat or CentOS using dnf or yum with the daftaupe/gopass copr repository. ```bash # if you're using dnf (needs dnf-plugins-core) dnf copr enable daftaupe/gopass dnf install gopass # of if you're using an older distribution (needs yum-plugin-copr) yum copr enable daftaupe/gopass yum install gopass ``` -------------------------------- ### Systemd / D-Bus Activation Files Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-11-secret-service.md These files are installed by the 'gopass secret-service install' command and are used for D-Bus session activation and systemd user unit management. ```tree contrib/secret-service/ ├── org.freedesktop.secrets.service # D-Bus session activation (ExecStart=gopass secret-service serve) └── gopass-secret-service.service # systemd user unit ``` -------------------------------- ### Secret Service Integration Test Setup Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-11-secret-service.md This Go code snippet demonstrates the setup for integration tests of the secret service. It uses gptest to create a real gopass store and a private D-Bus connection. The test verifies interactions between gopass and the D-Bus secret service API, including secret creation and retrieval. ```go // tests/secret_service_test.go // Uses gptest.NewGUnitTester to set up a real gopass store. // Starts the service on a private D-Bus connection (dbus.SessionBusPrivate). // Uses secret-tool (if available) or direct godbus calls to store/retrieve secrets. // Verifies: // - secret created via D-Bus appears in gopass (gopass show secret-service/default/i) // - secret created via gopass insert is visible via D-Bus GetSecret // - attributes are searched correctly by SearchItems ``` -------------------------------- ### Create or update entry with piped data Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/cat.md This example demonstrates piping data to `gopass cat` to create or update an entry, then showing the stored content including metadata, and finally retrieving the plain content. ```bash $ echo "234" | gopass cat test/new ``` ```bash $ gopass show -f test/new ``` ```bash $ gopass cat test/new ``` -------------------------------- ### Set a gopass configuration option Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/config.md Modify a configuration option by providing its key and the desired value. This example sets `generate.autoclip` to `false`. ```bash gopass config generate.autoclip false ``` -------------------------------- ### Display a specific gopass configuration option Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/config.md To view the value of a specific configuration option, provide its key as an argument. For example, to check the `generate.autoclip` setting. ```bash gopass config generate.autoclip ``` -------------------------------- ### Enable Bash Auto Completion for All Users Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs Bash auto-completion for gopass for all users by writing the completion script to the system's bash-completion directory. Requires root privileges. ```bash gopass completion bash | sudo tee $(pkg-config --variable=completionsdir bash-completion)/gopass ``` -------------------------------- ### Build Tags for Secret Service Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-11-secret-service.md All files within `internal/secretservice/` must start with `//go:build linux`. Action shims in `internal/action/` should use the `_linux.go` / `_other.go` filename convention. ```go //go:build linux ``` -------------------------------- ### Initialize a new substore Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/mounts.md Create a new substore using `gopass init`, specifying a PGP key identifier. A specific local path can be set using the `--path` flag. ```bash gopass init --store mynewsubstore pgpkeyidentitfier ``` -------------------------------- ### Compute SQL statements for PostgreSQL user Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/templates.md Example template to generate SQL statements for creating a new PostgreSQL user with a specified password. It includes setting the login, password, and search path. ```text {{ .Content }} --- sql: | CREATE ROLE {{ .Name }} LOGIN PASSWORD '{{ .Content }}'; GRANT {{ .Name }} TO {{ .Name }}; ALTER USER {{ .Name }} SET search_path = '{{ .Name }}'; ``` -------------------------------- ### Prepare a New Release Source: https://github.com/gopasspw/gopass/blob/master/docs/releases.md Execute the release helper to prepare a new release. Follow the on-screen instructions to release a new minor version. ```bash go run helpers/release/main.go ``` -------------------------------- ### Populate a MySQL configuration using `gopass process` Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/process.md Demonstrates how to use `gopass process` with a template file to populate sensitive information like username and password into a configuration file. The template uses `getval` and `getpw` functions to retrieve credentials. ```bash $ cat /etc/mysql/my.cnf.tpl [client] host=127.0.0.1 port=3306 user={{ getval "server/local/mysql" "username" }} password={{ getpw "server/local/mysql" }} ``` ```bash $ gopass process /etc/mysql/my.cnf.tpl [client] host=127.0.0.1 port=3306 user=admin password=hunter2 ``` -------------------------------- ### Install and Update Goreleaser Source: https://github.com/gopasspw/gopass/blob/master/docs/releases.md Ensure you are using the latest upstream version of goreleaser by updating and installing it. ```bash go get -u github.com/goreleaser/goreleaser cd $GOPATH/src/github.com/goreleaser/goreleaser go install ``` -------------------------------- ### Initialize with crypto and storage options Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/init.md Initializes a new password store, allowing selection of the crypto backend (age or gpg) and storage backend (fs or gitfs). ```bash gopass init --crypto [age|gpg] --storage=[fs|gitfs] ``` -------------------------------- ### Batch Bootstrap Shared Store (Subsequent Members) Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Initialize a new gopass store for another team member by cloning an existing remote repository and mounting it. This command assumes the remote repository is not empty. ```bash # For every other team member initialize a new store and clone the existing remote gopass --yes setup --remote github.com/example/pass.git --alias example --name "Jane Doe" --email "jane.doe@example.com" ``` -------------------------------- ### Initialize New Gopass Store Source: https://github.com/gopasspw/gopass/blob/master/README.md Sets up a new gopass password store, prompting for GPG key selection and Git remote configuration. Defaults to GPG encryption and Git storage. Can be customized with flags like --crypto=age or --storage=fs. ```shell gopass setup __ _ _ _ _ _ ___ ___ /'_ '\ /'_'\ ( '_' ( (_) |( (_) )| (_) )( (_| |\__, \__, '\__ |'\___/'| ,__/''\__,_)(____/(____/ ( )_) | | | \___/' (_) 🌟 Welcome to gopass! 🌟 Initializing a new password store ... 🌟 Configuring your password store ... 🎮 Please select a private key for encrypting secrets: [0] gpg - 0xFEEDBEEF - John Doe Please enter the number of a key (0-12, [q]uit) (q to abort) [0]: 0 ❓ Do you want to add a git remote? [y/N/q]: y Configuring the git remote ... Please enter the git remote for your shared store []: git@gitlab.example.org:john/passwords.git ✅ Configured ``` -------------------------------- ### List existing mounts Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/mounts.md Use this command to view all currently mounted substores. ```bash gopass mounts ``` -------------------------------- ### Install rng-tools on Debian/Ubuntu Source: https://github.com/gopasspw/gopass/blob/master/docs/entropy.md Install the `rng-tools` package on Debian-based systems like Ubuntu to improve entropy generation. ```bash sudo apt-get install rng-tools ``` -------------------------------- ### Start Age Agent in Foreground Source: https://github.com/gopasspw/gopass/blob/master/docs/backends/age.md Manually start the age backend agent in the foreground. This agent caches passphrases for age identities. ```bash $ gopass age agent ``` -------------------------------- ### Prepare a New Release with Previous Version Source: https://github.com/gopasspw/gopass/blob/master/docs/releases.md If the changelog parser is confused, specify both the target version and the previous version to ensure correct parsing. ```bash go run helpers/release/main.go v1.18.2 v1.17.2 ``` -------------------------------- ### Initialize a New gopass Store Source: https://github.com/gopasspw/gopass/blob/master/docs/usecases/team-workflows.md Use `gopass init` to create a new store, either as a root store or a substore. Specify the owner's key ID for initialization. This command sets up the basic structure and registers the owner as the first recipient. ```bash $ gopass init # root store, or $ gopass init --store team-a --path ... # as a substore ``` -------------------------------- ### Install rng-tools on CentOS/Fedora/Red Hat Source: https://github.com/gopasspw/gopass/blob/master/docs/entropy.md Install the `rng-tools` package on Red Hat-based systems like CentOS and Fedora to enhance entropy generation. ```bash sudo yum install rng-tools ``` -------------------------------- ### Specify store for `create` command Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/create.md Initiates the secret creation wizard for a specific store named 'foo'. ```bash gopass create --store=foo ``` -------------------------------- ### Batch Bootstrap Shared Store (First Member) Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Initialize a new shared gopass store and push it to an empty remote git repository. This command creates a new mount point. ```bash # First initialize a new shared store and push it to an empty remote gopass --yes setup --remote github.com/example/pass.git --alias example --create --name "John Doe" --email "john.doe@example.com" ``` -------------------------------- ### Publish Store to Remote Repository Source: https://github.com/gopasspw/gopass/blob/master/docs/usecases/team-workflows.md After initializing a store, add a remote Git repository using `gopass git remote add` and then synchronize the store with the remote using `gopass sync`. This makes the store accessible to other team members. ```bash $ gopass git remote add --store team-a origin git@host:org/team-a.git $ gopass sync --store team-a ``` -------------------------------- ### Example Post-Remove Hook Script Source: https://github.com/gopasspw/gopass/blob/master/docs/hooks.md This is an example shell script that can be used as a post-removal hook. It demonstrates calling gopass internally, which would normally cause reentrancy issues if not handled. ```shell # ~/.config/gopass/hooks/post-rm.sh gopass rm some-other-entry ``` -------------------------------- ### AWS template structure example Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/create.md An example YAML structure for a custom 'AWS' template. It defines the template's priority, name, storage prefix, how the secret name is derived, a welcome message, and a list of attributes with their types, prompts, and validation rules. ```yaml --- priority: 5 name: "AWS" prefix: "aws" name_from: - "org" - "user" welcome: "🧪 Creating AWS credentials" attributes: - name: "org" type: "string" prompt: "Organization" min: 1 - name: "user" type: "string" prompt: "User" min: 1 - name: "password" type: "password" prompt: "Password" charset: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*" min: 10 strict: true - name: "comment" type: "string" prompt: "Comments" ``` -------------------------------- ### Initialize Gopass with Age Backend Source: https://github.com/gopasspw/gopass/blob/master/docs/backends/age.md Initialize a new gopass store using the age crypto backend. This command will prompt for an age secret key if one is not provided. ```bash $ gopass age identities add [AGE-... age1...] $ gopass init --crypto age ``` -------------------------------- ### Initialize and Mount New Sub Store Source: https://github.com/gopasspw/gopass/blob/master/docs/features.md Initializes and mounts a new sub store at a specified path. This is used when setting up a new, separate password store. ```shell gopass init --store mount-point --path /path/to/store ``` -------------------------------- ### Prepare First Release Candidate Source: https://github.com/gopasspw/gopass/blob/master/docs/releases.md Use this command to prepare the first release candidate for a new version. The --dry-run flag can be used for testing the process without making changes. ```bash go run helpers/release/main.go --dry-run v1.19.0-rc.1 ``` ```bash go run helpers/release/main.go v1.19.0-rc.1 ``` -------------------------------- ### String Attribute Example Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/create.md Use this for prompting a single-line text value that is stored as-is. ```yaml - name: "username" type: "string" prompt: "Username" min: 1 max: 64 ``` -------------------------------- ### Template function: `get` Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/process.md Inserts the full secret content for a given secret path. ```go-template {{ get "foo/bar" }} ``` -------------------------------- ### Hostname Attribute Example Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/create.md Use this for prompting a URL, extracting the hostname, and potentially looking up password-change URLs. ```yaml - name: "url" type: "hostname" prompt: "Website URL" min: 1 ``` -------------------------------- ### Display gopass configuration Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/config.md Run `gopass config` without arguments to display all current configuration settings. ```bash gopass config ``` -------------------------------- ### Plain Secret Example Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/show.md A plain secret is stored as is, without key-value capabilities. It is parsed to the same value upon display. ```plaintext this is a plain secret using multiple lines and that's it ``` -------------------------------- ### Clone and Sync for New Team Member Access Source: https://github.com/gopasspw/gopass/blob/master/docs/usecases/team-workflows.md This sequence of commands outlines the process for a new member to join a team. It involves cloning the team's store, syncing public keys, and requesting access from an owner. ```bash # new member $ gopass clone git@host:org/team-a.git team-a # gopass detects the member cannot decrypt yet: # - it imports all recipients' public keys from .public-keys/ # - it exports the member's own public key into .public-keys/ # - it prints: "request access" and pushes the new public key $ gopass sync --store team-a # publishes the member's public key # existing owner $ gopass sync --store team-a # pulls the new public key $ gopass recipients add --store team-a # re-encrypts, grants access # new member $ gopass sync --store team-a # pulls the re-encrypted secrets $ gopass list team-a # can now decrypt ``` -------------------------------- ### gopass secret-service CLI Commands Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-11-secret-service.md Defines the available commands for the `gopass secret-service` subcommand, including `serve`, `install`, `uninstall`, and `status`. ```go gopass secret-service serve [--replace] [--prefix=secret-service] [--notify-on-access] gopass secret-service install # installs systemd unit + D-Bus activation file gopass secret-service uninstall # removes systemd unit + D-Bus activation file gopass secret-service status # checks whether the service is running ``` -------------------------------- ### Compute salted hash for password Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/templates.md Example template to compute the SSHA256 hash of a password. This is useful for generating secure password hashes. ```text Password: {{ .Content }} SSHA256: {{ .Content | ssha256 }} ``` -------------------------------- ### Initialize Git in Sub Store Source: https://github.com/gopasspw/gopass/blob/master/docs/features.md Initializes a Git repository within a specified sub store, preparing it for version control. ```shell gopass git init --store=foo ``` -------------------------------- ### Multiline Attribute Example Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/create.md Use this for prompting for multi-line text, such as SSH keys or certificates, by opening the user's configured editor. ```yaml - name: "notes" type: "multiline" prompt: "Additional notes" ``` -------------------------------- ### Prepare a New Release with Specific Version Source: https://github.com/gopasspw/gopass/blob/master/docs/releases.md Specify a target version argument to skip a patch level or bump the minor version when preparing a new release. ```bash go run helpers/release/main.go v1.18.2 ``` -------------------------------- ### Run gopass doctor with default checks Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/doctor.md Executes all standard diagnostic checks for your gopass installation. Only failures (warnings and errors) are displayed by default. ```bash $ gopass doctor ``` -------------------------------- ### YAML Secret Structure Source: https://github.com/gopasspw/gopass/blob/master/docs/features.md Illustrates the structure of a secret that includes YAML content. YAML entries must start with '---' after the password and body text. ```yaml secret1234 --- multi: | text more text octal: 0123 date : 2001-01-23 bill-to: &id001 given : Bob family : Doe ship-to: *id001 ``` -------------------------------- ### Safe Hook Execution Sketch Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-7-hook-system-dead-code.md This sketch illustrates a proposed safe method for executing hook commands, avoiding shell parsing. It includes checking for binary existence using exec.LookPath and executing the command with arguments. ```go // safe hook execution — no shell parsing hookBin, err := exec.LookPath(hookConfig.Command[0]) if err != nil { return fmt.Errorf("hook binary %q not found: %w", hookConfig.Command[0], err) } cmd := exec.CommandContext(ctx, hookBin, hookConfig.Command[1:]...) ``` -------------------------------- ### Steam OTP URL format Source: https://github.com/gopasspw/gopass/blob/master/docs/commands/otp.md Example of a Steam OTP URL format. Note the `encoder=steam` parameter and the `digits=5` for Steam's 5-digit codes. ```url otpauth://totp/username%20steam:username?secret=qlt6vmy6svfx4bt4rpmisaiyol6hihca&period=30&digits=5&issuer=username%20steam&encoder=steam ``` -------------------------------- ### Prepare a New Release with Dry Run Source: https://github.com/gopasspw/gopass/blob/master/docs/releases.md Run the release helper in dry-run mode to inspect computed versions and changelog input before writing files or creating a release branch. ```bash go run helpers/release/main.go --dry-run ``` -------------------------------- ### Show OTP Entry in Git-Passwordstore Source: https://github.com/gopasspw/gopass/blob/master/docs/usecases/secure-otp.md Demonstrates how to display an entry from your Git-Passwordstore, which includes password, login, URL, and OTP token. ```bash gopass show git-passwordstore/website/yourLogin ``` -------------------------------- ### Using gopass Public API Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-11-secret-service.md Prefer using the public Go API `pkg/gopass/api.New(ctx)` over executing `gopass` commands via `exec.Command`. The public API is stable and used by existing integrations. ```go pkg/gopass/api.New(ctx) ``` ```go exec.Command("gopass", ...) ``` -------------------------------- ### gopass commands.go Entry Point for Secret Service Source: https://github.com/gopasspw/gopass/blob/master/docs/adr/A-11-secret-service.md Defines the `secret-service` subcommand and its subcommands (`serve`, `install`, `uninstall`, `status`) within the gopass CLI structure. ```go { Name: "secret-service", Usage: "Run a D-Bus Secret Service daemon backed by gopass", Description: "Implements the org.freedesktop.secrets D-Bus API so that " + "desktop applications store their secrets in the gopass password store.", Before: s.IsInitialized, Commands: []*cli.Command{ { Name: "serve", Usage: "Start the Secret Service daemon", Action: s.SecretService, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "replace", Usage: "Replace any existing Secret Service provider (e.g. GNOME Keyring)", }, &cli.StringFlag{ Name: "prefix", Usage: "gopass path prefix for secret-service secrets", Value: "secret-service", }, &cli.BoolFlag{ Name: "notify-on-access", Usage: "Send a desktop notification when a secret is read", }, }, }, { Name: "install", Usage: "Install systemd user service and D-Bus activation files", Action: s.SecretServiceInstall, }, { Name: "uninstall", Usage: "Remove systemd user service and D-Bus activation files", Action: s.SecretServiceUninstall, }, { Name: "status", Usage: "Check whether the Secret Service daemon is running", Action: s.SecretServiceStatus, }, }, }, ``` -------------------------------- ### Configure pinentry-mac for GPG on macOS Source: https://github.com/gopasspw/gopass/blob/master/docs/setup.md Installs pinentry-mac via Homebrew and configures gpg-agent to use it. This is necessary if your GPG key has a passphrase and you want to manage it with pinentry-mac. ```bash brew install pinentry-mac PINENTRY=$(which pinentry-mac) echo "pinentry-program ${PINENTRY}" >>~/.gnupg/gpg-agent.conf defaults write org.gpgtools.common UseKeychain NO ```