Skip to content

Commit ba4a16f

Browse files
authored
Merge pull request #608 from 1Password/docs/scoot/add-docs-for-symlinks
appending advanced configuration to readme
2 parents 17d2904 + af29650 commit ba4a16f

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,54 @@ Still not sure where or how to begin? We're happy to help! You can:
6363
- Book a free [pairing session](https://calendly.com/d/grs-x2h-pmb/1password-shell-plugins-pairing-session) with one of our developers
6464
- Join the [Developer Slack workspace](https://developer.1password.com/joinslack), and ask us any questions there
6565

66+
## Advanced Configuration
67+
### Managing shell plugins in your own dotfiles
68+
69+
By default, `op plugin init` writes its configuration to `~/.config/op/plugins.sh`
70+
and manages that file for you. If you'd rather keep your plugin configuration in
71+
your own dotfiles (for example, tracked in version control), you can define the
72+
shell functions yourself and source them in your shell's configuration file.
73+
74+
### Step 1: Define the plugin functions
75+
Shell functions for each shell should follow this pattern. In this case,
76+
77+
### bash / zsh
78+
79+
```bash
80+
gh() {
81+
op plugin run -- gh "$@"
82+
}
83+
```
84+
85+
### fish
86+
87+
```fish
88+
function gh --wraps gh --description "1Password shell plugin for GitHub CLI"
89+
op plugin run -- gh $argv
90+
end
91+
```
92+
93+
### Step 2: Tell `op` your plugins are already configured
94+
95+
Set `OP_PLUGIN_ALIASES_SOURCED=1` so 1Password CLI knows the shell plugins have
96+
already been set up:
97+
98+
### bash / zsh
99+
100+
```bash
101+
export OP_PLUGIN_ALIASES_SOURCED="1"
102+
```
103+
104+
### fish
105+
```fish
106+
set -x OP_PLUGIN_ALIASES_SOURCED 1
107+
```
108+
109+
> **Note:** `op plugin init <plugin>` edits `~/.config/op/plugins.sh` directly and won't update your own dotfiles, so configure plugins manually as shown above.
110+
111+
66112
## 💙 Community & Support
67113

68114
- File an [issue](https://github.com/1Password/shell-plugins/issues/new/choose) for bugs and feature requests
69115
- Join the [Developer Slack workspace](https://developer.1password.com/joinslack)
70-
- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/)
116+
- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/)

0 commit comments

Comments
 (0)