1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-03-28 18:53:47 +08:00

feat: add fnox plugin w/ optional mise integration

This commit is contained in:
Kennan LeJeune 2026-02-22 15:49:40 -05:00
parent 52d93f18d6
commit 0e570d7dcd
No known key found for this signature in database
2 changed files with 46 additions and 0 deletions

26
plugins/fnox/README.md Normal file
View File

@ -0,0 +1,26 @@
# fnox
Adds integration and shell completions for [fnox](https://github.com/jdx/fnox), a tool for provider-agnostic secret injection.
Supports either standalone activation or `mise` integration if installed.
## Installation
1. *Optional:* [Download & install mise](https://github.com/jdx/mise#installation) by running the following:
```bash
curl https://mise.jdx.dev/install.sh | sh
```
2. [Enable fnox](https://fnox.jdx.dev/guide/quick-start.html) by adding it to your `plugins` definition in `~/.zshrc`.
```bash
# standalone
plugins=(fnox)
# with mise integration
plugins=(mise fnox)
```
## Usage
See the [fnox documentation](https://github.com/jdx/fnox#table-of-contents) for information on how to use `fnox` [standalone](https://fnox.jdx.dev/guide/shell-integration.html) or with [`mise` integration](https://fnox.jdx.dev/guide/mise-integration.html).

View File

@ -0,0 +1,20 @@
if (( ! $+commands[fnox] )); then
# if we don't have fnox at all just bail out
return
fi
if (( ! $+commands[mise] )); then
# if we have fnox but not mise, source its activation directly
eval "$(fnox activate zsh)"
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `mise`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_fnox" ]]; then
typeset -g -A _comps
autoload -Uz _fnox
_comps[fnox]=_fnox
fi
# Generate and load completions
fnox completion zsh >| "$ZSH_CACHE_DIR/completions/_fnox" &|