✅ creating a CLI application
I don’t know if these are similar to console apps or not but I want to create a CLI program that is tailored for me I just don’t know how or where to start. Ideas?
13 Replies
dotnet new console
And that’s going to start me on a project that will allow me to open up a command prompt and type something like
myapp create <project_name> <destination_dir>
?
Like a pip installation type ordeal. That’s what I’m wanting to makeYes
Compile it to
myapp.exe
There are libraries that make it easier, too
Spectre.Console.Cli
for exampleOk so magic question. I get it all built. It’s working wonderfully. How do I make it “online” like pip?
What do you mean by "online"?
How do you upload your app somewhere where other people can download it from?
How do you host the packages your app can download?
My fault. Very vague questions lol
1. How do I shorten it from
myapp.exe
to just myapp
2. How do I, or where do i, upload the app (or self host) so that I can use it?
And also, long time no chat lol how you need ZZZZ?1. Usually, by adding it to the
$PATH
environment variable
2. Github releases, should your project be open-source and also on Github. Otherwise, any random blob storage and your own website.
Also, registries like Winget, Chocolatey, Scoop, etcAny user will need to download the app, do you mean you want to stream the output of your console to a website ?
No. The purpose of the app is I’m tired of manually creating projects and workspaces so I’m starting it off tailored more for me, but I plan to grow it. It’s going to start off supporting Python, JS, and C# projects. The project also asks for your top level directory for your projects so if you have a folder called programming and you build all of your projects in that folder , then that’s your top level directory. You’d give it the full path
C:\…myTopLevelDir
Example: I want to start building a new discord bot in Python using the disnake framework. I’ll type in console myapp create python bot disnake
. Where create is the function, Python is the language, bot is the type of program (other options are desktop, web, and mobile) and disnake is the library. It’ll then create the project directory in the destination you have it during setup and then itll create some start files for you. Main.py with a bot class. A Commands, Events, and Tasks folder with a file in each of an example item for each file and so on for the entire project
So I’ll need to add an option during setup for adding the program to path
I can create my program and then put it on pip?
Or dotnet actuallyPip is a Python package manager
Yes, you can release it on Nuget as a tool
Oh ok cool
Then it can be installed with
dotnet tool install MekasuSuperTool
And ran with dotnet MekasuSuperTool
Ok awesome. I have a lot to do then 🥰🥰