Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
4 years agoIs there a CLI which you can use with the Connect Server API?
Hello there,
I was wondering, 1PW has this nice op CLI (now in v2) with a lot of features to inject environment variables and such.
I think this feature is mostly needed in contexts which use ...
Former Member
4 years agoHey @nottmeyprotofy,
There is a way to make the CLI fetch secrets using Connect. All you need to do is set up two environment variables:
- OP_CONNECT_HOST - the path to your Connect server
- OP_CONNECT_TOKEN - the authorisation token that you want to use to get the secrets from Connect.
Once these two environment variables are set, the following commands of the CLI will get secrets with Connect:
- op read
- op run
- op inject
- op item get --format json (you need to mention the JSON format as an output, since Connect only works with JSON output)
More details can be found in the following pages in the 1Password Developer Documentation:
- https://developer.1password.com/docs/cli/secrets-config-files#optional-use-op-inject-in-production in production
- https://developer.1password.com/docs/cli/secrets-environment-variables#optional-use-op-run-in-production in production
- https://developer.1password.com/docs/cli/reference/commands/read command reference
- https://developer.1password.com/docs/cli/reference/commands/run command reference
- https://developer.1password.com/docs/cli/reference/commands/read command reference
Let me know if you have any other questions. I'm more than happy to help.