---
title: Command line reference
slug: command-line-reference
docTags: 
createdAt: 2023-03-08T05:00:19.000Z
---

## Command line format

:::BlockQuote
BarcodeReaderCLI \[options] \[sources] \[@configuration\_file]
:::

Where:

<font color="#eb144c">`options`</font> - options specified in this document. See [option rules](./#option-rules)

<font color="#eb144c">`sources`</font> - files, folders, or URLs identifying input files  &#x20;

<font color="#eb144c">`configuration-file`</font> - zero one or more configurations files

## Source

The <font color="#eb144c">`source`</font> parameter specifies the location of image files to read barcodes from. Multiple sources can be specified.  Sources can be:

- Local image file&#x20;
- Local folder&#x20;
- Web-based image.  The source name should start with  <font color="#eb144c">`http://`</font>**,**<font color="#eb144c"> `htpps://`</font>

The rules for source values are:

- The value of the source should use **UTF-8** to represent non-English file names
- The value containing spaces should be enclosed in double quotes (<font color="#eb144c">`""`</font>)
- The value containing environmental and user [macro references](docId\:LCj_sxpqwHwUR1q-9vvGz) expanded at runtime

## Options

### Option rules

- Most options are specified as<font color="#eb144c"> `-name=value`</font>, except:
  - Options with a value described as &#x61;**&#x20;flag** are specified as <font color="#eb144c">`-name`</font>
  - the <font color="#eb144c">`-d`</font> option is specified as <font color="#eb144c">`-d="macro.name=macro.value"`</font>
- If the value is described as a **list**, zero or more valid values can be set. Multiple values should be separated by a comma (,). No spaces are allowed in the list.
- All options (except <font color="#eb144c">`-type`</font>) are optional.
- A new option value (except <font color="#eb144c">`-output`</font>) replaces the previous value. An empty string value sets the option to its default value.
- For options specifying file names:  <font color="#eb144c">`-output`</font> and <font color="#eb144c">`-output-text`</font>.
  - If the value contains spaces, it should be enclosed in double quotes (<font color="#eb144c">`""`</font>)
  - Environmental and user macro references are expanded at runtime

:::hint{type="info"}


The order of the options on the command line and in configuration files is important:

- **Reader options** and **source options** should be specified before the <font color="#eb144c">`source`</font> parameter. Thus different options can be applied to individual sources.
- **Output options** that apply to output should be specified before the <font color="#eb144c">`-output`</font> option. Thus, different options can be applied to individual outputs.
:::

### Reader options

Reader options configure the barcode reader parameters to be applied to a source.


| **Name**                                                                      | **Value Description**                                                                     | **Default**                                                     | **Valid values**                                                                                                                                                              |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <font color="#eb144c">`-type`</font><br /><font color="#eb144c">`-t`</font>   | **Required.** List of barcode types                                                       | `code39` `code128` `ucc128` `pdf417` `qr` `datamatrix` `drvlic` | `code39` `code128 codabar` `ucc128` `code93`<br />`upca` `ean8` `upce` `ean13` `i25`<br />`datamatrix` `pdf417` `qr` `drvlic`<br />`imb` `bpo` `aust` `sing` `4state` `patch` |
| <font color="#eb144c">`-tbr`</font>                                           | List of [TBR Codes](docId\:KRbh-LutYaWZPHRaJ5lqS)                                         | 0                                                               | Valid TBR codes for a given type are displayed by the [TBR Wizard](docId\:GLmGkFKXRClppzzASNvWc)                                                                              |
| <font color="#eb144c">`-dir`</font>                                           | List of barcode directions                                                                | `all`                                                           | `all` `horz` `vert`                                                                                                                                                           |
| <font color="#eb144c">`-max-bc`</font><br /><font color="#eb144c">`-m`</font> | A maximum number of barcodes to read on a page.<br />0 means read all barcodes.           | 0                                                               | 0 - 100                                                                                                                                                                       |
| <font color="#eb144c">`-timeout`</font>                                       | Barcode reading timeout in seconds.<br />0 means no timeout.                              | 0                                                               |                                                                                                                                                                               |
| <font color="#eb144c">`-encoding`</font>                                      | Encoding to convert barcode data to UTF-8 text.  See [here](docId\:N6svsSR4bWTi0m0B_m3rR) |                                                                 |                                                                                                                                                                               |

### TBR codes

- Valid codes for specific barcode types are reported in the [TBR Wizard](docId\:GLmGkFKXRClppzzASNvWc)
- Each TBR code set in <font color="#eb144c">`-tbr`</font> option (if more than one) is applied **sequentially** to each source page.  If the number of barcodes found on a page after applying a TBR code from the list is equal to or more than <font color="#eb144c">`-max-bc`</font> value (if set), the rest of the TBR codes are ignored for this page.

If <font color="#eb144c">`-tbr`</font> option is not set, the default algorithm is used.  If TBR codes are changed, to return to the default algorithm to the next source set <font color="#eb144c">`-tbr=0`</font>

### Source options - Multi-page file format

This option control processing of multi-page file formats: `PDF`, `TIFF`, `GIF`

| **Name**                              | **Value Description**                                                                                                                                                                                                                                                                 | **Default** | **Valid values**                                                 |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------- |
| <font color="#eb144c">`-pages`</font> | List of page selectors to limit reading to a set of pages.<br />`NMB` is an explicit page number (1-based)<br />`START` is an explicit page number or `first`<br />`STOP` is an explicit page number or `last`<br />`CNT` is the maximum number of barcodes to detect in a file<br /> | `all`       | `all` `even` `odd` `first` `last` `NMB` `START-STOP` `maxbc:CNT` |

If the page range is `maxbc:CNT` and the value of `CNT` > 0, then file processing stops once `CNT` barcodes are found. &#x20;

:::hint{type="warning"}
Setting a barcode count limit might increase overall processing time since multi-threading is disabled.
:::

### Source options - Web-based images

Images from <font color="#eb144c">`http://`</font>**,**<font color="#eb144c"> `htpps://`</font> sources are downloaded by the [curl](https://curl.haxx.se/docs/manpage.html) command-line application.  

- Linux version is installed with the BarcodeReaderCLI.
- Windows version is available [here](https://curl.haxx.se/download.html) and should be installed in the PATH.

The curl is invoked with the following default curl options: <font color="#eb144c">`-s -S -D -m -o -L`</font>****

- Additional options should be set as needed based on the system requirements.
- BarcodeReaderCLI reports errors returned from the `curl`.
- To resolve any problems invoke `curl` from the command line to identify required curl options.

| **Name**                                         | **Value Description**                                                                                                                                                                     | **Default** | **Valid values**                                               |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------- |
| <font color="#eb144c">`-curl-timeout`</font>     | Total timeout in seconds to download an image with curl. A value of 0.0 disables the timeout.                                                                                             | 15.0        | Floating point number                                          |
| <font color="#eb144c">`-curl-options`</font>     | Additional `curl` options. The list of options should be enclosed in the double quotes (<font color="#eb144c">`""`</font>). Use an escape character before any double quotes in the list. |             | [curl command line options](https://curl.se/docs/manpage.html) |
| <font color="#eb144c">`-curl-no-redirect`</font> | Disable request redirect                                                                                                                                                                  |             |                                                                |

### Source options - Folder processing

These options control the selection of image files when the <font color="#eb144c">`source`</font>*&#xA0;*&#x69;s a folder.

| **Name**                                                                            | **Value Description**                                           | **Default**                                        | **Valid values** |
| ----------------------------------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------- | ---------------- |
| <font color="#eb144c">`-sub`</font><br /><font color="#eb144c">`-subfolders`</font> | Include subfolders of the source folder in the processing<br /> | `true`                                             | `true` `false`   |
| <font color="#eb144c">`-incl`</font>                                                | List of file name masks to be included in the processing        | \*.tif,\*.tiff,\*.jpg,\*.jpeg,\*.pdf,\*.bmp,\*.png |                  |
| <font color="#eb144c">`-excl`</font>                                                | List of file name masks to be excluded from processing          |                                                    |                  |

### Output options

These options control the [output](https://www.inliteresearch.com/help/BarcodeReaderCLI/output.htm) generated by BarcodeReaderCLI.&#x20;

| **Name**                                                                      | **Value Description**                                                                                                                                                                                                                                                                           | **Default**                                                                                                                                  | **Valid values**                                                                      |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| <font color="#eb144c">`-output`</font><br /><font color="#eb144c">`-o`</font> | File path - output is sent to the specified file.  Zero or more output files can be specified,<br />each requires a separate `-output` option entry<br />`console` -  output is sent to <font color="">`stdout`</font> using `-format` option.<br />                                            |                                                                                                                                              | File path<br />`console`                                                              |
| <font color="#eb144c">`-format`</font>                                        | Console output format, `text` value requires -`-output-text` option to be specified.                                                                                                                                                                                                            | `json`                                                                                                                                       | `json` `csv` `text` `bin`                                                             |
| <font color="#eb144c">`-output-text`</font>                                   | String with macro reference. To define text output in a file, the string should be <font color="#eb144c">`file://text-file-path`</font>, where `text-file-path` is a template file path.<br />                                                                                                  |                                                                                                                                              |                                                                                       |
| <font color="#eb144c">`-if-exists`</font>                                     | Action to take if the output file already exists:<br />`overwrite` replaces the existing file<br />`append` adds new data to an existing file (not allowed for `bin` output)<br />`unique` adds a unique file index to the filename before the extension<br />`error` generates a runtime error | `overwrite`                                                                                                                                  | `overwrite` `append` `unique` `error`                                                 |
| <font color="#eb144c">`-fields`</font>                                        | **For barcodes**<br />Fields to output in `json` and `csv` output. Fields values are obtained through macro expansion  except:<br /><br />`barcode` outputs all default fields<br /><br />                                                                                                      | `text`,`data`,<br />`length`,`type`<br /><br />                                                                                              | [barcode macros](docId\:LCj_sxpqwHwUR1q-9vvGz)<br /><br />`barcode`                   |
| <font color="#eb144c">`-fields`</font>                                        | **For Driver License Barcodes:**<br />Fields to output in `json` and `csv` output. Fields values are obtained through macro expansion  except:<br /><br />`drvlic` outputs all default fields.<br />                                                                                            | `last`,`first`,`middle`,`dob`,`eyes`,`hair`,<br />`sex`,`height`,`weight`,<br />`street`,`city`,`state`,`postal,id`,`issued`,<br />`expires` | <br />[driver license macros](docId\:LCj_sxpqwHwUR1q-9vvGz)<br /><br />`drvlic`<br /> |
|                                                                               |                                                                                                                                                                                                                                                                                                 |                                                                                                                                              |                                                                                       |

### Miscellaneous options

| **Name**                                                                      | **Value Description**                                                                                                                   |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| <font color="#eb144c">`-help`</font><br /><font color="#eb144c">`-h`</font>   | Flag to output command-line help to console. No processing is done.                                                                     |
| <font color="#eb144c">`-silent`</font><br /><font color="#eb144c">`-s`</font> | Silent mode flag. Do not output the BarcodeReaderCLI version and information                                                            |
| <font color="#eb144c">`-timeout`</font>                                       | Execution timeout in seconds. The default value of 0.0 disables the timeout. Error is returned if total execution time exceeds timeout. |
| <font color="#eb144c">`-d`</font>                                             | Command line [use macros](docId\:LCj_sxpqwHwUR1q-9vvGz).<br />The format is<font color="#eb144c"> `-d="macro.name=macro.value"`</font>  |

## Configuration file

A configuration file is a convenient way to define a set of options and/or sources shared by multiple systems or sessions.
For example, they can be used to:

- Define macros specific to a system, such as the location of source or output files.
- Define reader options applied to sources specified on a command line.

Zero or more configuration files can be set on the command line. Multiple files are processed in the order of appearance.

The format rules for configuration files are:

- <font color="#eb144c">`-name`</font> sets command line flags
- <font color="#eb144c">`-name=value`</font> sets command line options with values
- <font color="#eb144c">`-d="macro.name=macro.value"`</font> specifies a command line [use macros](docId\:LCj_sxpqwHwUR1q-9vvGz).
- <font color="#eb144c">`source`</font> specifies the location of image files to read barcodes from. It can be an **image file**, **a folder** containing image files, or **a URL**.  Values with spaces should be enclosed in double quotes (<font color="#eb144c">`"some text"`</font>)
- <font color="#eb144c">`#`</font> starts the comment portion of a line. If <font color="#eb144c">`#`</font> is the first character, the whole line is treated as a comment.
- <font color="#eb144c">`exit`</font> ends the processing of a configuration file. The rest of the file is ignored.
- The configuration file should be in UTF-8 to include non-English file names.



