jnv icon indicating copy to clipboard operation
jnv copied to clipboard

Feature Request: Write the output to stdout

Open anton-suprun opened this issue 1 year ago • 3 comments

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

anton-suprun avatar Apr 27 '24 18:04 anton-suprun

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.

Bellavene avatar Jun 03 '24 22:06 Bellavene

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.

snuggie12 avatar Aug 28 '24 22:08 snuggie12

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

anton-suprun avatar Aug 28 '24 22:08 anton-suprun