Diff
1diff --git a/plugins/ngrok/README.md b/plugins/ngrok/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..6c37b190563a88e7e374341a71e901c99270bc99
4--- /dev/null
5+++ b/plugins/ngrok/README.md
6@@ -0,0 +1,20 @@
7+# ngrok plugin
8+
9+This plugin adds completion for the [ngrok](https://ngrok.com) CLI.
10+
11+To use it, add `ngrok` to the plugins array in your zshrc file:
12+
13+```zsh
14+plugins=(... ngrok)
15+```
16+
17+This plugin does not add any aliases.
18+
19+## Cache
20+
21+This plugin caches the completion script and is automatically updated asynchronously when the plugin is
22+loaded, which is usually when you start up a new terminal emulator.
23+
24+The cache is stored at:
25+
26+- `$ZSH_CACHE/completions/_ngrok` completions script
27diff --git a/plugins/ngrok/ngrok.plugin.zsh b/plugins/ngrok/ngrok.plugin.zsh
28new file mode 100644
29index 0000000000000000000000000000000000000000..ca3c82db0fb526a2321bf227ecccb92ab51ba34d
30--- /dev/null
31+++ b/plugins/ngrok/ngrok.plugin.zsh
32@@ -0,0 +1,14 @@
33+# Autocompletion for ngrok
34+if (( ! $+commands[ngrok] )); then
35+ return
36+fi
37+
38+# If the completion file doesn't exist yet, we need to autoload it and
39+# bind it to `ngrok`. Otherwise, compinit will have already done that.
40+if [[ ! -f "$ZSH_CACHE_DIR/completions/_ngrok" ]]; then
41+ typeset -g -A _comps
42+ autoload -Uz _ngrok
43+ _comps[ngrok]=_ngrok
44+fi
45+
46+ngrok completion zsh >| "$ZSH_CACHE_DIR/completions/_ngrok" &|