Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
andrea11
2 months agoNew Contributor
openv โ A simple CLI tool to wrap commands with 1Password secrets from .env
Hey folks, ๐
I just released a new version of a small command-line tool Iโve been working on called openv.
๐ก What it does:
It automatically wraps selected dev commands (like npm dev, pnpm run, etc.) with op run, if your projectโs .env file contains op:// secrets from 1Password.
So instead of manually writing:
run --env-file=.env -- npm run dev
You can just type, as you would normally do:
npm run dev
And it will be wrapped automatically via a shell hook.
๐ง Why I built it:
This started as a personal tool because I kept forgetting to wrap my dev commands with op run, and I wanted a smoother experience that "just works" based on .env contents.
It hooks into ZSH (likely direnv), with support for allow/deny patterns (e.g., only wrap certain commands like pnpm start).
๐ ๏ธ Tech:
Written in Rust
Works in ZSH, Bash, and Fish
Installable via Homebrew
Fully local
๐งช Notes:
This is an early release, mainly developed for my personal use. Iโm sharing it here in case others find it useful. Feedback, issues, or even feature ideas are very welcome โ but no pressure!
GitHub: https://github.com/andrea11/openv
Thanks for reading โ and happy coding! ๐
2 Replies
- oulipoNew Contributor
Cool project!
I would probably be wary of adding too many "magic wrappers", because once things go south, you're at a loss of why/where to look for, if it's not transparent
- 1P_Phil
Moderator
Hi andrea11โ ,
What a great idea! I like how you can set it up to wrap commands globally (instead of per project). Super cool and thank you for sharing it with the rest of the community.
If you have any questions or need some help, let us know :D
Phil & the 1Password Team!