Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ This library explicitly **multi-targets** each runtime version listed below, ena
`ByteAether.Ulid.linq2db`
* 📦 **[Dapper](#dapper-integration--byteaetheruliddapper)**
`ByteAether.Ulid.Dapper`
* 📦 **[CLI & .NET Tool](#net-tool--cli-integration--byteaetherulidcli)**
`ByteAether.Ulid.Cli`

These features collectively make **ByteAether.Ulid** a robust and efficient choice for managing unique identifiers in your .NET applications.

Expand Down Expand Up @@ -559,6 +561,50 @@ MessagePackSerializer.DefaultOptions = MessagePackSerializer.DefaultOptions
));
```

### [.NET Tool & CLI](https://www.nuget.org/packages/ByteAether.Ulid.Cli/) Integration – ByteAether.Ulid.Cli

[<img align="right" width="100px" src="assets/logo_ulid_tool.png" />](https://www.nuget.org/packages/ByteAether.Ulid.Cli/)

[![License](https://img.shields.io/github/license/ByteAether/Ulid?logo=github&label=License)](https://github.com/ByteAether/Ulid/blob/main/LICENSE)
[![NuGet Version](https://img.shields.io/nuget/v/ByteAether.Ulid.Cli?logo=nuget&label=Version)](https://www.nuget.org/packages/ByteAether.Ulid.Cli/)
[![NuGet Downloads](https://img.shields.io/nuget/dt/ByteAether.Ulid.Cli?logo=nuget&label=Downloads)](https://www.nuget.org/packages/ByteAether.Ulid.Cli/)
![.NET 6.0+](https://img.shields.io/badge/.NET-6.0+-brightgreen)

An official CLI tool and companion utility for `ByteAether.Ulid`, providing command-line generation and inspection of Universally Unique Lexicographically Sortable Identifiers (ULIDs). Optimized for scripting, pipelines, terminal workflows, and tool interop.

To install globally as a .NET Tool:

```sh
dotnet tool install -g ByteAether.Ulid.Cli
```

Or install locally in your repository/project:

```sh
dotnet new tool-manifest # if not already present
dotnet tool install ByteAether.Ulid.Cli
```

#### Usage

When installed globally, run `ulid`. When installed locally, prefix commands with `dotnet ulid`.

```sh
# Generate a single ULID
ulid

# Generate 5 ULIDs formatted as GUIDs
ulid -c 5 -f guid

# Inspect a ULID
ulid 01AN4Z07BY79KA1307SR9X4MV3

# Inspect from stdin and output as JSON
echo "01AN4Z07BY79KA1307SR9X4MV3" | ulid --json
```

More details in the package's [PACKAGE.md](./src/Cli/PACKAGE.md) file.

## 📊 Benchmarking

Benchmarking was performed using [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) to demonstrate the performance and efficiency of this ULID implementation. Comparisons include [NetUlid](https://github.com/ultimicro/netulid) 2.1.0, [Ulid](https://github.com/Cysharp/Ulid) 1.4.1, [NUlid](https://github.com/RobThree/NUlid) 1.7.3, and `Guid` for overlapping functionalities like creation, parsing, and byte conversions.
Expand Down
Binary file added assets/logo_ulid_tool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/ByteAether.Ulid.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
</Project>
</Folder>

<Folder Name="/Cli/">
<Project Path="Cli/Cli.Impl.csproj" />
<Project Path="Cli.Tests/Cli.Tests.csproj">
<Build Solution="CI-Release|*" Project="false" />
</Project>
</Folder>

<Folder Name="/DB/">
<Project Path="DB.Shared.Tests/DB.Shared.Tests.csproj">
<Build Solution="CI-Release|*" Project="false" />
Expand Down Expand Up @@ -47,6 +54,7 @@
<Folder Name="/Solution Items/">
<File Path="../README.md" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="Directory.Build.targets" />
<File Path=".editorconfig" />
<File Path=".runsettings" />
Expand Down
19 changes: 19 additions & 0 deletions src/Cli.Tests/Cli.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>

<IsTestProject>true</IsTestProject>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<UseDataCollector/>

<RootNamespace>ByteAether.Ulid.Cli.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Cli\Cli.Impl.csproj" />
<ProjectReference Include="..\Ulid\Impl.csproj" />
</ItemGroup>

</Project>
Loading
Loading