BlueGit

timfa posprint

Files

posprint / docs / HELP-CLI-LINUX.md

HELP-CLI-LINUX.md

HELP-CLI-LINUX.md 1.5 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.
  • --set NAME=VALUE (required for every parameter): one flag per ${Name} in the template.
  • If any ${Name} is missing or empty, the command fails and lists missing parameters.
  • 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`.
22- **`--set NAME=VALUE`** (required for every parameter): one flag per `${Name}` in the template.
23- If any `${Name}` is missing or empty, the command **fails** and lists missing parameters.
24- The GUI is not started when using the `print` subcommand.
25
26## Permissions
27
28Your user must be in the **`dialout`** group:
29
30```bash
31sudo usermod -aG dialout "$USER"
32# log out and back in
33groups
34```
35
36## Examples
37
38```bash
39posprint print ~/receipts/sale.pos -p /dev/ttyUSB0 \
40 --set StoreName="Corner Cafe" \
41 --set DocumentNumber=42 \
42 --set Date=2026-07-15 \
43 --set GrandTotal=19.99
44```
45
46## Printer device
47
48```bash
49ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null
50```
51
52Use the device node shown when the printer is connected.
53
54## Exit codes
55
56| Code | Meaning |
57|------|---------|
58| `0` | Printed successfully |
59| `1` | Error (missing parameters, parse error, permission denied, etc.) |
60
61## Help
62
63```bash
64posprint print --help
65posprint --help
66```
67
68Launch the graphical designer by running `posprint` with **no** subcommand.