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

  Рет қаралды 52,585

Nick Chapsas

Nick Chapsas

Күн бұрын

Пікірлер: 144
@ashotjanibekyan4163
@ashotjanibekyan4163 3 жыл бұрын
Came to learn about .NET CLI tools, as a result, learnt that US has a city named Rome.
@brianm.9451
@brianm.9451 3 жыл бұрын
Most US states have a town named Rome.
@Phroggster
@Phroggster 3 жыл бұрын
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 3 жыл бұрын
And Paris, and London… there are a lot of dupes
@WillEhrendreich
@WillEhrendreich 3 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
Always delivering good content and straight to the point. Thanks man!
@flash3621
@flash3621 3 жыл бұрын
I love these videos! I only found you recently but I am already a big fan! Good content, always learning something new... amazing!
@jricardobaptista
@jricardobaptista Жыл бұрын
Thanks!
@Il4o1
@Il4o1 3 жыл бұрын
Can you share what custom theme are you using for the Windows Terminal?
@jamienordmeyer4345
@jamienordmeyer4345 3 жыл бұрын
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!
@xxdeadmonkxx
@xxdeadmonkxx 3 жыл бұрын
imagine that the robbers rush in and you slowly type "defence system on"
@laurentbajrami3688
@laurentbajrami3688 Жыл бұрын
This was better than the Microsoft docs themself. Great video!
@HaberzettelJNM
@HaberzettelJNM 3 жыл бұрын
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'.
@lincolntx98
@lincolntx98 3 жыл бұрын
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
@carlynield8518
@carlynield8518 3 жыл бұрын
So clear & concise. You're the man.
@diego_samano
@diego_samano 3 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
@@Z4ch4r Scott Hanselman's blog shows how to configure the windows terminal with all that cool stuff.
@Z4ch4r
@Z4ch4r 3 жыл бұрын
@@mobiletonster will find it out, thank you.
@st0chast
@st0chast 3 жыл бұрын
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
@acasorran
@acasorran 2 жыл бұрын
Great video, thanks! 👏This with Cocona and Refit, you don't need more
@Deltacasper
@Deltacasper 2 күн бұрын
Is there a second part that you mentioned to the video? Some advanced development of CLI tooling
@Quantum_Quester
@Quantum_Quester 3 жыл бұрын
Thanks for sharing ! Does anyone know how I can get those beautiful icons showing in the terminal on visual studio terminal ?
@jyrikgauldurson8169
@jyrikgauldurson8169 3 жыл бұрын
oh my posh for powershell
@nguyenxuanquang9864
@nguyenxuanquang9864 3 жыл бұрын
kzbin.info/www/bejne/jIWVfWSJjaukb7c here you are
@Raptorjoe55
@Raptorjoe55 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.
@francajosejunior
@francajosejunior 8 ай бұрын
Realy cool! Awesome content!
@DonRolling
@DonRolling 2 жыл бұрын
Nick, this is awesome, as usual.
@Kolyan4ik95
@Kolyan4ik95 3 жыл бұрын
Hey Nick! Why the framework selector is disabled 1:45 and how to enable it? I really suffer from this ((
@thespicycoder5583
@thespicycoder5583 3 жыл бұрын
01:00 Clever clue to show a video on Tye is comming shortly 😎
@nickchapsas
@nickchapsas 3 жыл бұрын
Hehe, yeah it was shot before the cli one. In fact it’s what gave me the idea to make this video
@CRBarchager
@CRBarchager 3 жыл бұрын
6:32 US also have a Denmark. Infact it has 15. Australia has 1 too.
@sulmarpl
@sulmarpl 3 жыл бұрын
Great tutorial! How do you get your Windows Terminal look?
@nickchapsas
@nickchapsas 3 жыл бұрын
Install oh-my-posh
@aurinator
@aurinator 3 жыл бұрын
Surprised this video hasn't ended up being a "stealth" announcement for NickSharper's public release... :D
@shine1037
@shine1037 3 жыл бұрын
When will be the .NET api microservices with Azure course will be out?
@sunilanthony17
@sunilanthony17 3 жыл бұрын
What theme are you using for oh-my-posh?
@qchaudhry1
@qchaudhry1 3 жыл бұрын
"What?! the US has a Rome?" 😂 Great video as always.
@xxx.xxx.xxx.xx1joker706
@xxx.xxx.xxx.xx1joker706 3 жыл бұрын
Awesome as always.
@ChristopherSalisburySalz
@ChristopherSalisburySalz 2 жыл бұрын
How is this different from creating a console app? Is CLI a project type?
@fakhrulhilal
@fakhrulhilal 3 жыл бұрын
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 3 жыл бұрын
You can host a nuget repository yourself if you want.
@fakhrulhilal
@fakhrulhilal 3 жыл бұрын
@@pilotboba unfortunately, that's a bit complicated, compared to my current solution
@barbosa-renan
@barbosa-renan 3 жыл бұрын
Nice! That's awesome video.
@yaraslauhadunou547
@yaraslauhadunou547 3 жыл бұрын
What a surprise - cool video again )
@bbabak2
@bbabak2 3 жыл бұрын
Short but very good!
@norbertkimario8285
@norbertkimario8285 3 жыл бұрын
Curios on how the lights on and off works from cli
@alexclark6777
@alexclark6777 3 жыл бұрын
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 3 жыл бұрын
It's a side effect of me being lazy
@alexclark6777
@alexclark6777 3 жыл бұрын
@@nickchapsas You crack me up man. Have a great Christmas, I look forward to more content from you next year!
@nickchapsas
@nickchapsas 3 жыл бұрын
@@alexclark6777 Happy holidays!
@jaredlash5002
@jaredlash5002 3 жыл бұрын
I'm pretty interested in how to take this and use it in Linux, especially as a local (individual user) install.
@nickchapsas
@nickchapsas 3 жыл бұрын
You can use exactly what you see here in linux as it is
@purplep3466
@purplep3466 3 жыл бұрын
Glad you're supporting open-source stuff and using GNU/Linux :D
@KvapuJanjalia
@KvapuJanjalia Жыл бұрын
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.
@raghavsood28
@raghavsood28 2 жыл бұрын
What IDE are you using?
@HenrryPires
@HenrryPires 3 жыл бұрын
Hi. What shell is that that shows all the colorful things at the beginning of the line?
@nickchapsas
@nickchapsas 3 жыл бұрын
It’s windows terminal with oh-my-posh installed
@brianm1864
@brianm1864 3 жыл бұрын
Another great video! But ummmm... goto?
@nickchapsas
@nickchapsas 3 жыл бұрын
Let's not talk about that
@brianm1864
@brianm1864 3 жыл бұрын
@@nickchapsas Ha ha and here I was hoping for a future "Valid uses for goto and why you should use it" video!!
@lukaszluczko
@lukaszluczko 3 жыл бұрын
Hi, when can We expect part two?
@Ofeth
@Ofeth 3 жыл бұрын
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 3 жыл бұрын
oh-my-posh
@ayodahunsi
@ayodahunsi 3 жыл бұрын
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 3 жыл бұрын
Thanks 🙏
@libberator5891
@libberator5891 3 жыл бұрын
I was expecting that last line to do something like `end video`
@JumpMetler
@JumpMetler 3 жыл бұрын
Why not compiling the program and copy paste the resulting .exe into system32?
@lincolntx98
@lincolntx98 3 жыл бұрын
hey nick nice video as usual, what is the theme that u are using on power shell?
@nguyenxuanquang9864
@nguyenxuanquang9864 3 жыл бұрын
kzbin.info/www/bejne/jIWVfWSJjaukb7c here you are.
@lincolntx98
@lincolntx98 3 жыл бұрын
@@nguyenxuanquang9864 thank you!
@DonellyMesrine
@DonellyMesrine 3 жыл бұрын
Is there any benefit to use if city == null vs if city is null?
@pawehalladin
@pawehalladin 3 жыл бұрын
Currently no benefits. stackoverflow.com/questions/40676426/what-is-the-difference-between-x-is-null-and-x-null
@nickchapsas
@nickchapsas 3 жыл бұрын
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 3 жыл бұрын
@@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 3 жыл бұрын
@@nickchapsas Thank you!
@SirBenJamin_
@SirBenJamin_ 3 жыл бұрын
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 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.
@florianernst6340
@florianernst6340 3 жыл бұрын
Nice video :D Which terminal do you use?
@nickchapsas
@nickchapsas 3 жыл бұрын
Windows Terminal with oh-my-posh installed
@Kamuisakeu
@Kamuisakeu 3 жыл бұрын
What terminal is this that you are using Nick?
@nickchapsas
@nickchapsas 3 жыл бұрын
It's Windows Terminal with oh-my-posh
@chriss8971
@chriss8971 3 жыл бұрын
How dare you diss the weather in London.🤣
@nickchapsas
@nickchapsas 3 жыл бұрын
Hey I’ve been living here for the past 10 years. I love it but it’s as stereotypical as it gets
@queenstownswords
@queenstownswords 3 жыл бұрын
So if you want to get the weather in Hell, do you get the weather in Hell Wyoming?
@Phroggster
@Phroggster 3 жыл бұрын
There are 18 towns or cities named Rome in the United States, and 25 of them in total throughout the world.
@antibioticaddict
@antibioticaddict 3 жыл бұрын
Which Terminal extension is that?
@nickchapsas
@nickchapsas 3 жыл бұрын
oh-my-posh
@quicktastic
@quicktastic 3 жыл бұрын
There is a Rome, New York. Probably many others. :)
@stigmag
@stigmag 3 жыл бұрын
What is the terminal you are using?
@nickchapsas
@nickchapsas 3 жыл бұрын
Windows Terminal with oh-my-posh
@stigmag
@stigmag 3 жыл бұрын
@@nickchapsas windows terminal with powershell ?
@pilotboba
@pilotboba 3 жыл бұрын
@@stigmag You can use most any shell in windows terminal, cmd, powershell, pwsh,, bash, etc.
@MintoIssac
@MintoIssac 2 жыл бұрын
Ok, is that an zsh terminal ?
@nickchapsas
@nickchapsas 2 жыл бұрын
That's Windows Terminal running Powershell with oh-my-posh
@Verrisin
@Verrisin Ай бұрын
in my times, we would just put it on the PATH. Invoking programs is the most basic of things, no? - For packaging it on nuget, same as npm or go, sure. Why not, that is useful; but how is one impressed by this as if it is a cool feature? XD - This is the same as any other package manager.
@Verrisin
@Verrisin Ай бұрын
you could put it on git and install it easily from there too.
@JANDRESCR
@JANDRESCR 3 жыл бұрын
what console configuration is that?
@nickchapsas
@nickchapsas 3 жыл бұрын
oh-my-posh
@LilPozzer
@LilPozzer 3 жыл бұрын
so great!
@sodreigor
@sodreigor 3 жыл бұрын
Nice terminal. Were you inspired by Scott?
@nickchapsas
@nickchapsas 3 жыл бұрын
Yep
@munikeilman4880
@munikeilman4880 3 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
@@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/
@NemesisA5
@NemesisA5 2 жыл бұрын
Thanks Nick
@soverain
@soverain 3 жыл бұрын
All my tooling as a Unity developer is made with node.js. Same principle. Makes life way easier for us, lazy developers!
@alexcoronasaltemir8334
@alexcoronasaltemir8334 2 жыл бұрын
Anyone knows what Terminal is he using?
@nickchapsas
@nickchapsas 2 жыл бұрын
I do! oh-my-posh
@alexcoronasaltemir8334
@alexcoronasaltemir8334 2 жыл бұрын
@@nickchapsas Thanks!
@anderskehlet4196
@anderskehlet4196 2 жыл бұрын
Tool command name can be an emoji. Just putting that out there.
@shanehebert396
@shanehebert396 3 жыл бұрын
There are a number of "Rome" in the USA ;) Just like many other European city names ;)
@dnzkrblt
@dnzkrblt 3 жыл бұрын
Rome is the largest city in and the county seat of Floyd County, Georgia, United States.
@rockymarquiss8327
@rockymarquiss8327 3 жыл бұрын
They should burn goto statements... a quick way for spegetti code
@fredimachadonet
@fredimachadonet 3 жыл бұрын
Cool!
@nicktech2152
@nicktech2152 3 жыл бұрын
Plot twist: Nick doesnt actually dispose api keys and just hopes we believe him
@nickchapsas
@nickchapsas 3 жыл бұрын
Not gonna lie, I disposed it 10 minutes before the video went live
@nicktech2152
@nicktech2152 3 жыл бұрын
@@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?
@Gray-Wolf-Media
@Gray-Wolf-Media 3 жыл бұрын
Yeah Rome GA
@brianm.9451
@brianm.9451 3 жыл бұрын
It thought you wanted weather for Rome, Georgia. 💀
@marvelcz8974
@marvelcz8974 3 жыл бұрын
Where is my tinfoil hat ... i was researching this yesterday.
@HarshColby
@HarshColby 3 жыл бұрын
Rome, Georgia, USA is not too far from me
@manuelornato3722
@manuelornato3722 3 жыл бұрын
Did I just see a label and a goto !!?? 😂
@nickchapsas
@nickchapsas 3 жыл бұрын
Let's not talk about that part 😂
@Anhar001
@Anhar001 3 жыл бұрын
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)
@ZephrymWOW
@ZephrymWOW 3 жыл бұрын
US has multiple cities named Rome lol. New York and Georgia
@Sebastian----
@Sebastian---- 3 жыл бұрын
Total War: ROME 2 (US-Version)
@aldenvar
@aldenvar 3 жыл бұрын
The us have even Carthage ! xD
@clearlyunwell
@clearlyunwell 3 жыл бұрын
👍🏽
@ws_stelzi79
@ws_stelzi79 3 жыл бұрын
in this video we really learned that the US has a city called Rome. 😏
@GosuD
@GosuD 3 жыл бұрын
do US has a Rome........ anyway.... :D
@magashkinson
@magashkinson 3 жыл бұрын
make the video about how to customize power shell
@nguyenxuanquang9864
@nguyenxuanquang9864 3 жыл бұрын
Herr you are kzbin.info/www/bejne/jIWVfWSJjaukb7c
@withoutsin
@withoutsin 3 жыл бұрын
Rome, Georgia, United States.
@kolesplace
@kolesplace 2 жыл бұрын
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
Stop using the Process class for CLI interactions in .NET
15:04
Nick Chapsas
Рет қаралды 52 М.
You are doing .NET logging wrong. Let's fix it
25:29
Nick Chapsas
Рет қаралды 175 М.
"Идеальное" преступление
0:39
Кик Брейнс
Рет қаралды 1,4 МЛН
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН
Make the .NET CLI Your Best Friend | .NET & C# Essentials
19:41
Amichai Mantinband
Рет қаралды 16 М.
This is Best Way To Create CLI Apps in .NET
13:24
Nick Chapsas
Рет қаралды 69 М.
8 await async mistakes that you SHOULD avoid in .NET
21:13
Nick Chapsas
Рет қаралды 317 М.
Don't throw exceptions in C#. Do this instead
18:13
Nick Chapsas
Рет қаралды 265 М.
Intro To The .NET CLI - How To Use It, Why We Need It, And More
43:14
Cleaner C# code with "smart" using statements
16:30
Nick Chapsas
Рет қаралды 64 М.
What are record types in C# and how they ACTUALLY work
15:36
Nick Chapsas
Рет қаралды 123 М.
Visual Studio Code for C# Developers | .NET Conf 2022
26:33
7 awesome improvements for LINQ in .NET 6
14:33
Nick Chapsas
Рет қаралды 214 М.
Writing My Own Database From Scratch
42:00
Tony Saro
Рет қаралды 264 М.