How to Create Custom CLIs for Internal Developer Platforms with Nushell

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 36

  • @freeo6242
    @freeo6242 10 часов назад +1

    I was contemplating to go this route for quite a while. I'm even considering going all-in on nushell by replacing most of the bash scripts wherever I can. I think it's the first ever contender since the dawn of bash, that might replace bash. Everywhere.
    Your support for nushell strengthens this idea. Thanks for this video.

  • @wladyx
    @wladyx 12 дней назад +1

    I use taskfiles for similar usecases, it can remote import other taskfile (from git for example) and combined with devbox you get all the dependencies needed. Thanks Viktor, keep them coming! Glad to see you are preparing for the upcoming IDP videos :D

  • @danieladari
    @danieladari 10 дней назад +3

    Would recommend anyone writing a CLI in Python to explore the Typer and Sh libraries! They make writing awesome CLIs fun again :)

  • @stef9019
    @stef9019 14 дней назад +2

    Nushell is definitely the best thing I've started using last year. Starting 2025 all my scripts will be written in it (unless the team really wants bash etc etc)

  • @IvanRizzante
    @IvanRizzante 12 дней назад +1

    Thanks to another great video! I think Nushell is a great shell, it definitively simplify CLI development, even if just for the way it handles pipelines and data manipulations.

  • @Denis-ez8gd
    @Denis-ez8gd 14 дней назад +16

    When scripts start requiring a reusable library, I personally prefer switching to Go.

  • @edwardpius5367
    @edwardpius5367 14 дней назад +1

    Thanks again for this very helpful Video!

  • @DevOpsToolkit
    @DevOpsToolkit  14 дней назад +2

    What do you think of Nushell? Does it make sense to have something in between Bash and, let's say, Go?

  • @chandup
    @chandup 14 дней назад +2

    Good one. Do you know you can build CLIs using Taskfile as well? Try building a cli using Taskfile, you’ll enjoy doing it. I used both nushell and Taskfile to build CLIs. Both are good. Combining both is something I’m exploring next.

    • @DevOpsToolkit
      @DevOpsToolkit  14 дней назад +1

      I love Taskfile. I think they are very different though. Task is focused more on executing task (hence the name) and is closer to workflow tools like Jenkins or `make`. Both execute tasks one after another or in parallel. Nushell is a programming language. The end result might look similar to users of the end result but how you define it is different. That is not to say that one is better than they other but, rather, that they work differently or, to be more precise, we write them differently.

    • @chandup
      @chandup 14 дней назад +2

      @@DevOpsToolkit you are right. That’s why I’m curious how it will work if combining both 😀

    • @DevOpsToolkit
      @DevOpsToolkit  14 дней назад +2

      @chandup I'd love to see it combined. Ping me when you have something.

    • @Jarek.
      @Jarek. 13 дней назад +3

      This is a good question. My experience is that - there are different levels: 1) for a single operation, without any complex data manipulation - I'm using a bash script. 2) For multiple operations in the CLI, where there are dependencies but without _complex data manipulation_ - my tool of choice is *just* (and for you it will be *taskfile* ) 3) Only when I need to build a full-blown CLI with a lot of different endpoints - I use *nushell* . Admittedly, I don't think I'd mix *taskfile/just* with *nushell* , mainly because of the overlap in functionality.

  • @Requiem100500
    @Requiem100500 7 дней назад +1

    Nushell not having job control is a deal breaker for me.
    I always come to the point where I want to optimise certain parts of my scripts by running tasks in parallel (even if the script was originally fully sequential), and in bash it's as simple as command1 & command2, but in nushell it's sadly not supported.

    • @DevOpsToolkit
      @DevOpsToolkit  7 дней назад

      Have you seen par-each (www.nushell.sh/book/parallelism.html#par-each)?

    • @DevOpsToolkit
      @DevOpsToolkit  7 дней назад

      As a side note, command1 & command2 is not running in parallel. If you put it to background it is, but then you might have trouble getting results and potential issues with environment variables and a few other things.

  • @Toacher81
    @Toacher81 14 дней назад +2

    This is what i did for years with powershell before i switched to devops job and More out of Windows world. Have to start testing this 👍. Any experience compared to doing same things on Linux with powershell 7?

    • @DevOpsToolkit
      @DevOpsToolkit  14 дней назад +2

      I haven't used it in many years. Back in the day when I was, it was working only on Windows. I haven't been doing anything Windows-related for a long time and I completely missed that (for a long while now) Powershell actually works everywhere. I'll need to try it out.
      P.S. I know what I'm about to say is silly, but I'll say it anyway. I just went to check it out and got immediately annoyed by it capitalizing the first letter of each word in commands and adding a hyphen in between (e.g., `Write-Progress`). I know it does not matter but the "Linux" person in me freaks out when seeing it.

    • @Toacher81
      @Toacher81 13 дней назад +2

      @DevOpsToolkit actually iv been too started to get annoyed by Windows captalizations 😄

    • @arieheinrich3457
      @arieheinrich3457 13 дней назад +2

      @@DevOpsToolkit you dont have to follow capitalization, it will run the same, and you can create an alias if you want to even shorten it, even though some of based commands have a shorter alias builtin

    • @DevOpsToolkit
      @DevOpsToolkit  13 дней назад +2

      @arieheinrich3457 that's great to know and gives me higher motivation to try it out. As i mentioned earlier, it's been years since i used it very briefly (it was windows-only back then) so I know close to nothing about it. That will be my weekend project 🙂

    • @arieheinrich3457
      @arieheinrich3457 13 дней назад +1

      @@DevOpsToolkit I dont mind opening a Pull request into your repo with the equivalent commands to get to the same end result, but i don't want to take the adventure of learning yourself, the bad things and the good things.

  • @Danielo515
    @Danielo515 13 дней назад +3

    I find mind-blowing that I can understand the gusta of code you showed without any knowledge of the language or even color Syntax. That said, next time please don't just cat out the code, use a proper editor with syntax support

    • @DevOpsToolkit
      @DevOpsToolkit  13 дней назад

      I use bat to show code in a terminal. That gives me syntax highlighting without the clutter of IDE. That being said, nutshell is one of few formats that are still not supported in bat so this video is an exception when syntax coloring is concerned.

    • @ClearerThanMud
      @ClearerThanMud 3 дня назад +1

      @@DevOpsToolkit Did a spelling corrector help you type nutshell? 😃

  • @ech0lan911
    @ech0lan911 14 дней назад +4

    i use bashly

    • @DevOpsToolkit
      @DevOpsToolkit  14 дней назад +1

      I haven't tried it yet. Adding it to my to-do list...

  • @mohamadtahmad8451
    @mohamadtahmad8451 14 дней назад +1

    I prefer go with kong :)

  • @ravidsinghbiz
    @ravidsinghbiz 14 дней назад +3

    Still can accomplish similar with Powershell 7.x

  • @arieheinrich3457
    @arieheinrich3457 13 дней назад +1

    Its funny how this is literally powershell

  • @thescourgeofathousan
    @thescourgeofathousan 14 дней назад +2

    Ansible

    • @DevOpsToolkit
      @DevOpsToolkit  14 дней назад +1

      Ansible is, indeed, a great choice for something like that.

  • @caseyphillips
    @caseyphillips 14 дней назад +1

    ugh, another one.. 👎