Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
stopsineman
4 years agoNew Contributor
How can I retrieve the file referenced by a 'Document' Item via the V2 CLI?
I have several 'document' Items stored in a Vault that I'd like to reference dynamically from the command line rather than having to download them from the 1Password App and reference them on my file...
Former Member
4 years agoHey stopsineman,
Starting with 1Password CLI 2.5.0, files within document-type items can also be referenced by the means of secret references.
Have a look at https://developer.1password.com/docs/cli/secrets-reference-syntax for more details.
So a string such as op://<vault-name>/<item-name>/<file-name>
would be a reference to the underlying document, which can be resolved using, for instance, op read
:
op read op://<vault-name>/<item-name>/<file-name>
<your-file-content>
You can find more information about our secret provisioning commands here: https://developer.1password.com/docs/cli/secret-references
Let us know if this helps!
Best,
Horia