command-line-api VS CommandLineUtils

Compare command-line-api vs CommandLineUtils and see what are their differences.

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
command-line-api CommandLineUtils
22 9
3,306 2,170
0.7% -
7.6 5.3
4 days ago about 1 month ago
C# C#
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

command-line-api

Posts with mentions or reviews of command-line-api. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-13.
  • DotMake Command-Line VS command-line-api - a user suggested alternative
    2 projects | 13 Dec 2023
    System.CommandLine is a very good parser but you need a lot of boilerplate code to get going and the API is hard to discover.
  • How to configure true dependency injection in System.CommandLine
    3 projects | dev.to | 20 Jun 2023
    using System.CommandLine.Invocation; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; namespace System.CommandLine.Builder; internal static class DependencyInjectionMiddleware { public static CommandLineBuilder UseDependencyInjection(this CommandLineBuilder builder, Action configureServices) { return UseDependencyInjection(builder, (_, services) => configureServices(services)); } // This overload allows you to conditionally register services based on the command line invocation context // in order to improve startup time when you have a lot of services to register. public static CommandLineBuilder UseDependencyInjection(this CommandLineBuilder builder, Action configureServices) { return builder.AddMiddleware(async (context, next) => { // Register our services in the modern Microsoft dependency injection container var services = new ServiceCollection(); configureServices(context, services); var uniqueServiceTypes = new HashSet(services.Select(x => x.ServiceType)); services.TryAddSingleton(context.Console); await using var serviceProvider = services.BuildServiceProvider(); // System.CommandLine's service provider is a "fake" implementation that relies on a dictionary of factories, // but we can still make sure here that "true" dependency-injected services are available from "context.BindingContext". // https://github.com/dotnet/command-line-api/blob/2.0.0-beta4.22272.1/src/System.CommandLine/Invocation/ServiceProvider.cs context.BindingContext.AddService(_ => serviceProvider); foreach (var serviceType in uniqueServiceTypes) { context.BindingContext.AddService(serviceType, _ => serviceProvider.GetRequiredService(serviceType)); // Enable support for "context.BindingContext.GetServices<>()" as in the modern dependency injection var enumerableServiceType = typeof(IEnumerable<>).MakeGenericType(serviceType); context.BindingContext.AddService(enumerableServiceType, _ => serviceProvider.GetServices(serviceType)); } await next(context); }); } }
  • C# .NET Tools with System.CommandLine
    3 projects | dev.to | 19 Mar 2023
    command-line-api
  • Pro .NET Console Apps
    1 project | /r/dotnet | 19 Mar 2023
    I wouldn't go so far as to call it a dead duck. The project is being actively worked on. https://github.com/dotnet/command-line-api
  • Show HN: Replbuilder, quickly build a Python REPL CLI prompt
    5 projects | news.ycombinator.com | 19 Feb 2023
    This looks really nice.

    I've been spending a lot of time with python lately because of new project work, I had never really used python before. It's been really cool to keep finding stuff like this.

    The equivalent of something like in the .net world (eg https://github.com/dotnet/command-line-api) and even powershell modules (https://learn.microsoft.com/en-us/powershell/module/microsof...) have a steeper learning curve and take significantly MORE work to set up for the end-user.

  • What is the best architecture for a Console app?
    2 projects | /r/dotnet | 24 Sep 2022
    https://github.com/dotnet/command-line-api is a library that facilitates making commandline executables with nice arguments and options. It's a little complicated but if you're going to pack in a lot of functionality, you need something like this.
  • Thoughts on authoring cmdlets
    2 projects | /r/dotnet | 11 Aug 2022
    if you're looking into command line utilities built in c#, you might want to check out System.CommandLine. You'll be able to build your comands in c#.
  • Fellow C# coders, I was randomly making a RANDOM script just for fun, when all of a sudden, an error popped up! For some reason, my program just can't detect a method called "Main" when it's right there! (Program does not contain a static "Main" method suitable for an entry point) Thank you!
    1 project | /r/csharp | 28 Jun 2022
    What you're trying to do can be accomplished with something like System.CommandLine.DragonFruit. This basically lets you define a strongly typed Main method overload, and it handles converting the string[] for you
  • Architecture pattern for Console Apps?
    5 projects | /r/csharp | 5 Jun 2022
  • What's your favorite command line arg parser?
    7 projects | /r/csharp | 31 Jan 2022
    System.Commandline is my current favorite.

CommandLineUtils

Posts with mentions or reviews of CommandLineUtils. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-08-16.
  • Enforcing command line arguments with CommandLineUtils?
    1 project | /r/dotnet | 20 Oct 2022
    The library doesn't support that format, here you can see that MultipleValues means for example "-o value1 -o value2" Options Support options with multiple values · Issue #311 · natemcmaster/CommandLineUtils · GitHub
  • How do I run a single .class file in C#?
    1 project | /r/learncsharp | 29 Sep 2022
    You could roll your own with some command-line argument processing. You could write that yourself and use reflection, or for an example from a library I've used, example.
  • Best way to build a console app with command line parser and dependency injection?
    2 projects | /r/csharp | 16 Aug 2022
  • Parsing the command line in the .NET 6 new console format?
    1 project | /r/csharp | 31 Mar 2022
  • What's your favorite command line arg parser?
    7 projects | /r/csharp | 31 Jan 2022
  • Writing tests for CLI tool
    3 projects | dev.to | 14 Nov 2021
    I want to test how my tools generated files and folders in the destination with different arguments passed to the program. However, in my old code, I put all the logic of working with arguments in the static int main( string[] args) function. I could not use Interface and Dependency injection to mock the CLI tools because CommandLineUtils does not have an interface library. Luckily, I found this guidance from the owner of CommandLineUtils, and he advised that "Split the command-line argument parser and application execution into separate class structures" to test various options programmatically. It is a great suggestion, and I rewrote my program by adding class CommandLineOptions and adding logic to class Generator to make it works with CommandLineOptions. I can kill two birds with one stone by this change: code refactoring and writing better tests. Another problem I had was my folder structure. Before, I put the project's sln file, .git file , and src files in the root of the folder. However, when I added a new test project for Shinny-SSG, I had it outside my git folder, and it would be impossible to commit the change and put it in my remote repository. To resolve this, I had to change my folder structure to this:
  • Help with quite weird idea
    1 project | /r/csharp | 20 Oct 2021
  • C# equivalent to Pythons cmd module?
    5 projects | /r/csharp | 9 May 2021
  • Automatic .NET Versioning Tool
    5 projects | /r/dotnet | 10 Apr 2021
    Thanks to https://github.com/natemcmaster/CommandLineUtils for supplying a lot of the command structures. If you're interested in creating your own dotnet tool, this is highly recommended.

What are some alternatives?

When comparing command-line-api and CommandLineUtils you can also consider the following projects:

spectre.console - A .NET library that makes it easier to create beautiful console applications.

Command Line Parser - The best C# command line parser that brings standardized *nix getopt style, for .NET. Includes F# support

Cocona - Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.

ILRepack - Open-source alternative to ILMerge

Gui.cs - Cross Platform Terminal UI toolkit for .NET

Fluent Command Line Parser - A simple, strongly typed .NET C# command line parser library using a fluent easy to use interface

ILMerge - ILMerge is a static linker for .NET Assemblies.

JustCli - Just a quick way to create your own command line tool

propeller-vt100-terminal - ANSI / VT-100 Terminal emulator for Parallax Propeller microcontroller with VGA and USB support

Sieve - ⚗️ Clean & extensible Sorting, Filtering, and Pagination for ASP.NET Core