A mise environment plugin that resolves 1Password CLI secret references into environment variables.
The op CLI must already be installed and authenticated.
GitHub:
[plugins]
1password-env = "https://github.com/kujenga/mise-env-1password"Local path (development):
[plugins]
1password-env = "file:/path/to/mise-env-1password"Create an env template containing op:// references (default: .env.op):
DATABASE_URL=op://Vault/Database/password
API_TOKEN=op://Vault/Service/api-tokenConfigure the plugin in mise.toml:
[env]
_.1password-env = { env_file = ".env.op", tools = true }env_file(string): Env template file. Default:.env.op.env_files(array): Multiple env template files, in order. Later files override earlier ones.vars(table): Explicit key/value map. Values that start withop://are resolved withop read.op_bin(string): Path to theopbinary. Default:op.cache(bool): Enable cacheable output forenv_cache. Default:true.require_env_file(bool): Error when a configured env file is missing. Default:false.tools(bool): Include mise-managed tools on PATH for this hook. Default:false.
[env]
_.1password-env = {
vars = {
DATABASE_URL = "op://Vault/Database/password"
STATIC_VALUE = "literal"
}
}[env]
_.1password-env = { env_files = [".env.op", ".env.local.op"] }- The plugin uses
op inject --in-fileto resolve env templates andop readfor explicit vars. - Secrets are resolved in memory and not written to disk by the plugin.
- For better performance, enable
env_cachein your mise settings.
This project is inspired by the mise-env-fnox plugin and follows the same env hook pattern for a different secrets backend.
MIT