Skip to content

Docs

Quickstart

From nothing to your app running with its secrets from 1Password, then a reviewed sync to a deployed environment. Changes are proposed, then applied by you; no value is ever printed along the way.

1. Install

npm works on every platform and picks the prebuilt binary. Without Node.js, on Linux or macOS, use the install script.

$ npm install -g @matthew-cochran/opv
$ curl -fsSL https://raw.githubusercontent.com/matt-cochran/1password-vault/main/install.sh | sh

You also need the 1Password CLI, op. On macOS and Windows, turn on Settings > Developer > Integrate with 1Password CLI in the 1Password app. Other ways to install

2. Sign in

In your project, sign in to the 1Password account that holds its secrets. opv asks which account the first time and records it in .opv (commit it). You type your password only at 1Password's own prompt.

your project
$ opv login --account you@example.com

Sign in once per terminal

With the 1Password desktop app integration on, later commands reuse the app's unlock; there is nothing to set. Without it (WSL with the Linux op, or headless), sign this shell in once. The session stays in that shell for opv alone, never on disk, and ends after 30 minutes idle.

$ eval "$(opv login --shell)"
$ opv login --shell=fish | source

3. Propose the setup

Every change to the configuration starts as a proposal. Already have a .env? Propose a contract from its names; values are never read into it. The keys go into an environment called local and are present in every environment you add later. --write also writes secrets.toml for review; the proposal ends with a plan id.

your project
$ chmod 600 .env                                  # opv reads only a private file
$ opv propose setup --names-from .env --write

Starting from an item you already have in 1Password instead? opv propose setup --from-item dev reads its field names and types, never its values. Add a key later with opv propose key.

4. Apply it

You run the plan in your own terminal. opv recomputes it, refuses a plan id that no longer matches, shows it once, and after you confirm creates each vault, item and empty field and records their ids. It refuses CI and AI assistants.

your project
$ opv apply sp-0123456789abcdef   # the plan id the proposal printed

5. Enter the values

Import the values from the .env (write-only: per key imported or skipped, never shown), type one at a masked prompt, or open its item and type it in 1Password. Then check every key's value state, by name only.

your project
$ opv import local --from .env --dry-run   # what would come in; nothing written
$ opv import local --from .env
$ opv set API_KEY --env local              # masked entry, straight to 1Password
$ opv inventory --env local               # set, absent, empty, placeholder, malformed
$ opv next                                # the one action to take now

Once everything is in 1Password, delete the .env from your workflow and keep it out of git.

6. Run locally

Start your app with the environment's keys as environment variables, through op run, with no .env file on disk.

your project
$ opv run local -- npm run dev

In a checkout of a project whose configuration already lives in 1Password, no file is needed: opv finds it by the repository's git remote. opv login dev then opv run dev -- npm run dev.

7. Deploy

Propose a production environment and a target (Fly.io, GitHub Actions, Azure, Kubernetes or an HTTPS target; see targets), and apply them. Import or type prod's values as in step 5; production needs --confirm prod. Then review the plan and sync exactly that plan.

your project
$ opv propose env prod --tier production --write
$ opv propose target prod web --fly-app myapp-prod --write
$ opv apply
$ opv import prod --from prod.env --confirm prod
$ opv plan prod                  # what a sync would write, hold and prune
$ opv sync prod --deploy --expect-plan 412a5b23

If anything changed since the plan, the sync refuses before any write and prints the new id. To let CI deliver, opv ci workflow prod --target web prints a ready-to-commit GitHub Actions workflow. Prefer a terminal UI? Run opv ui.

8. Ready and the gate

opv ready says what is ready, what is not, who acts next and the exact command. --gate fails unless every present key is set and delivered at the item version 1Password has now: use it in CI before promoting.

your project
$ opv ready
$ opv ready prod --gate

Infrastructure values

A value your infrastructure produces, such as a database URL from Terraform, can be declared source = "infrastructure". It is never stored in 1Password: the deploy job that produced it pipes it to opv sync <env> --supply-stdin, and opv checks and delivers it like any other key. You don't type that step: opv prints it for the job.

$ opv ci workflow prod --target web --supply

Pin opv 0.13.0 or later everywhere first. Supplying infrastructure-generated values

With an AI assistant

The agent skill makes every Claude Code, Codex or Cursor session start from opv ready --json and never handle a secret value. The MCP server gives the assistant five tools: it reads value states and proposes changes, and you run opv apply. Check the skill and register the server (it writes the assistant's configuration):

$ opv skill status
$ opv mcp install

After a Homebrew or cargo install, run opv skill install --user once; after upgrading from 0.11 or earlier, run opv mcp install and opv skill install again. Where it goes, how to check and update it, and how the skill, CLI and MCP fit together

Full reference