vm2.UlidTool 1.0.9

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global vm2.UlidTool --version 1.0.9
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local vm2.UlidTool --version 1.0.9
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=vm2.UlidTool&version=1.0.9
                    
nuke :add-package vm2.UlidTool --version 1.0.9
                    

UlidTool - ULID Generator Command Line Tool

CI codecov Release

NuGet Version NuGet Downloads GitHub License

A CLI tool for generating ULIDs (Universally Unique Lexicographically Sortable Identifiers). The tool is based on the vm2.Ulid library and provides various output formats and options for generating ULIDs from the command line.

Installation

dotnet tool install -g vm2.UlidTool

Quick Start

# Generate a single ULID
ulid

# Generate multiple (5) ULIDs
ulid -n 5

# Generate 3 ULIDs in GUID-like format
ulid -n 3 -f guid

# Generate a single ULID with detailed information
ulid -f detailed

What is a ULID?

ULID (Universally Unique Lexicographically Sortable Identifier) is a 128-bit identifier that combines:

  • 48-bit timestamp (millisecond precision)
  • 80-bit randomness

Benefits over traditional GUIDs/UUIDs:

  • Lexicographically sortable by creation time
  • Compact - 26 characters vs 36 for GUIDs
  • URL-safe - Uses Crockford's Base32 encoding
  • Monotonic - Within the same millisecond, values increment
  • Compatible - Can be converted to/from GUID

Command Line Options

ulid [options]

Options:
  -n, --number <number>  Number of ULIDs to generate (1-10000) [default: 1]
  -f, --format <format>  Output format [default: ulid]
  -h, --help             Show help information
  --version              Show version information

Output Formats

  1. ULID (default)

    26-character Crockford's Base32 string, lexicographically sortable:

    ulid
    # 01K5ETWXTDG0ZK9PP9WMC6V4HY
    
  2. GUID-like

    36-character hexadecimal GUID-like format:

    ulid -f guid
    # 01934b8e-c6d9-7f40-9a99-f1c66d8c568e
    
  3. Detailed

    Multi-line display showing the two main string formats and the two components - timestamp and random bytes:

    ulid -f detailed
    # ULID: 01K5ETWXTDG0ZK9PP9WMC6V4HY
    # GUID: 01934b8e-c6d9-7f40-9a99-f1c66d8c568e
    #   Timestamp:    01K5ETWXTD       2024-01-15T10:30:45.123+00:00 (1705315845123)
    #   Random Bytes: G0ZK9PP9WMC6V4HY [ 0x7F, 0x40, 0x9A, 0x99, 0xF1, 0xC6, 0x6D, 0x8C, 0x56, 0x8E ]
    

Format Abbreviation

The --format option accepts any unique prefix (case-insensitive):

  • u, ul, uli, ulid → ULID format
  • g, gu, gui, guid → GUID format
  • d, de, det, ... detailed → Detailed format

Examples

  1. Generate test data

    # Generate 100 ULIDs for database seeding
    ulid -n 100 > test-ids.txt
    
  2. Create GUID-compatible IDs

    # Generate ULIDs in GUID format for legacy systems
    ulid -n 10 -f g
    
  3. Inspect ULID structure

    # Examine the components of a ULID
    ulid -f d
    

License

MIT - See LICENSE

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.0.0-preview.1 36 2/23/2026
1.0.10-preview.1 31 2/23/2026
1.0.9 83 2/16/2026
1.0.8 83 2/16/2026
1.0.8-preview.7 39 2/16/2026

1.1.1