Subcommands
- document create: Create a document item
- document delete: Delete or archive a document item
- document edit: Edit a document item
- document get: Download a document
- document list: Get a list of documents
document create
Create a document item and receive a JSON object that contains the item’s ID.Flags
--vault option.
Create a file from standard input
To create the file contents from standard input (stdin), enter a hyphen (-) instead of a path. You can use the --file-name option to
change the name of the file.
Examples
Create a document by specifying the file path:document delete
Permanently delete a document. Specify the document to delete by its name or ID. Use the--archive option to move it to the Archive instead.
Flags
Specify items on standard input
The command treats each line of information on standard input (stdin) as an object specifier. Runop help to learn more about how to specify
objects.
You can also input a list or array of JSON objects. The command will
get an item for any object that has an ID. This is useful for
passing information from one op command to another.
Examples
Permanently delete a document:document edit
Edit a document item. Specify the document item to edit by its name or ID.Flags
Update a file from standard input
To update the file contents from standard input (stdin), enter a hyphen (-) instead of a path. You can use the --file-name option to
change the name of the file.
document get
Download a document and print the contents. Specify the document by its name or ID.Flags
--out-file path/to/file.ext flag.
Save to a file
Use the--out-file option to have op save the document. This may
be useful in some shells as a way to preserve the file’s original
encoding.
The --out-file option won’t overwrite an existing file. The
destination path must be an empty file or not exist.
Examples
Save a document to a file calledsecret-plans.text: