Juniper/libxo
View on GitHub ↗ ★ 349 C
The libxo library allows an application to generate text, XML, JSON, and HTML output using a common set of function calls. The application decides at run time which output style should be produced.
16 mentions on Hacker News by 14 people: 4 stories, 12 comments · first 2015-02-15 · latest 2025-07-25
20082026
-
…was solved with libxo[0]: Libxo happens to be in the base system, but it is generally available: * https://github.com/Juniper/libxo * https://libxo.readthedocs.io/en/latest/
comment by throw0101b · 2023-12-08 · in JC converts the output of popular command-line tools to JSON -
Or make it flexible: > libxo - A Library for Generating Text, XML, JSON, and HTML Output * https://github.com/Juniper/libxo/ * https://wiki.freebsd.org/LibXo Want structure? Ask for JSON or XML and parse. Otherwise it's the regular text…
comment by throw0101c · 2023-02-25 · in Getting work done with PowerShell on Linux -
Can you trust it? Cli tool output is not exactly stable. I thought that's why libxo exists? https://github.com/Juniper/libxo
comment by anecdotal1 · 2022-11-03 · in JC – JSONifies the output of many CLI tools -
Something like https://github.com/Juniper/libxo is probably the best bet for non-powershell, non-python like things to ever be properly parseable.
comment by justinsaccount · 2021-12-15 · in The growth of command line options, 1979-Present (2020) -
…in a format string. A "field descriptor" tells libxo what the field is and what it means. * https://github.com/Juniper/libxo Then add an "--output-format" option.
comment by throw0101a · 2021-12-05 · in Tips on adding JSON output to your CLI app -
You're not the first person to think of that. See Juniper's libxo: https://github.com/Juniper/libxo It's integrated into a lot of FreeBSD's command line tooling, and is very useful, when it's available.
comment by talideon · 2021-06-16 · in GitHub – nushell/nushell: A new type of shell -
…for sharing. Their github README does a nice job of showing how it doesn't add a lot of work: https://github.com/Juniper/libxo
comment by tyingq · 2021-01-19 · in Linux and Powershell -
…libxo is used by a chunk of the FreeBSD base tools to offer output in JSON, amongst other things: https://github.com/Juniper/libxo -% ps --libxo=json,pretty { "process-information": { "process": [ { "pid": "52455", "terminal-name": "5 ",…
comment by Freaky · 2020-03-19 · in Illustrated Jq Tutorial -
…standardizing the format. FreeBSD started adopting this approach via libxo for its base utilities: https://github.com/Juniper/libxo . I hope it spreads into Linux.
comment by int_19h · 2017-09-15 · in The Man Behind Windows PowerShell -
…of several ways. An example I am particularly fond of is using this tool as a poor man's libxo ( https://github.com/Juniper/libxo ): $ ps | sqawk -output json,indent=1 'select PID,TTY,TIME,CMD from a' trim=left header=1 [{ "PID" : "3947",…
comment by networked · 2016-11-15 · in Ask HN: What simple tools or products are you most proud of making? -
…in the base system, which will allow you to get (amongst others) JSON out of various commands: https://github.com/Juniper/libxo
comment by Freaky · 2015-02-15 · in Show HN: A Unixy approach to WebSockets