A fast interactive explorer tool for structured data inspired by nu-explore
- introduction
- installation
- usage
- configuration
- see the documentation locally
- troubleshooting
- contributing
- TODO
i think having an interactive explorer for structured data is a requirement for a shell like
Nushell!
the ability to
- traverse the data with a few quick key bindings
- peek the data at any level
- edit the data on the fly (COMING SOON)
- all while being configurable
will come very handy in a day-to-day basis for me at least :)
- it's a bit too complex for what it does to me
- the bindings are not configurable
- the code was really hard to wrap my head around
- i wanted to have fun learning about Nushell plugins and TUI applications in Rust
so here we are... LET'S GO 💪
Important if you are using bleeding-edge versions of Nushell, please make sure the Nushell dependencies are the same as your Nushell install by running
use scripts/deps.nu; deps --current
- download nushell/nupm
- load the
nupm
module
use /path/to/nupm/
- run the install process
nupm install --path .
- build the plugin
make build
- register the plugin in Nushell
make register
- do not forget to restart Nushell
Note
alternatively, you can use directlymake install
- get some help
help nu_plugin_explore
- run the command
open Cargo.toml | nu_plugin_explore
you can find it in default.nuon
.
you can copy-paste it in your config.nu
and set $env.config.plugins.explore
to it:
$env.config.plugins.explore = {
# content of the default config
}
alternately, you can copy-paste the default config file to $nu.default-config-dir
and add the following line to your config.nu
$env.config.plugins.explore = (open ($nu.default-config-dir | path join "nu_plugin_explore.nu"))
if you do not like the Vim bindings by default you can replace the navigation part with
$env.config.plugins.explore.keybindings.navigation = {
left: 'left',
down: 'down',
up: 'up',
right: 'right',
}
and voila 😋
cargo doc --document-private-items --no-deps --open
in case you get some weird error or behaviour, before filing any issue, the easiest is to make sure the plugin is compiled with the same revision as the Nushell you are using!
use scripts/deps.nu; deps --current
and then you can come back to the installation section.
Note of course, this will not work if the version of Nushell you are using is too old, because then the state of
nu_plugin_explore
will be too recent for everything to compile properly...
in order to help, you can have a look at
- the todo list down below, there might be unticked tasks to tackle
- the issues and bugs in the issue tracker
- the
FIXME
andTODO
comments in the source base
- support non-character bindings
- when going into a file or URL, open it
- give different colors to names and type
- show true tables as such
- get the config from
$env.config
=> can parse configuration from CLI - add check for the config to make sure it's valid
- support for editing cells in INSERT mode
- string cells
- other simple cells
- all the cells
- detect if a string is of a particular type, path, URL, ...
- add tests...
- to
navigation.rs
to make sure the navigation in the data is ok - to
app.rs
to make sure the application state machine works - to
parsing.rs
to make sure the parsing of the config works - to
tui.rs
to make sure the rendering works as intended
- to
- get rid of the
.clone
s - handle errors properly (
.unwrap
s andpanic!
s) - restrict the visibility of objects when possible
- write better error messages when some test fails