docs/cli/cv find

CLI

cv find

List the refs that hold a text, the way a find edit sees them. Check a find here before you send it.

lease.docx8 paragraphs · 1 table · 1 header · 1 footer
Sample

Usage

Each line on stdout is a ref that holds the text, how often when it is more than once, and the words around it. A line on stderr says whether an edit with this find matches once, nowhere, or in several places.

Terminal
$ export CV_API_KEY=cv_sk_…

Set your key once. lease.docx is the sample.

Usage
cv find <file> <text> [--scope <refs>]
Terminal
$ cv find lease.docx Draft
stdoutp1: "Lease agreement (Draft)"
stderrfinds "Draft" once, in p1

Several places, or none

A find edit must match exactly one place. In several, the edit fails with ambiguous; add a ref to look in one part, or set all to true to change every place.

When the text is nowhere, stdout is empty and stderr says why a find can miss. cv find exits 0 when it runs, whatever it finds.

Terminal
$ cv find lease.docx "Port office"
stdoutt1!C2: "Port office"t1!C3: "Port office"
stderrfinds "Port office" 2 times, in t1!C2, t1!C3; add a ref to aim at one of them, or set all to true to change every one
Terminal
$ cv find lease.docx Final
stderrfinds no "Final"; find matches units[].text, the refs view without ref tags, automatic numbers or quotes, in the same case and spaces

How text is matched

  • A find matches the text of a part as units[].text in the JSON view has it: the refs view without its marks, such as the ref tags ([p3]), automatic numbers and the quotes around sheet text that looks like a number.
  • Send it with the same case and spaces. It also matches inside longer words.
  • --scope looks only in those parts, like the ref of a find edit. A scope covers exactly the parts it names.
  • In a PDF form a find looks in field labels first. A field found by its label is marked (label), and an edit there fills the field.

Flags

Flag
--scope <refs>Look only in these parts, comma separated.
--from <format>The format of a local file or stdin, instead of detecting it from the content. File ids that are already uploaded keep the format they have.
--password <value>The password of an encrypted input.
--wait <seconds>How long to wait for the job, 300 by default. When the wait runs out the job keeps running, and the same command again waits for it.
--jsonPrint one JSON object on stdout instead. See JSON and exit codes.
--api <url>The server, from CV_API_URL, or https://api.convert.dev.
--key <key>The API key, from CV_API_KEY.

With --json

data has total and found, a list of {ref, count, text} in the order a find edit sees them, with the whole text of each part. It also has find, rev, format and warnings.

Terminal
$ cv find lease.docx "Port office" --json
stdout{22 lines
{  "data": {    "find": "Port office",    "format": "docx",    "found": [      {        "count": 1,        "ref": "t1!C2",        "text": "Port office"      },      {        "count": 1,        "ref": "t1!C3",        "text": "Port office"      }    ],    "rev": "3f2a9c1b7d4e",    "total": 2,    "warnings": []  },  "ok": true}

Updated 3 November 2026