How to create your own .NET CLI tools to make your life easier

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

КОМЕНТАРІ • 141

  • @ashotjanibekyan4163
    @ashotjanibekyan4163 2 роки тому +123

    Came to learn about .NET CLI tools, as a result, learnt that US has a city named Rome.

    • @brianm.9451
      @brianm.9451 2 роки тому +6

      Most US states have a town named Rome.

    • @Phroggster
      @Phroggster 2 роки тому +6

      There's 18 towns or cities named Rome in the United States. Not quite the majority, but yes, many states are home to a Rome.

    • @TimMattison
      @TimMattison 2 роки тому +2

      And Paris, and London… there are a lot of dupes

    • @WillEhrendreich
      @WillEhrendreich 2 роки тому +2

      You should check out all the stolen town names in Wisconsin. It's like it's so cold here, we're willing to kid ourselves about what our towns should be named.. Just to feel like we're not here. Lol.

    • @josmitube
      @josmitube 2 роки тому

      This channel is so informative!

  • @greatmaker957
    @greatmaker957 2 роки тому +30

    I've been doing it the hard way this whole time, I literally made a CLI tool over the weekend and went the environmental variables route. Thanks for the info 👌

  • @NelsonTamayo
    @NelsonTamayo 2 роки тому +20

    Always delivering good content and straight to the point. Thanks man!

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

    This was better than the Microsoft docs themself. Great video!

  • @flash3621
    @flash3621 2 роки тому +1

    I love these videos! I only found you recently but I am already a big fan! Good content, always learning something new... amazing!

  • @HaberzettelJNM
    @HaberzettelJNM 2 роки тому +2

    Hello, great video.
    To go further, I think, it might be interresting to talk about some nuget packages to managing properly arguments with documentation and '-h'/'--help'.

  • @jamienordmeyer4345
    @jamienordmeyer4345 2 роки тому

    Well done as usual! I've never really thought about doing this, but I'm inspired now. Definitely going to look into any processes that I have at home and at work that I can wrap up this way! Thanks for the great content!

  • @lincolntx98
    @lincolntx98 2 роки тому +1

    Always nice to know how this work, as i'm watching it i was thinking that a great video would be something similar to this one, but on how to publish libs to use in other dotnet projects

  • @Il4o1
    @Il4o1 2 роки тому +6

    Can you share what custom theme are you using for the Windows Terminal?

  • @acasorran
    @acasorran 2 роки тому

    Great video, thanks! 👏This with Cocona and Refit, you don't need more

  • @diego_samano
    @diego_samano 2 роки тому +8

    Actually most interested on your Windows Terminal (is Windows Terminal right?) setup. Is that a theme or a teak, looks really nice, have a personal preference on Git Bash cause it includes some cool unix-like commands and already setup some minimalistic way to track git changes but that look and feel really caught my attention 👀.
    PS: All roads lead to Rome.

    • @Z4ch4r
      @Z4ch4r 2 роки тому

      that's the first point where my seesight came - for me it's a Windows Terminal, but maybe some plugin or some custom tool?

    • @mobiletonster
      @mobiletonster 2 роки тому +2

      @@Z4ch4r Scott Hanselman's blog shows how to configure the windows terminal with all that cool stuff.

    • @Z4ch4r
      @Z4ch4r 2 роки тому

      @@mobiletonster will find it out, thank you.

  • @carlynield8518
    @carlynield8518 2 роки тому

    So clear & concise. You're the man.

  • @st0chast
    @st0chast 2 роки тому

    hell yeah, the first .Net app I made on my own was a minimal htop for Windows, and this is exactly what would make it so much more usable :D

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

    Realy cool! Awesome content!

  • @xxdeadmonkxx
    @xxdeadmonkxx 2 роки тому +3

    imagine that the robbers rush in and you slowly type "defence system on"

  • @aurinator
    @aurinator 2 роки тому +2

    Surprised this video hasn't ended up being a "stealth" announcement for NickSharper's public release... :D

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

    Thanks!

  • @DonRolling
    @DonRolling 2 роки тому

    Nick, this is awesome, as usual.

  • @bbabak2
    @bbabak2 2 роки тому

    Short but very good!

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

    You forgot to mention that .NET CLI tooling is a feature of .NET SDK, not .NET Runtime. This is important if you're planning to distribute .NET CLI tools to your non-developer coworkers. You'll be out of luck.

  • @sulmarpl
    @sulmarpl 2 роки тому +1

    Great tutorial! How do you get your Windows Terminal look?

  • @Raptorjoe55
    @Raptorjoe55 2 роки тому +3

    Is this the same as if I would add the path to the .exe file in the PATH environmental variable? I get that this is much faster and I won't have to "install" my app somewhere manually. I'm just curious what's happening behind the scene.

  • @xxx.xxx.xxx.xx1joker706
    @xxx.xxx.xxx.xx1joker706 2 роки тому

    Awesome as always.

  • @qchaudhry1
    @qchaudhry1 2 роки тому

    "What?! the US has a Rome?" 😂
    Great video as always.

  • @brianm1864
    @brianm1864 2 роки тому +2

    Another great video! But ummmm... goto?

    • @nickchapsas
      @nickchapsas  2 роки тому +4

      Let's not talk about that

    • @brianm1864
      @brianm1864 2 роки тому +2

      @@nickchapsas Ha ha and here I was hoping for a future "Valid uses for goto and why you should use it" video!!

  • @shine1037
    @shine1037 2 роки тому +1

    When will be the .NET api microservices with Azure course will be out?

  • @sunilanthony17
    @sunilanthony17 2 роки тому

    What theme are you using for oh-my-posh?

  • @yaraslauhadunou547
    @yaraslauhadunou547 2 роки тому

    What a surprise - cool video again )

  • @NemesisA5
    @NemesisA5 2 роки тому

    Thanks Nick

  • @ChristopherSalisburySalz
    @ChristopherSalisburySalz 2 роки тому

    How is this different from creating a console app? Is CLI a project type?

  • @barbosa-renan
    @barbosa-renan 2 роки тому

    Nice! That's awesome video.

  • @Quantum_Quester
    @Quantum_Quester 2 роки тому +3

    Thanks for sharing !
    Does anyone know how I can get those beautiful icons showing in the terminal on visual studio terminal ?

  • @CRBarchager
    @CRBarchager 2 роки тому

    6:32 US also have a Denmark. Infact it has 15. Australia has 1 too.

  • @alexclark6777
    @alexclark6777 2 роки тому +1

    The real surprise was the "goto" command I saw buried in the code, but I assume this is a side effect of using minimal API?

    • @nickchapsas
      @nickchapsas  2 роки тому +2

      It's a side effect of me being lazy

    • @alexclark6777
      @alexclark6777 2 роки тому +1

      @@nickchapsas You crack me up man. Have a great Christmas, I look forward to more content from you next year!

    • @nickchapsas
      @nickchapsas  2 роки тому

      @@alexclark6777 Happy holidays!

  • @raghavsood28
    @raghavsood28 2 роки тому

    What IDE are you using?

  • @thespicycoder5583
    @thespicycoder5583 2 роки тому

    01:00 Clever clue to show a video on Tye is comming shortly 😎

    • @nickchapsas
      @nickchapsas  2 роки тому +1

      Hehe, yeah it was shot before the cli one. In fact it’s what gave me the idea to make this video

  • @libberator5891
    @libberator5891 2 роки тому

    I was expecting that last line to do something like `end video`

  • @lincolntx98
    @lincolntx98 2 роки тому

    hey nick nice video as usual, what is the theme that u are using on power shell?

    • @nguyenxuanquang9864
      @nguyenxuanquang9864 2 роки тому

      ua-cam.com/video/VT2L1SXFq9U/v-deo.html here you are.

    • @lincolntx98
      @lincolntx98 2 роки тому

      @@nguyenxuanquang9864 thank you!

  • @florianernst6340
    @florianernst6340 2 роки тому

    Nice video :D Which terminal do you use?

    • @nickchapsas
      @nickchapsas  2 роки тому

      Windows Terminal with oh-my-posh installed

  • @quicktastic
    @quicktastic 2 роки тому

    There is a Rome, New York. Probably many others. :)

  • @norbertkimario8285
    @norbertkimario8285 2 роки тому +1

    Curios on how the lights on and off works from cli

  • @Kolyan4ik95
    @Kolyan4ik95 2 роки тому

    Hey Nick! Why the framework selector is disabled 1:45 and how to enable it? I really suffer from this ((

  • @fakhrulhilal
    @fakhrulhilal 2 роки тому

    Do we have a way to store the tool on the cloud but privately, so we can get pre-compiled build and sync it from anywhere (f.e. personal laptop, office PC)? Currently, I use powershell core to do something like this, store in git private repo, and sync between personal laptop and office PC. Both leverages dotnet, but no compilation needed. Of course, it will be slower than pre-compiled build. But what I really like a most, its built-in autocomplete feature. Just define parameter and the shell will do the rest. In contrast with most CLI tool that I need to see help command any time I forget🤣

    • @pilotboba
      @pilotboba 2 роки тому

      You can host a nuget repository yourself if you want.

    • @fakhrulhilal
      @fakhrulhilal 2 роки тому

      @@pilotboba unfortunately, that's a bit complicated, compared to my current solution

  • @LilPozzer
    @LilPozzer 2 роки тому

    so great!

  • @jaredlash5002
    @jaredlash5002 2 роки тому +1

    I'm pretty interested in how to take this and use it in Linux, especially as a local (individual user) install.

    • @nickchapsas
      @nickchapsas  2 роки тому +3

      You can use exactly what you see here in linux as it is

    • @purplep3466
      @purplep3466 2 роки тому

      Glad you're supporting open-source stuff and using GNU/Linux :D

  • @lukaszluczko
    @lukaszluczko 2 роки тому

    Hi, when can We expect part two?

  • @sodreigor
    @sodreigor 2 роки тому

    Nice terminal. Were you inspired by Scott?

  • @shanehebert396
    @shanehebert396 2 роки тому

    There are a number of "Rome" in the USA ;) Just like many other European city names ;)

  • @scwyldspirit
    @scwyldspirit 2 роки тому

    Yeah Rome GA

  • @chriss8971
    @chriss8971 2 роки тому +1

    How dare you diss the weather in London.🤣

    • @nickchapsas
      @nickchapsas  2 роки тому +1

      Hey I’ve been living here for the past 10 years. I love it but it’s as stereotypical as it gets

  • @HenrryPires
    @HenrryPires 2 роки тому

    Hi. What shell is that that shows all the colorful things at the beginning of the line?

    • @nickchapsas
      @nickchapsas  2 роки тому +1

      It’s windows terminal with oh-my-posh installed

  • @queenstownswords
    @queenstownswords 2 роки тому

    So if you want to get the weather in Hell, do you get the weather in Hell Wyoming?

  • @fredimachadonet
    @fredimachadonet 2 роки тому

    Cool!

  • @Phroggster
    @Phroggster 2 роки тому

    There are 18 towns or cities named Rome in the United States, and 25 of them in total throughout the world.

  • @JumpMetler
    @JumpMetler 2 роки тому

    Why not compiling the program and copy paste the resulting .exe into system32?

  • @Ofeth
    @Ofeth 2 роки тому

    Hi Nick I have a question what is the name of the extension you use to display the paths in the CLI like that?

    • @nickchapsas
      @nickchapsas  2 роки тому +1

      oh-my-posh

    • @ayodahunsi
      @ayodahunsi 2 роки тому

      This is how to create something similar: www.hanselman.com/blog/my-ultimate-powershell-prompt-with-oh-my-posh-and-the-windows-terminal

    • @Ofeth
      @Ofeth 2 роки тому

      Thanks 🙏

  • @Kamuisakeu
    @Kamuisakeu 2 роки тому

    What terminal is this that you are using Nick?

    • @nickchapsas
      @nickchapsas  2 роки тому

      It's Windows Terminal with oh-my-posh

  • @dnzkrblt
    @dnzkrblt 2 роки тому

    Rome is the largest city in and the county seat of Floyd County, Georgia, United States.

  • @stigmag
    @stigmag 2 роки тому

    What is the terminal you are using?

    • @nickchapsas
      @nickchapsas  2 роки тому

      Windows Terminal with oh-my-posh

    • @stigmag
      @stigmag 2 роки тому

      @@nickchapsas windows terminal with powershell ?

    • @pilotboba
      @pilotboba 2 роки тому

      @@stigmag You can use most any shell in windows terminal, cmd, powershell, pwsh,, bash, etc.

  • @SirBenJamin_
    @SirBenJamin_ 2 роки тому +2

    What is the benefit of using async in a console app? as it's no like a general UI app where you show loading bars while waiting on the task.

    • @nickchapsas
      @nickchapsas  2 роки тому +3

      Async is used for ANY type of non-blocking IO. UI is only one of them. Networking IO such as file sysstem reading, API calls or DB calls, all benefit from await async due to non blocking IO properly cascading in your console app.

  • @soverain
    @soverain 2 роки тому

    All my tooling as a Unity developer is made with node.js. Same principle. Makes life way easier for us, lazy developers!

  • @anderskehlet4196
    @anderskehlet4196 2 роки тому

    Tool command name can be an emoji.
    Just putting that out there.

  • @HarshColby
    @HarshColby 2 роки тому

    Rome, Georgia, USA is not too far from me

  • @rockymarquiss8327
    @rockymarquiss8327 2 роки тому

    They should burn goto statements... a quick way for spegetti code

  • @DonellyMesrine
    @DonellyMesrine 2 роки тому +1

    Is there any benefit to use if city == null vs if city is null?

    • @pawehalladin
      @pawehalladin 2 роки тому

      Currently no benefits. stackoverflow.com/questions/40676426/what-is-the-difference-between-x-is-null-and-x-null

    • @nickchapsas
      @nickchapsas  2 роки тому +11

      The logic between the two is different. is will always check whether the reference is null. == will use the equals operator which can be overloaded, meaning that == null can be changed to return something else even if the reference is null. Basically is and is not are safer

    • @matigramirez
      @matigramirez 2 роки тому

      @@nickchapsas luckily for us Rider users, Rider displays overloaded operators in a different color so if you're using an external library that uses overloads you'll be able to tell right away if it will behave like you expect (I don't know if VS supports this aswell)

    • @DonellyMesrine
      @DonellyMesrine 2 роки тому

      @@nickchapsas Thank you!

  • @MintoIssac
    @MintoIssac 2 роки тому

    Ok, is that an zsh terminal ?

    • @nickchapsas
      @nickchapsas  2 роки тому +2

      That's Windows Terminal running Powershell with oh-my-posh

  • @Anhar001
    @Anhar001 2 роки тому +1

    So the only issue with using .NET as a "CLI" is that you would have to have an entire CLR Virtual Machine installed on the target machine, OR you would have to do some AOT compilation but that produces huge binaries, there is also the option to bundle everything into a single folder (this includes the entire runtime) again all of these options are not good.
    For true CLIs it's better to stick to real native languages such as C/C++/Go/Rust (go isn't truly native because it has a GC runtime but for a building a CLI in most instances that will not be a problem)

  • @antibioticaddict
    @antibioticaddict 2 роки тому

    Which Terminal extension is that?

  • @munikeilman4880
    @munikeilman4880 2 роки тому

    I tried it. But it didn't work for my program because in my solution I have -reference- multiple projects. It is unclear to me how to add reference projects to the pack command.
    The feature to install globally is nice though.
    Edit: After some googling it seems that adding project references to the pack command is not trivial :(

    • @nickchapsas
      @nickchapsas  2 роки тому +1

      I have no idea what the problem you're facing is. I never had a problem with packing a projec thtat has other referenced projects. Pack should take care of it

    • @munikeilman4880
      @munikeilman4880 2 роки тому

      @@nickchapsas I get a similar error as this 1:
      NU1101: Unable to find package JOS.MyNugetPackage.Core. No packages exist with this id in source(s): Dotnet Roslyn, Local feed, Microsoft Visual Studio Offline Packages, nuget.org
      I googled: dotnet pack referenced projects
      And the first hits are a blog that describes the problems and a stackoverflow thread.
      Stackoverflow thread is: stackoverflow.com/questions/40396161/include-all-dependencies-using-dotnet-pack
      Blog with description is: josef.codes/dotnet-pack-include-referenced-projects/

  • @ZephrymWOW
    @ZephrymWOW 2 роки тому

    US has multiple cities named Rome lol. New York and Georgia

  • @JANDRESCR
    @JANDRESCR 2 роки тому

    what console configuration is that?

  • @brianm.9451
    @brianm.9451 2 роки тому

    It thought you wanted weather for Rome, Georgia. 💀

  • @nicktech2152
    @nicktech2152 2 роки тому +1

    Plot twist: Nick doesnt actually dispose api keys and just hopes we believe him

    • @nickchapsas
      @nickchapsas  2 роки тому +2

      Not gonna lie, I disposed it 10 minutes before the video went live

    • @nicktech2152
      @nicktech2152 2 роки тому

      @@nickchapsas I’m sure you did 😄 But I’m just kidding

    •  2 роки тому

      @@nickchapsas Speaking of key, it is packed within the CLI right? What would be the approach if we want to publish the CLI and let the user uses hi own key?

  • @aldenvar
    @aldenvar 2 роки тому

    The us have even Carthage ! xD

  • @clearlyunwell
    @clearlyunwell 2 роки тому

    👍🏽

  • @manuelornato3722
    @manuelornato3722 2 роки тому

    Did I just see a label and a goto !!?? 😂

    • @nickchapsas
      @nickchapsas  2 роки тому +1

      Let's not talk about that part 😂

  • @alexcoronasaltemir8334
    @alexcoronasaltemir8334 2 роки тому

    Anyone knows what Terminal is he using?

  • @Sebastian----
    @Sebastian---- 2 роки тому +1

    Total War: ROME 2 (US-Version)

  • @marvelcz8974
    @marvelcz8974 2 роки тому

    Where is my tinfoil hat ... i was researching this yesterday.

  • @magashkinson
    @magashkinson 2 роки тому

    make the video about how to customize power shell

  • @ws_stelzi79
    @ws_stelzi79 2 роки тому

    in this video we really learned that the US has a city called Rome. 😏

  • @GosuD
    @GosuD 2 роки тому

    do US has a Rome........ anyway.... :D

  • @withoutsin
    @withoutsin 2 роки тому

    Rome, Georgia, United States.

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

    Fantastic video. I create cli tools for myself but have never installed them as a tool. Where do they install to? One of my tools needs config files.
    Update: I found it: ~\.dotnet\tools\.store\gtconfig\1.0.0\gtconfig\1.0.0\tools
    et7.0\any