BlueGit

timfa posprint

Files

posprint / docs / HELP-CLI-LINUX.md

HELP-CLI-LINUX.md

HELP-CLI-LINUX.md 1.6 KiB Download Raw

Command-line printing (Linux)

Print a .pos template without opening the GUI.

Run posprint cli-help to print this section from the binary (no GUI required).

Syntax

posprint print <file.pos> --printer <DEVICE> --set Name=Value [--set Other=Value ...]

Short form:

posprint print receipt.pos -p /dev/ttyUSB0 --set StoreName="My Shop" --set DocumentNumber=1001

Rules

  • --printer / -p (required): serial device path (e.g. /dev/ttyUSB0, /dev/ttyACM0), or another printer id accepted by discovery.
  • --set NAME=VALUE (required for every parameter): one flag per ${Name} or $[Name] in the template.
  • Checkbox params ($[Name]): use true/false (also 1/0, yes/no).
  • If any text ${Name} is missing or empty, or a $[Name] is omitted / not a boolean, the command fails.
  • The GUI is not started when using the print subcommand.

Permissions

Your user must be in the dialout group:

sudo usermod -aG dialout "$USER"
# log out and back in
groups

Examples

posprint print ~/receipts/sale.pos -p /dev/ttyUSB0 \
  --set StoreName="Corner Cafe" \
  --set DocumentNumber=42 \
  --set Date=2026-07-15 \
  --set GrandTotal=19.99

Printer device

ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null

Use the device node shown when the printer is connected.

Exit codes

CodeMeaning
0Printed successfully
1Error (missing parameters, parse error, permission denied, etc.)

Help

posprint print --help
posprint --help

Launch the graphical designer by running posprint with no subcommand.

Source
1# Command-line printing (Linux)
2
3Print a `.pos` template without opening the GUI.
4
5Run `posprint cli-help` to print this section from the binary (no GUI required).
6
7## Syntax
8
9```bash
10posprint print <file.pos> --printer <DEVICE> --set Name=Value [--set Other=Value ...]
11```
12
13Short form:
14
15```bash
16posprint print receipt.pos -p /dev/ttyUSB0 --set StoreName="My Shop" --set DocumentNumber=1001
17```
18
19## Rules
20
21- **`--printer` / `-p`** (required): serial device path (e.g. `/dev/ttyUSB0`, `/dev/ttyACM0`), or another printer id accepted by discovery.
22- **`--set NAME=VALUE`** (required for every parameter): one flag per `${Name}` or `$[Name]` in the template.
23- Checkbox params (`$[Name]`): use `true`/`false` (also `1`/`0`, `yes`/`no`).
24- If any text `${Name}` is missing or empty, or a `$[Name]` is omitted / not a boolean, the command **fails**.
25- The GUI is not started when using the `print` subcommand.
26
27## Permissions
28
29Your user must be in the **`dialout`** group:
30
31```bash
32sudo usermod -aG dialout "$USER"
33# log out and back in
34groups
35```
36
37## Examples
38
39```bash
40posprint print ~/receipts/sale.pos -p /dev/ttyUSB0 \
41 --set StoreName="Corner Cafe" \
42 --set DocumentNumber=42 \
43 --set Date=2026-07-15 \
44 --set GrandTotal=19.99
45```
46
47## Printer device
48
49```bash
50ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null
51```
52
53Use the device node shown when the printer is connected.
54
55## Exit codes
56
57| Code | Meaning |
58|------|---------|
59| `0` | Printed successfully |
60| `1` | Error (missing parameters, parse error, permission denied, etc.) |
61
62## Help
63
64```bash
65posprint print --help
66posprint --help
67```
68
69Launch the graphical designer by running `posprint` with **no** subcommand.