TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Interactive jq, but it's a bash script using fzf

10 点作者 thomascountz3 个月前
I was searching for an interactive jq editor when I came across this repo [1], which had an intriguing suggestion for a CLI using only fzf:<p>echo &#x27;&#x27; | fzf --print-query --preview &quot;cat *.json | jq {q}&quot;<p>This sent me down a rabbit hole, and I discovered just how incredibly configurable fzf is.<p>For instance:<p>- `--bind=ctrl-y:execute-silent(jq {q} $tempfile | pbcopy)`: You can bind custom keys to execute non-default behaviors, like copying the current selection or `echo`-ing.<p>- `--query=&quot;.&quot;`: Start fzf with an initial query (e.g., `.` for jq queries) to streamline the experience.<p>- `--preview-window=top:90%:wrap`: You can configure fzf into different layouts, behaviors, and ANSI colors.<p>- `--header=$&#x27;ctrl+y : copy JSON\nctrl+f : copy filter\nenter : output\nesc : exit&#x27; \`: fzf supports multi-line header to provide instructions or context for the user right in the interface.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;fiatjaf&#x2F;awesome-jq?tab=readme-ov-file#command-line">https:&#x2F;&#x2F;github.com&#x2F;fiatjaf&#x2F;awesome-jq?tab=readme-ov-file#com...</a>

1 comment

swah3 个月前
Great idea, hope I remember to try next time :)