opx

OPX

The most secure way to run NodeJS apps locally!

crates.io badge build status badge license badge

Overview

This is a CLI meant to enhance the native 1Passwords native CLI (op) simplifying the developer experience.

While you can run the following 1Password op run CLI there is a bit of manual effort to pass the additional flags where each one of your .env files is located.

op run --env-file=.env -- pnpm start

With opx it will scan you current working directory for any .env files and load them as variadic --env-file argument(s).

Installing

Ensure you have installed an configured the 1Password CLI. Then you can Install the opx CLI utility with cargo.

cargo install opx

Usage

You need to have at least one .env file in any folder of your project and it must reference a secret from 1Password.

APPLE_ID="op://overlayed/apple_id/credential"

Start your application to inject the secrets as environment variables.

opx

It will check packageManager definition and use that start your app. The default package manager is npm and the default script is start. You can run any script in your applications package.json with opx <args>.

Example running this demo application.

$ opx
[OPX] Using package manager pnpm 
[OPX] Forcing terminal colors with FORCE_COLOR=1
[OPX] op run \
        --env-file=apps/demo/.env \
        --env-file=apps/other-app/.env -- pnpm start
demo:start: Hello this is a sample app that uses a secret from 1password cli
demo:start: Secret is: <concealed by 1Password>
other-app:start: Hello this is a sample app that uses a secret from 1password cli
other-app:start: Secret is: <concealed by 1Password>