Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit ceb18e6

Browse files
committed
Add documentation for fetch -n option
1 parent 2f6f289 commit ceb18e6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Ensure that you also have the [1Password CLI](1password-cli) available as `op` v
1414

1515
[1password-cli]: https://support.1password.com/command-line-getting-started/
1616

17+
### Automatically fetch keys before using SSH
18+
19+
In bash/zsh, you can define an alias for the `ssh` command which ensures your keys are fetched before connecting to a server, like so:
20+
21+
alias ssh="op-ssh-fetch -n [arguments to 'op signin']; ssh"
22+
1723
## Usage
1824

1925
Note that interactive execution is not supported for any of these scripts, since `op signin` is required for all scripts and itself requires interactive password input.
@@ -35,6 +41,8 @@ Create a new vault item associated with the given host and the current username,
3541

3642
Search for SSH key items in your vault and read them all into temporary storage. Public and private keys will be saved to `/tmp/op-ssh-utils/keys` with appropriate permissions, and an SSH config file will be saved to `/tmp/op-ssh-utils/ssh_config` which can be included from your personal SSH config (usually `~/.ssh/config`) via `Include /tmp/op-ssh-utils`.
3743

44+
- Use `-n` to do nothing if keys already exist. This is useful for shell aliases.
45+
3846
### Remove all local SSH credentials
3947

4048
$ op-ssh-remove

0 commit comments

Comments
 (0)