Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ChatGPT flawlessly constructs jq commands for whatever banal task you have. Game changer.


Completely agree. I use jq multiple times a day now, purely because GPT-4 or Claude Opus mean I never have to think about how to express anything in it.


Can you post an example of how you'd phrase the question to ChatGPT?


Here is a sample of my input json, here is what I expect the result to be, write a jq command to accomplish that.


Write a command using jq which will take the following input and do x, y, and z to it:

$INPUT


Speaking as an inexperienced, infrequent jq user, using ChatGPT to create a jq version of my above PowerShell example took more time than writing a jq version by hand with the help of jq documentation (and to have any confidence that the result is actually correct in the general case, rather than merely producing expected results for my example, I'd need to inspect OpenGPT's final command and RTFM anyway):

https://chat.openai.com/share/9c73bc02-da4b-494d-8cff-3d1202...


Oof, that "don't" in the code comment within the single quotes was causing your single quoted command to end, causing the command to be parsed incorrectly in your shell. I wonder if that was the only issue originally because it actually looks pretty good to me. Regardless, I can tell you with confidence it would take much less time for me to construct a working version based on the first input than starting from RTFM, despite already having some jq experience myself. Was this 3.5 or 4?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: