A tour around nushell - a modern replacement for zsh and bash based on structured data

Поділитися
Вставка
  • Опубліковано 27 вер 2024

КОМЕНТАРІ • 76

  • @JeremySeago
    @JeremySeago Рік тому +85

    Demonstrating a shell through VS Code was triggering 😅

    • @DanielBachler
      @DanielBachler  Рік тому +16

      😂 - I recorded this video for my co-workers and the fact that Vs code has a decent terminal and is cross platform is useful for us :)

    • @Mugruokgt
      @Mugruokgt 8 місяців тому +1

      Really it was…. 😂

    • @pierrebertram5555
      @pierrebertram5555 4 місяці тому

      Interesting

    • @malborocomun
      @malborocomun 3 місяці тому +1

      Disgusting

  • @odytrice
    @odytrice Рік тому +11

    OMG, This is awesome, I love how the columns are repeated on both sides of the table. This feels like what bash or zsh would look like if they were written in our modern era. Thanks Daniel

    • @DanielBachler
      @DanielBachler  Рік тому +2

      Hey Ody! Really nice to see that you like it too :). Let's catch up some time!

    • @odytrice
      @odytrice Рік тому

      @@DanielBachlerYeah absolutely

  • @rb.x
    @rb.x Рік тому +8

    Thanks for this! Just installed nushell on a recommendation and was wondering what I could do with it… looks like things have changed over the past couple of years so was glad to find your walkthrough. I’m excited!

  • @yos2413
    @yos2413 8 місяців тому +1

    Wow 7 months and I didn't know about that awesome vscode terminal feature, thanks, and thanks for the tip and for the video overall!

  • @Diamonddrake
    @Diamonddrake 10 місяців тому +10

    Power shell does things very similarly, structured data objects with filtering and conversions and formatted output and some 4000 cross platform built in modules and everyone seems to hate it. This looks nice though. Really like that you can tell it how to parse things it doesn’t natively understand

    • @DanielBachler
      @DanielBachler  10 місяців тому +4

      Yeah - Powershell had great ideas but the verbosity etc was not ideal. I think nushell really hits a sweet spot here.

    • @cokoala5137
      @cokoala5137 8 місяців тому +4

      A lot of the inspiration for nushell comes from powershell. The dev that created nushell used to work at Microsoft for a couple of decades

    • @TiagoJoaoSilva
      @TiagoJoaoSilva 2 місяці тому

      @@DanielBachler The verbosity is only recommended in scripts, so you can understand them next year when you need to update something. On the cli there are aliases, auto-complete, Ctrl-Space, and switches/parameters only need disambiguation (eg, no need to write '-Parameters', most of the time -Par is enough to disambiguate from -Path)

    • @skoovee
      @skoovee 16 днів тому

      powershell is so incredibly slow

  • @polimetakrylanmetylu2483
    @polimetakrylanmetylu2483 10 місяців тому +3

    Nushell saved me 10 minutes of formatting an ugly JSON file by hand by instead composing a chain of commands to do what I want. It took me a few hours, I was just starting using it, but being able to work with files in this way was so satisfying and definitely much nicer than Python!

    • @peppybocan
      @peppybocan 10 місяців тому +3

      or just learn to use jq.

  • @mineralisk
    @mineralisk 7 місяців тому +1

    nutshell sounds like if a Linux shell and PowerShell had a baby

  • @bripbrap
    @bripbrap 11 місяців тому +3

    Its like a good Powershell

  • @MatthewSherborne
    @MatthewSherborne 6 місяців тому +3

    `take 1 | transpose` == `first`

    • @DanielBachler
      @DanielBachler  6 місяців тому +2

      Good catch :) - when I recorded this video I wasn't so aware yet of all the useful functions. Thanks for signposting it so others can find it!

  • @lancemarchetti8673
    @lancemarchetti8673 Рік тому +1

    Really cool work!

  • @howardjones543
    @howardjones543 Рік тому +12

    This looks really nice! It's interesting that a lot of this has been in powershell for a really long time.

    • @howardjones543
      @howardjones543 Рік тому +2

      But wait, it also actually takes OUT options you already know. No "ls -ltr" for you anymore! "ls | sort-by modified" and no completion on that "modified" either. Definitely curious enough to play for a few days though.

    • @MarcelRiegler
      @MarcelRiegler Рік тому +13

      @@howardjones543 Yes, but on the other hand you learn once how to sort-by and can then sort all output of any command without finding out how that specific command does it.

  • @garciajero
    @garciajero Рік тому +5

    what problem would this be fixing ? i can't stop shivering at all those borders messing up every grep and xclip

    • @DanielBachler
      @DanielBachler  Рік тому +5

      Well the whole point is that you don't work on the textual level most of the time, so the borders you see are just generated when printing the results to the screen. Imagine you have a csv with a bunch of numeric columns and you want to select the rows that have a value between 0.4 and 0.6 in column A. This is really easy in Nushell because you open the csv file and then you just filter by parsed values. It can be done with traditional shell tools but it's quite more cumbersome in many cases.
      If all you ever need to do is to grep for precise text then yes, Nushell doesn't make that particular use case much easier; but it combines a lot better between different, hetherogeneous operaions.

    • @garciajero
      @garciajero Рік тому +1

      @@DanielBachler that’s doable in any shell awk first one that comes to mind

    • @only2sea
      @only2sea Рік тому +5

      @@garciajero You can do command | to tsv to make the output tsv without borders. It doesn't fix a problem, in my opinion, but it makes dealing with data easier by default, while you'd need additional | to tsv if you want the output useful for computers instead of human eyes.

    • @garciajero
      @garciajero Рік тому

      @@only2sea Im not really complaining about the borders much , i think it fixes a problem that nobody has this shell thing

    • @heyitsdross
      @heyitsdross Рік тому +5

      @@garciajero Awk has a high learning curve, with it being similar to a programming language on its own. Any shell that removes the need for such learning is worth looking into, in my opinion.

  • @hazardousnucleus659
    @hazardousnucleus659 8 місяців тому

    Is it possible that you share you nushell config file?

    • @DanielBachler
      @DanielBachler  8 місяців тому

      Sure! My nushell config is in an open git repo at github.com/danyx23/nu. It's a pretty messy workbench and not optimized for re-use but maybe still useful

  • @BrianWoodruff-Jr
    @BrianWoodruff-Jr Рік тому

    Why do you have a separate pyproject.toml and poetry.toml file? The poetry configuration can be inside the pyproject.toml file.

  • @georgekelly4856
    @georgekelly4856 Рік тому

    What vscode theme is this?

  • @angelustrindade132
    @angelustrindade132 Рік тому +3

    The pros of a terminal with the cons of vscode

  • @TheMqyable
    @TheMqyable 10 місяців тому

    It might be great, but unit it is not available in default repo on rhel and debian, I don't want even try it.

  • @JasonCunliffe
    @JasonCunliffe Рік тому +1

    hmmm
    ouchh
    Those borders just drive me nuts
    yuggly
    seems too verbose
    but piping functionally is cool
    Thanks for the demo intro!

    • @DanielBachler
      @DanielBachler  Рік тому +3

      If you dislike the default border style then try the other options :) www.nushell.sh/book/coloring_and_theming.html#table-borders

  • @danieleden1856
    @danieleden1856 Рік тому +3

    Great demo ! Very powerful shell, esp for people who like to manipulate data quickly at the shell

  • @filipeacaciooficial
    @filipeacaciooficial 5 місяців тому +1

    Great video!... What plugins are you using (Especially the one that lets you display details of the git repository)?

    • @DanielBachler
      @DanielBachler  5 місяців тому +1

      IIRC the only plugin I used was the query plugin (github.com/nushell/nushell/tree/main/crates/nu_plugin_query). The git stuff wasn't using any plugin but instead used the jc standalone utility (github.com/kellyjonbrazil/jc). Hope that helps!

  • @wondays654
    @wondays654 Рік тому +2

    Been using nutshell for the past 5-6 months. I don’t think I’ll be going back.

  • @Cammymoop
    @Cammymoop Рік тому +3

    This was way more interesting than i thought it would be

  • @ajbrady4357
    @ajbrady4357 Рік тому +3

    Feels too much like Powershell

    • @DanielBachler
      @DanielBachler  Рік тому +4

      I always felt that Powershell is clunky but it had some great ideas. To me, Nushell takes the best of Powershell and makes it nicely useable - but to each their own :)

  • @TooManyPBJs
    @TooManyPBJs 10 місяців тому +2

    the ls reminded me of a pandas dataframe

    • @DanielBachler
      @DanielBachler  10 місяців тому

      Yeah that is exactly right - it actually uses a dataframe library internally :)

  • @sullivan3503
    @sullivan3503 Рік тому +3

    It's almost like separating shell languages from "proper" programming languages was a huge mistake.

    • @DanielBachler
      @DanielBachler  Рік тому +1

      It's hard to make something that both works in a terse UI situation like a terminal but also at large scale. Are you thinking of a something specific? The closest that comes to mind for a good shell and a nice programming language would be Clojure with Babushka as a shell (github.com/babashka/babashka) - but I never got sufficiently comfortable with lisp syntax to enjoy that stack, even though I'm sure it's cool

    •  Рік тому

      Well, it’s not that someone decided to separate them. The requirement to handle text IO and to access the system just creates a set of features that makes them different to other more general programming languages.

    • @howardjones543
      @howardjones543 Рік тому +3

      considering many shells were written when a tty was ACTUALLY a 300 bps paper teletype, having the shell be as terse as possible made sense!

  • @michael-rommel
    @michael-rommel Рік тому +2

    You made me try rhis out... Thanks!!

  • @CNich90
    @CNich90 10 днів тому

    Awesome overview, thanks!

  • @QashbasJupiter
    @QashbasJupiter 4 місяці тому

    The wishes are sundunopulated

  • @intermarer9145
    @intermarer9145 6 місяців тому

    I searched around for about 10 minutes on how to install this on Linux Mint, but gave up in the end.

    • @DanielBachler
      @DanielBachler  6 місяців тому

      I don't know much about Linux Mint, but shouldn't it work to just download the binary from the release page? github.com/nushell/nushell/releases/tag/0.91.0

    • @intermarer9145
      @intermarer9145 6 місяців тому +1

      ​@@DanielBachlerYou see, I have an issue where I tend to overcomplicate things. Just downloading the binary worked of course... 😅

  • @somedude5990
    @somedude5990 Рік тому +2

    Looks interesting. Hope it gets popular so I can use it.

    • @Argletrough
      @Argletrough Рік тому +1

      Why would it have to be popular for you to use it?

  • @Nunya58294
    @Nunya58294 11 місяців тому +1

    Still not gonna replace my beloved Bash shell.

  • @cchance
    @cchance Рік тому +5

    Soooo… powershell? No?

    • @marcgranlund6156
      @marcgranlund6156 Рік тому +1

      as a Windows admin by day my take is: absolutely this is powershell for linux :D

    • @cchance
      @cchance Рік тому +1

      @@marcgranlund6156 well more so powershell for people who dislike MS still, since theirs already powershell for Linux :S

    • @DanielBachler
      @DanielBachler  Рік тому +6

      It definitely takes a lot of inspiration from Powershell! I worked with powershell before and I like the ergonomics of Nushell quite a lot more in the end. If you like powershell and work a lot in the terminal then definitely give Nushell a try

    • @nathanfranck5822
      @nathanfranck5822 Рік тому +2

      I've always used terminals super minimally and hesitantly, it's cool to know that both powershell and nushell can process tables like this, make me curious about both

  • @theodorealenas3171
    @theodorealenas3171 11 місяців тому

    It's nice, and fun to try things with. I was hoping for a cool demo though, like the joining between different data types you mentioned.
    I'm sorry, I'm not going to use it. I have a blast playing with it but no.
    Eventually I have to set boundaries with what a shell is and isn't.

    • @DanielBachler
      @DanielBachler  10 місяців тому +2

      Sure, to each their own :). I think it's also very valid to just come back once it reaches 1.0, at the moment there are definitely still a few things changing every month which not everyone might want to keep up wit

    • @theodorealenas3171
      @theodorealenas3171 10 місяців тому

      @@DanielBachler I mean, I don't mind the syntax changes. Okay I don't remember them either. Fundamentally, NuShell looks like it would go well with a text editor and a live repl, but for a command line interface... I'm not sold.

  • @khanra17
    @khanra17 Рік тому

    Amm amm amm

  • @AntoineamtoineStevan
    @AntoineamtoineStevan Рік тому +7

    wow thanks a lot for this very enjoyable video