Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add structured output like JSON to make output parsing easier #510

Open
eugenesvk opened this issue Aug 14, 2023 · 5 comments · May be fixed by #735
Open

[Feature request] Add structured output like JSON to make output parsing easier #510

eugenesvk opened this issue Aug 14, 2023 · 5 comments · May be fixed by #735

Comments

@eugenesvk
Copy link

vs. having to do error-prone text output manipulations

@39555
Copy link

39555 commented Apr 14, 2024

Yeah. It could be cool integration with Nushell!!

@xosxos
Copy link

xosxos commented Jan 7, 2025

This is the only feature that lead me to look for ps alternatives. A --delimiter option would be really great, hopefully it will be implemented some day!

@dalance dalance linked a pull request Jan 8, 2025 that will close this issue
@dalance
Copy link
Owner

dalance commented Jan 8, 2025

I tried to add JSON output support like below at #735:

$ procs --json
[
{"PID": "314918", "User": "hatta", "│": "│", "State": "S", "Nice": "0", "TTY": "pts/31", "CPU": "0.0", "MEM": "0.0", "VmSize": "244.980M", "VmRSS": "90.730M", "TCP": "[]", "UDP": "[]", "Read": "0", "Write": "0", "│": "│", "CPU Time": "00:00:26", "Start": "2024/10/24 18:37", "Elapsed": "10.7weeks", "Docker": "", "│": "│", "Command": "-zsh"}
]

How about it?

@xosxos
Copy link

xosxos commented Jan 15, 2025

I tried to add JSON output support like below at #735:

$ procs --json
[
{"PID": "314918", "User": "hatta", "│": "│", "State": "S", "Nice": "0", "TTY": "pts/31", "CPU": "0.0", "MEM": "0.0", "VmSize": "244.980M", "VmRSS": "90.730M", "TCP": "[]", "UDP": "[]", "Read": "0", "Write": "0", "│": "│", "CPU Time": "00:00:26", "Start": "2024/10/24 18:37", "Elapsed": "10.7weeks", "Docker": "", "│": "│", "Command": "-zsh"}
]

How about it?

I think the data is naturally stored as a table, and could be nicely piped as delimited rows. However, JSON is structured and easy enough to transform, so thank you for implementing the feature! I will try it out!

@dalance
Copy link
Owner

dalance commented Jan 17, 2025

If you have another idea about JSON format, please tell me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants