Giter Site home page Giter Site logo

jnv's Introduction

Github linkedin speakerdeck twitter

github-stats

jnv's People

Contributors

corneliusroemer avatar herbygillot avatar nshalman avatar ynqa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jnv's Issues

Install not working

Running the provided install instructions gives me an error:

cargo install jnv
    Updating crates.io index
  Downloaded jnv v0.1.0
  Downloaded 1 crate (24.0 KB) in 0.11s
  Installing jnv v0.1.0
    Updating crates.io index
  Downloaded autotools v0.2.6
  Downloaded anstream v0.6.13
  Downloaded autocfg v1.1.0
  Downloaded equivalent v1.0.1
  Downloaded anstyle-query v1.0.2
  Downloaded anstyle-parse v0.2.3
  Downloaded anstyle v1.0.6
  Downloaded cfg-if v1.0.0
  Downloaded lazy_static v1.4.0
  Downloaded fastrand v2.0.1
  Downloaded errno v0.3.8
  Downloaded clap_lex v0.7.0
  Downloaded bitflags v2.5.0
  Downloaded gag v1.0.0
  Downloaded colorchoice v1.0.0
  Downloaded endian-type v0.1.2
  Downloaded j9 v0.1.1
  Downloaded anyhow v1.0.81
  Downloaded either v1.10.0
  Downloaded filedescriptor v0.8.2
  Downloaded libloading v0.8.3
  Downloaded clap_derive v4.5.3
  Downloaded cexpr v0.6.0
  Downloaded signal-hook-mio v0.2.3
  Downloaded nibble_vec v0.1.0
  Downloaded home v0.5.9
  Downloaded lazycell v1.3.0
  Downloaded itoa v1.0.10
  Downloaded heck v0.5.0
  Downloaded glob v0.3.1
  Downloaded lock_api v0.4.11
  Downloaded same-file v1.0.6
  Downloaded rustc-hash v1.1.0
  Downloaded thiserror v1.0.58
  Downloaded thiserror-impl v1.0.58
  Downloaded shlex v1.3.0
  Downloaded utf8parse v0.2.1
  Downloaded unicode-width v0.1.11
  Downloaded which v4.4.2
  Downloaded strsim v0.11.0
  Downloaded quote v1.0.35
  Downloaded scopeguard v1.2.0
  Downloaded cc v1.0.90
  Downloaded parking_lot_core v0.9.9
  Downloaded clang-sys v1.7.0
  Downloaded clap v4.5.3
  Downloaded signal-hook-registry v1.4.1
  Downloaded walkdir v2.5.0
  Downloaded tempfile v3.10.1
  Downloaded smallvec v1.13.1
  Downloaded log v0.4.21
  Downloaded parking_lot v0.12.1
  Downloaded proc-macro2 v1.0.79
  Downloaded aho-corasick v1.1.2
  Downloaded signal-hook v0.3.17
  Downloaded ryu v1.0.17
  Downloaded prettyplease v0.2.16
  Downloaded promkit v0.3.1
  Downloaded unicode-ident v1.0.12
  Downloaded serde v1.0.197
  Downloaded indexmap v2.2.5
  Downloaded minimal-lexical v0.2.1
  Downloaded memchr v2.7.1
  Downloaded mio v0.8.11
  Downloaded nom v7.1.3
  Downloaded crossterm v0.27.0
  Downloaded hashbrown v0.14.3
  Downloaded itertools v0.12.1
  Downloaded clap_builder v4.5.2
  Downloaded serde_json v1.0.114
  Downloaded bindgen v0.69.4
  Downloaded radix_trie v0.2.1
  Downloaded regex v1.10.3
  Downloaded syn v2.0.53
  Downloaded regex-syntax v0.8.2
  Downloaded rustix v0.38.31
  Downloaded regex-automata v0.4.6
  Downloaded libc v0.2.153
  Downloaded linux-raw-sys v0.4.13
  Downloaded j9-sys v0.1.1
  Downloaded 80 crates (9.3 MB) in 2.86s (largest was `j9-sys` at 1.9 MB)
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling glob v0.3.1
   Compiling anyhow v1.0.81
   Compiling prettyplease v0.2.16
   Compiling rustix v0.38.31
   Compiling either v1.10.0
   Compiling cfg-if v1.0.0
   Compiling memchr v2.7.1
   Compiling thiserror v1.0.58
   Compiling minimal-lexical v0.2.1
   Compiling linux-raw-sys v0.4.13
   Compiling bitflags v2.5.0
   Compiling regex-syntax v0.8.2
   Compiling home v0.5.9
   Compiling autocfg v1.1.0
   Compiling bindgen v0.69.4
   Compiling smallvec v1.13.1
   Compiling same-file v1.0.6
   Compiling lazycell v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling libloading v0.8.3
   Compiling parking_lot_core v0.9.9
   Compiling cc v1.0.90
   Compiling log v0.4.21
   Compiling lazy_static v1.4.0
   Compiling signal-hook v0.3.17
   Compiling itertools v0.12.1
   Compiling shlex v1.3.0
   Compiling walkdir v2.5.0
   Compiling scopeguard v1.2.0
   Compiling serde v1.0.197
   Compiling utf8parse v0.2.1
   Compiling colorchoice v1.0.0
   Compiling lock_api v0.4.11
   Compiling anstyle-parse v0.2.3
   Compiling serde_json v1.0.114
   Compiling anstyle v1.0.6
   Compiling anstyle-query v1.0.2
   Compiling equivalent v1.0.1
   Compiling hashbrown v0.14.3
   Compiling nibble_vec v0.1.0
   Compiling heck v0.5.0
   Compiling clang-sys v1.7.0
   Compiling endian-type v0.1.2
   Compiling clap_lex v0.7.0
   Compiling ryu v1.0.17
   Compiling anstream v0.6.13
   Compiling strsim v0.11.0
   Compiling fastrand v2.0.1
   Compiling itoa v1.0.10
   Compiling radix_trie v0.2.1
   Compiling nom v7.1.3
   Compiling unicode-width v0.1.11
   Compiling clap_builder v4.5.2
   Compiling autotools v0.2.6
   Compiling quote v1.0.35
   Compiling syn v2.0.53
   Compiling indexmap v2.2.5
   Compiling signal-hook-registry v1.4.1
   Compiling mio v0.8.11
   Compiling regex-automata v0.4.6
   Compiling parking_lot v0.12.1
   Compiling signal-hook-mio v0.2.3
   Compiling which v4.4.2
   Compiling cexpr v0.6.0
   Compiling tempfile v3.10.1
   Compiling regex v1.10.3
   Compiling thiserror-impl v1.0.58
   Compiling clap_derive v4.5.3
   Compiling filedescriptor v0.8.2
   Compiling crossterm v0.27.0
   Compiling gag v1.0.0
   Compiling clap v4.5.3
   Compiling promkit v0.3.1
   Compiling j9-sys v0.1.1
The following warnings were emitted during compilation:

warning: [email protected]: Compiler version doesn't include clang or GCC: "cc" "--version"
warning: [email protected]: Compiler version doesn't include clang or GCC: "c++" "--version"

error: failed to run custom build command for `j9-sys v0.1.1`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installi3WdUy/release/build/j9-sys-12bea070e1c64770/build-script-build` (exit status: 101)
  --- stdout
  cargo:warning=Compiler version doesn't include clang or GCC: "cc" "--version"
  cargo:warning=Compiler version doesn't include clang or GCC: "c++" "--version"
  running: cd "/tmp/cargo-installi3WdUy/release/build/j9-sys-2575b3d26089796e/out/jq_build" && "sh" "-c" "exec \"$0\" \"$@\"" "autoreconf" "-i"

  --- stderr
  autoreconf: 1: exec: autoreconf: not found
  thread 'main' panicked at /home/isaac/.cargo/registry/src/index.crates.io-6f17d22bba15001f/autotools-0.2.6/src/lib.rs:781:5:

  command did not execute successfully, got: exit status: 127

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to compile `jnv v0.1.0`, intermediate artifacts can be found at `/tmp/cargo-installi3WdUy`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

the brew install command gives an error as well



brew install ynqa/tap/jnv
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Error: formulae require at least a URL
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:307:in `determine_active_spec'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:238:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:527:in `new'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:527:in `get_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:751:in `get_formula'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formulary.rb:964:in `factory'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/named_args.rb:126:in `block in load_formula_or_cask'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/api.rb:205:in `with_no_api_env_if_needed'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/named_args.rb:118:in `load_formula_or_cask'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/named_args.rb:83:in `block in to_formulae_and_casks'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/named_args.rb:81:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/named_args.rb:81:in `flat_map'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/named_args.rb:81:in `to_formulae_and_casks'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/install.rb:197:in `install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:86:in `<main>'

I don't use brew often, and this is my first time using cargo, so apologies if its something obvious!

What terminal settings should you use?

When I look at the demo.tape gif in the repo, there are newlines in the json and using jnv you can step through the data.

When I run a "kubectl get -ojson | jnv" I get everything on one long line. Not as usable. Am I missing some terminal settings, or is there something jnv mess up?

This is how it looks like for me.
json-output

Feature Request: Support JSON stream

It would be nice if jnv supported sequences of json objects separate by newlines the way jq does:

{ "a": 123 }
{ "a": 123 }

Note: fx also supports this.

Native keyboard shortcuts for quickly navigating the query don't work

On macOS, I frequently use Option+Arrow Keys to jump through text inputs one "word" at a time. This works in the native shell as well as most text inputs. Would it be possible to support this in jnv's query input?

Thanks for making this! It's a neat tool that I've enjoyed with the minimal usage I've had so far, and I hope it's been a fun project to work on.

blinking when using xterm -cm

when I enter xterm -cm and get a terminal without color (from what I understand of what the -cm flags are doing) I see blinking during tab completion. I wonder why? Sorry my video is a bit zoomed strangely but will show you what I see. Cool tool and many thanks. My terminal colors are strange anyway so this isn't a big deal but wanted to report it and see if there is an easy fix.

simplescreenrecorder-2024-03-21_20.34.27.mp4

ENH: Support newline delimited JSON (ndjons/jsonl)

I'd love to use jnv with newline delimited json files as well. Right now, when I load an ndjson file, I get the following error:

$ jnv ncbi_dataset/data/data_report.jsonl 
Error: trailing characters at line 2 column 1

jq on the other hand has absolutely no issue with jsonl files.

Not running by default on AlmaLinux 8

jnv: /lib64/libc.so.6: version `GLIBC_2.29' not found (required by jnv)
jnv: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by jnv)

On a AlmaLinux 8 box. This is because the latest the almalinux repos has is:

glibc-2.28-236.el8_9.12.i686 : The GNU libc libraries
Repo        : baseos
Matched from:
Provide    : libc.so.6

Feature Request: Enable Scrolling for Long Text Outputs(Preview)

Hi there,

First off, I'd like to express my appreciation for the work you've put into this project! Muy Bueno!

However, I encountered a limitation that I believe could improve the user experience significantly if tackled.
While going through the documentation, I noticed there wasn't a mention of how to enable scrolling functionality. This feature becomes crucial when dealing with outputs that exceed the terminal's size, as users (like myself) would expect the ability to navigate through the text to inspect specific details more closely, before I choose to write a filter. (Yes, I know i can check the json before with like, less, but it is a bit tedious)

Could you provide guidance on enabling scrolling, or would it be possible to consider this as a feature request for future releases?

Thanks a mill!

How about replacement `jq` with `jaq`?

At the time of v0.1.0, the author deemed it most appropriate to use the original jq.

However, managing C-related stuff during build time had to be undertaken, and this was underestimated at the release of v0.1.0. After actually releasing and taking a look the installation error issues that were raised, it became apparent that continuing to use jq might not be the best decision.

Then, there is a project in Rust called jaq, which is a jq-clone. I hope to discuss whether or not to replace jq with jaq, and whether it is feasible to do so.

Here's a rough outline of the pros and cons:

jq (j9)

  • pros
    • As an original implementation, all filters defined here are, of course, available for use
  • cons
    • Requires management of C dependencies, which might pose issues during build phase

jaq

  • pros
    • pure Rust, there is no need to manage C dependencies
  • cons
    • jq-clone, not all filters may be supported
      • e.g. 01mf02/jaq#112
      • My concern is with this point. Ideally, it would be better if all features were available for use (Or maybe it's sufficient if only the basic filters are available...?)

Add jnv to homebrew-core

It would be nice if we add jnv to homebrew-core since they build the project in CI for all current macOS platforms.

Here is a formula I wrote. It should work but homebrew-core requires the repo to be >30 days old.

class Jnv < Formula
  desc "JSON navigator and interactive filter leveraging jq"
  homepage "https://github.com/ynqa/jnv"
  url "https://github.com/ynqa/jnv/archive/refs/tags/v0.1.1.tar.gz"
  sha256 "40fdb9de56d7ad55f7f3c52440ba7920f9aaffec07d59881b04e87a6facc5d28"
  license "MIT"
  head "https://github.com/ynqa/jnv.git", branch: "main"

  livecheck do
    url :stable
    strategy :github_latest
  end

  depends_on "autoconf" => :build
  depends_on "automake" => :build
  depends_on "libtool" => :build
  depends_on "rust" => :build

  def install
    system "cargo", "install", *std_cargo_args
  end

  test do
    assert_equal "jnv #{version}", shell_output("#{bin}/jnv --version").strip
  end
end

Specify default query

It would be cool to be able to specify a default query for interactive searching:

$ cat data.json | jnv --default-query '.result.abc'
❯❯ .result.abc
...

This would make it easier when inspecting multiple similar json inputs to always land in the same entry and investigate interactively from there using jnv instead of needing to type .result.abc each time.

Painfully slow on 16MB (minified) JSON

I love the idea of this tool, and the demo looks really cool too!

Installation worked flawlessly with cargo install jnv, but when I fired it up on a real JSON I had looked at with jq earlier, I noticed it was painfully slow, unusably slow, response times were on the order of 5-10 seconds after each key stroke.

Of course this is v0.1.0 - but just wanted to give feedback nonetheless from my real world test drive.

I'm on an M1 Pro with 32GB RAM which is fairly high end.

I tried reducing the display depth but that didn't help.

Preview text too dark

The text is quite a bit too dark to be readable in "preview" mode, i.e. when tabbing through keys:

image

I don't have any visual impairment so if I struggle it's likely impossible to read for people who don't have perfect vision.

In particular the dim blue can't be read against the black background.

It seems that your terminal shows the blue a bit differently:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.