-o to choose another format:
Results go to standard output and errors to standard error, so you can pipe and
redirect output safely.
Tables
get takes first. Tables
are for reading; use -o json in scripts.
To keep tables readable, epx shortens some long values, such as a setting’s value or an
error message, to 60 characters ending in …. Tables and CSV also drop the trailing zeros of amounts beyond
the cents, so 35.7000000 shows as 35.70. JSON and YAML print every value as sent.
Choose columns
--columns picks the columns and their order by their headers, in any case. Quote a
header that contains a space: --columns 'id,root product'. Each read’s help lists its
columns. --no-headers leaves out the header row.
--columns and --no-headers apply to tables and CSV only.
CSV
-o csv prints the table’s rows, quoted as RFC 4180 specifies, with the header row
first unless you pass --no-headers. Long values aren’t shortened.
JSON
-o json prints the response as Emporix sends it, indented, with object keys sorted so
that output is stable and easy to compare. Values keep their exact text, and nothing is
redacted. A list prints the items of every page as one JSON array.
epx api and every write print their response as JSON, too.
YAML
-o yaml prints the same data as -o json, as YAML 1.2 in block style. Every string is
double-quoted, so values such as "no", "1.0", and "null" stay strings, and numbers
keep their exact text.
A YAML 1.1 parser reads a number with an exponent, such as
1e5, as a string unless it
has a decimal point and a signed exponent (1.5e+5).JSON Lines
--stream prints each item on its own line as compact JSON as soon as its page is read
and checked. Long lists start printing at once and aren’t held in memory.
- Most list commands take
--stream;epx <command> --helpshows whether one does. - It works with
--limit,--query, and--sort, but not with-o,--columns, or--no-headers. - It reads up to 10,000 pages, where other lists stop at 1,000.
- The paging checks still run. If a later page fails a
check, the command exits with code 1 after printing the pages before it. Without
--stream, a list prints nothing unless every check passes.
Translations
Emporix stores many texts, such as names and descriptions, per language. epx requests every translation, so-o json shows them all. Commands whose tables show text take
--language to choose the translation shown. It defaults to en, or to your profile’s
default language.
Transistors (fr).
Files
epx quotes pdf saves the quote’s PDF with --out
instead of printing it. --out - writes the file to standard
output, but only when standard output isn’t a terminal. epx writes the file readable by
you only, and replaces an existing file only once the new one is complete.