From 0e570d7dcd54a1df770eec3552cfd379d03e1a2b Mon Sep 17 00:00:00 2001 From: Kennan LeJeune Date: Sun, 22 Feb 2026 15:49:40 -0500 Subject: [PATCH] feat: add fnox plugin w/ optional mise integration --- plugins/fnox/README.md | 26 ++++++++++++++++++++++++++ plugins/fnox/fnox.plugin.zsh | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 plugins/fnox/README.md create mode 100644 plugins/fnox/fnox.plugin.zsh diff --git a/plugins/fnox/README.md b/plugins/fnox/README.md new file mode 100644 index 000000000..ce5110e6f --- /dev/null +++ b/plugins/fnox/README.md @@ -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). diff --git a/plugins/fnox/fnox.plugin.zsh b/plugins/fnox/fnox.plugin.zsh new file mode 100644 index 000000000..33f18bf3a --- /dev/null +++ b/plugins/fnox/fnox.plugin.zsh @@ -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" &|