ynqa / jnv

Interactive JSON filter using jq
MIT License
4.9k stars 54 forks source link

Feature Request: Write the output to stdout #40

Open anton-suprun opened 6 months ago

anton-suprun commented 6 months ago

Feature Request

Intro

Hi πŸ‘‹

Started using this tool recently and wanted to say that I love it; great work and thank you for building this! 😊

Description

Have jnv behave similarly to fzf where I could do something like:

cat my_file.json | jnv | <some cli tool> - and the output from my jq query would be written to stdout.

Essentially either via some keybinding or via an arguement (e.g.: jnv --write-to-stdout) would write the output to standard out.

I noticed there is an existing issue mentioning copying the selected output; having it write to stdout would (in a way) achieve the same outcome as user could cat my_file.json | jnv | <some cli tool that copies to clipboard; e.g. pbcopy

Question (Contribution?)

I was wondering how much of a lift this would be; I haven't expored the code base yet and am not familiar with the rust cli/tui ecosystem. I'd be happy to try working on something like this however it would be a slow process and I'd need some initial guidance/direction on how to approach this problem. I've only worked on some small toy cli tools with go + cobra + bubbletea

Bellavene commented 5 months ago

I was confused that it does not do it already. I see the main purpose for such a tool in autocompletion for jq strings in CLI.

snuggie12 commented 2 months ago

Not sure if you want a separate issue for this or how anyone feels, but in jiq there are flags for outputting the results, the query, or both to stdout.

anton-suprun commented 2 months ago

Not sure if you want a separate issue for this or how anyone feels, but in jiq there are flags for outputting the results, the query, or both to stdout.

Yeah this is more or less what I had in mind

Essentially either via some keybinding or via an arguement (e.g.: jnv --write-to-stdout) would write the output to standard out.

I said argument here but meant flag (as in the example)

I`m hoping to work on this sometime in the next month or so. Finishing up a few other projects for now