|
2 | 2 |
|
3 | 3 | The CLI tool is provided mainly for quick tests and debugging. |
4 | 4 |
|
| 5 | +The CLI ships **two top-level groups**: |
| 6 | + |
| 7 | +* V2 product subcommands at the root: `extraction`, `classification`, |
| 8 | + `crop`, `ocr`, `split`, plus `search-models`. |
| 9 | +* All V1 products live under a `v1` group (e.g. `mindee v1 invoice ...`). |
| 10 | + |
| 11 | +For backward compatibility, invoking a V1 product name directly |
| 12 | +(`mindee invoice ...`, `mindee receipt ...`, …) is automatically |
| 13 | +dispatched to `mindee v1 <product> ...`. |
| 14 | + |
5 | 15 | ### General help |
6 | 16 |
|
7 | 17 | ```shell |
8 | | -./mindee generated --help |
| 18 | +./mindee --help |
| 19 | +./mindee v1 --help |
| 20 | +./mindee extraction --help |
| 21 | +./mindee search-models --help |
9 | 22 | ``` |
10 | 23 |
|
11 | 24 | > Note: Due to the limited-nature of most PHP CLI tools, the help sections aren't customized for each command. |
12 | 25 |
|
| 26 | +## V1 commands |
| 27 | + |
13 | 28 | ### Example parse command for Off-the-Shelf document |
14 | 29 |
|
15 | 30 | ```shell |
16 | | -./mindee invoice -k xxxxxxx /path/to/invoice.pdf |
| 31 | +./mindee v1 invoice -k xxxxxxx /path/to/invoice.pdf |
17 | 32 | ``` |
18 | 33 |
|
| 34 | +> Legacy `./mindee invoice -k xxxxxxx /path/to/invoice.pdf` still works. |
| 35 | +
|
19 | 36 | ### Works with environment variables |
20 | 37 |
|
21 | 38 | ```shell |
22 | 39 | export MINDEE_API_KEY=xxxxxx |
23 | | -./mindee invoice /path/to/invoice.pdf |
| 40 | +./mindee v1 invoice /path/to/invoice.pdf |
24 | 41 | ``` |
25 | 42 |
|
26 | 43 | ### Example parse command for a generated document (docTI) |
27 | 44 |
|
28 | 45 | ```shell |
29 | | -./mindee generated -a pikachu -k xxxxxxx pokemon_card /path/to/card.jpg -A |
| 46 | +./mindee v1 generated -a pikachu -k xxxxxxx pokemon_card /path/to/card.jpg -A |
30 | 47 | ``` |
31 | 48 |
|
32 | 49 |
|
33 | 50 | ### Example async parse command |
34 | 51 |
|
35 | 52 | ```shell |
36 | | -./mindee invoice-splitter path/to/the/invoice.pdf -A |
| 53 | +./mindee v1 invoice-splitter path/to/the/invoice.pdf -A |
37 | 54 | ``` |
38 | 55 |
|
39 | 56 | > Note: the `-A` can be omitted on products which do not support synchronous mode. |
40 | 57 |
|
| 58 | +### Full parsed output |
| 59 | + |
41 | 60 | ```shell |
42 | | -./mindee invoice-splitter path/to/the/invoice.pdf -A |
| 61 | +./mindee v1 invoice -k xxxxxxx /path/to/invoice.pdf -o raw |
43 | 62 | ``` |
44 | 63 |
|
45 | | -### [DEPRECATED] Example parse command for a custom document (API Builder) |
| 64 | +## V2 commands |
| 65 | + |
| 66 | +V2 inference commands share the same option set: |
| 67 | + |
| 68 | +| Option | Short | Description | |
| 69 | +|--------|-------|-------------| |
| 70 | +| `--model-id` | `-m` | ID of the model to use (required). | |
| 71 | +| `--api-key` | `-k` | API key. Falls back to `MINDEE_V2_API_KEY`. | |
| 72 | +| `--alias` | `-a` | Optional alias for the file. | |
| 73 | +| `--output` | `-o` | `summary` (default), `full`, or `raw`. | |
| 74 | + |
| 75 | +The `extraction` command adds: |
| 76 | + |
| 77 | +| Option | Short | Description | |
| 78 | +|--------|-------|-------------| |
| 79 | +| `--rag` | `-g` | Enable Retrieval-Augmented Generation. | |
| 80 | +| `--raw-text` | `-r` | Extract the document's raw text. | |
| 81 | +| `--confidence` | `-c` | Return per-field confidence scores. | |
| 82 | +| `--polygon` | `-p` | Return per-field bounding polygons. | |
| 83 | +| `--text-context` | `-t` | Add text context to the API call. | |
| 84 | + |
| 85 | +### Example V2 extraction call |
46 | 86 |
|
47 | 87 | ```shell |
48 | | -./mindee custom -a pikachu -k xxxxxxx pokemon_card /path/to/card.jpg |
| 88 | +export MINDEE_V2_API_KEY=xxxxxx |
| 89 | +./mindee extraction -m <model-id> /path/to/file.pdf |
49 | 90 | ``` |
50 | 91 |
|
51 | | -### Full parsed output |
| 92 | +### Example V2 extraction with options and a JSON dump |
| 93 | + |
| 94 | +```shell |
| 95 | +./mindee extraction -m <model-id> -k <api-key> -r -c -p -o full /path/to/file.pdf |
| 96 | +./mindee extraction -m <model-id> -o raw /path/to/file.pdf |
| 97 | +``` |
| 98 | + |
| 99 | +### Listing models |
52 | 100 |
|
53 | 101 | ```shell |
54 | | -./mindee invoice -k xxxxxxx /path/to/invoice.pdf -o raw |
| 102 | +./mindee search-models -k <api-key> |
| 103 | +./mindee search-models --name fin --model-type extraction -r |
55 | 104 | ``` |
56 | 105 |
|
57 | 106 | ### Running the script through php |
|
0 commit comments