Documents and files
Manage documents and their file packs from a terminal, and print a document's OCR text as plain text.
A document is a titled pack of files. standards documents lists and edits documents, adds and removes files from a pack, and prints the pack's aggregated text. To upload a new file and attach it to a record, use records attach-document.
Commands
| Command | What it does | What it prints |
|---|---|---|
standards documents list --limit 20 | Lists documents. | { data, page }. |
standards documents get <documentId> | Reads one document. | The document. |
standards documents create --title "Q1 report" --object deals --record <recordId> --attribute contracts | Creates a document on a record's document attribute. All four options are required; an unknown object is refused with a 400. | The created document. |
standards documents update <documentId> --title "Q1 report (final)" | Renames the document. --title is required; it is stored trimmed, and a blank title or one containing a NUL character is refused with a 400. A folder id is refused with SCHEMA_VALIDATION_FAILED: the CLI has no folder command, so rename a folder in the app or through PATCH /folders/:id (see Group files into a document). | The renamed document. |
standards documents delete <documentId> | Deletes the document. | Nothing. |
standards documents preview <documentId> | Returns the pack's preview file. | The preview file. |
standards documents files <documentId> | Lists the pack. | One row per file. |
standards documents add-file <documentId> --file-id <fileId> | Appends an already uploaded file to the pack. | The updated pack. |
standards documents remove-file <documentId> <fileId> | Removes one file from the pack. | The updated pack. |
standards documents content <documentId> | Prints the pack's OCR text. | Plain text. |
Files in a pack
files lists the pack in position order. In table format each row shows id, position, type, size and ocrStatus; json and csv print the raw rows.
standards documents files <documentId> --format tableadd-file takes the id of a file that is already uploaded; remove-file takes the file id shown by files. The document survives an empty pack.
Content
documents content prints the OCR text of every file in the pack, in position order, as plain text. It ignores --format.
standards documents content <documentId> > report.txtFiles still being processed contribute nothing yet: check ocrStatus in documents files first.
Next steps
- Records: upload a file and attach it to a record.
- Files and documents: packs, OCR and previews explained.
- CLI: output formats and exit codes.
- Book a demo