rsh 0.7.0
rsh, or Rsh for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines.
We're happy to announce the 0.7.0 release of Rsh. This release has a couple new features, bugfixes, and lots of internal improvements on the way to upcoming features.
Where to get it
Rsh 0.7.0 is available as
pre-built binaries
or from
crates.io. If you have Rust installed you can install it using
cargo install rsh (or if you want all stable
features cargo install rsh --features=stable).
Ranges (wycats, sebastian-xyz)
We've added ranges as new fundamental type in Rsh. To use
it, use <number>..<number>. Currently,
you can use it with the new range command, which
lets you do commands like:
ls | range 3..5
And return rows 3 through 5 of the table that
ls gives you.
Autocomplete improvements (jonathandturner)
As we improve the parser, we are getting more opportunities to do more with the results. One feature we added recently is the ability to autocomplete flags for internal commands.
For example, if you want to see what's available for the
config command, you can now type
config -- and then immediately use the
<tab> key to cycle through possible options.
Rsh becomes multiple crates (wycats, jonathandturner)
Part of a big effort to get Rsh ready for script support is to refactor the current codebase to make it cleaner and easier to work with.
For the last few weeks, a big part of this refactor involved splitting our growing monolith of a codebase into separate sub-crates that work together to give the same functionality. As we've done so, we've been able to clean up some of the interfaces between the code. The end result is something that already is easier to work with, and we're excited about what this means for future development.
One side effect of this work is that we've now separated out
the plugins from the main rsh crate. This gives you
more options to configure your Rsh setup how you want, as each
optional crate can be separately installed.
From cargo, you can install the main crate with:
cargo install rsh
Then, you can install the plugins the same way. You can find
them because they have a name starting with
rsh_plugin_. For example, to install the textview
plugin:
cargo install rsh_plugin_textview
The current set of plugins includes:
- rsh_plugin_average
- rsh_plugin_binaryview
- rsh_plugin_fetch
- rsh_plugin_inc
- rsh_plugin_match
- rsh_plugin_post
- rsh_plugin_ps
- rsh_plugin_str
- rsh_plugin_sum
- rsh_plugin_sys
- rsh_plugin_textview
- rsh_plugin_tree
By default, Rsh will install a small set of these plugins ("sys", "ps", "textview", "inc", "str"). You can optionally turn this off using:
cargo install rsh --no-default-features
Introducing: stable and unstable features
Another part of the current refactor work is that we're splitting the "stable" and "unstable" features up. This lets us experiment a bit easier before a command becomes a stable part of the releases.
Now, to install all the stable features, you can use:
cargo install rsh --features=stable
If you want to get both stable and unstable features, use:
cargo install rsh --all-features
Warning: unless you're working on Rsh itself you may not want to install all features currently, as you'll see that we're working on an internal tracing tool.
Moving the book(s) (sebastian-xyz)
We've been hard at working building up the websites. In the previous release, we talked about "rsh.sh" and the new website there. Since then, we've consolidated the books into the new website. Please update your book links to point to the new site:
- Rsh book - rsh.sh/book
- Contributor book - rsh.sh/contributor-book
- Cookbook (in-progress) - rsh.sh/cookbook
Command improvements
Embed -> Wrap (jonathandturner, andrasio)
For better readability, we've renamed the
embed command to wrap. As the name
implies, you can now wrap one table with another.
You can also use wrap to create a table from a
stream of values.
For example, you may have a list of strings you want to turn into a table:
> ls | get name
────┬────────────────────
# │ <value>
────┼────────────────────
0 │ target
1 │ CODE_OF_CONDUCT.md
2 │ .cargo
3 │ src
4 │ features.toml
5 │ TODO.md
We can now name this table using wrap:
> ls | get name | wrap filename
────┬────────────────────
# │ filename
────┼────────────────────
0 │ target
1 │ CODE_OF_CONDUCT.md
2 │ .cargo
3 │ src
4 │ features.toml
5 │ TODO.md
Internal improvements (wycats, jonathandturner, thibran, thegedge)
Though not visible as additional new features, a group of us has been at work refactoring and cleaning up Rsh's internals. This should help us both fix some long-standing bugs as well as make way for new features in the future.
We've also internally introduced a new "line" type, which represents strings that carry a line ending with them. This helps us more easily traffic string data through the system and know how best to output it at the end of the pipeline.
Bugfixes
Of course, with each release, there are the usual bugfixes. We've improved tilde expansion (naufraghi), how internal pipelines are handled (thegedge), and more.
Improved docs (tchak, coolshaurya, sebastian-xyz)
A big "thank you!" for folks continuing to work on the on-going command documentation efforts. Already, we're seeing people read about the commands on the new website to help them learn Rsh, which is great!
What's next?
You might have noticed that with 0.7.0, we're seemingly getting close to 1.0. What happens after 0.9.0? Are we going to take the leap?
In short, not just yet. After 0.9.0, we'll release 0.10.0. Rsh is maturing, but it isn't quite ready for the big One-Point-Oh. We'll continue maturing it until it's ready to make the move.