Mise Integration
fnox integrates with mise through the jdx/mise-env-fnox env plugin, allowing you to automatically load secrets into your development environment.
Installation
Add the plugin to your project's mise.toml:
[plugins]
fnox-env = "https://github.com/jdx/mise-env-fnox"
[tools]
fnox = "latest"
[env]
_.fnox-env = { tools = true }> `tools = true` is required so the plugin can access the mise-managed fnox binary. Without it, the plugin runs before mise tools are added to PATH and won't be able to find fnox.
How It Works
When mise activates your environment, the fnox plugin:
- Searches for
fnox.tomlin the current directory and parent directories - Resolves secrets using your configured providers
- Exports the secrets as environment variables
- Watches
fnox.tomlfor changes to invalidate the cache
Configuration Options
| Option | Description | Default |
|---|---|---|
tools | Use mise-managed tools (required if fnox is installed via mise) | false |
profile | fnox profile to use | default |
fnox_bin | Path to fnox binary | fnox |
Examples
[plugins]
fnox-env = "https://github.com/jdx/mise-env-fnox"
[env]
# Use default profile
_.fnox-env = { tools = true }[plugins]
fnox-env = "https://github.com/jdx/mise-env-fnox"
[env]
# Use production profile
_.fnox-env = { tools = true, profile = "production" }[plugins]
fnox-env = "https://github.com/jdx/mise-env-fnox"
[env]
# Custom fnox binary path (tools = true not needed when specifying fnox_bin)
_.fnox-env = { fnox_bin = "/usr/local/bin/fnox" }Environment-Specific Configuration
Combine with mise's environment system for different profiles per environment. Mise uses separate config files for each environment:
mise.toml (default/dev):
[plugins]
fnox-env = "https://github.com/jdx/mise-env-fnox"
[tools]
fnox = "latest"
[env]
_.fnox-env = { tools = true, profile = "dev" }mise.production.toml:
[env]
_.fnox-env = { tools = true, profile = "production" }mise.staging.toml:
[env]
_.fnox-env = { tools = true, profile = "staging" }Then activate different environments:
# Development (default)
mise env
# Production
MISE_ENV=production mise env
# Staging
MISE_ENV=staging mise envCaching
The fnox plugin supports mise's environment caching (when MISE_ENV_CACHE=1). Secrets are:
- Cached encrypted on disk for fast subsequent loads
- Automatically refreshed when
fnox.tomlchanges - Scoped to your shell session for security
To enable caching:
export MISE_ENV_CACHE=1Comparison with Shell Integration
| Feature | Shell Integration | Mise Integration |
|---|---|---|
Automatic loading on cd | Yes | Yes (via mise) |
| Works without mise | Yes | No |
| Caching | No | Yes (with env cache) |
| Task integration | No | Yes |
| Tool version management | No | Yes |
Use shell integration if you want fnox-only secret loading. Use mise integration if you're already using mise for tool/environment management.
Troubleshooting
Secrets not loading
Ensure
fnox.tomlexists in your project:bashls fnox.tomlTest fnox directly:
bashfnox export --format jsonCheck mise is loading the plugin:
bashmise env
Cache not invalidating
If secrets aren't updating after changes to fnox.toml:
# Clear mise's env cache
mise cache clear
# Or use fresh flag
mise exec --fresh-env -- your-commandNext Steps
- Shell Integration - Alternative direct shell integration
- Profiles - Managing multiple environments
- Hierarchical Config - Organizing secrets across directories