Skip to main content
The @uniku/cli package provides a powerful command-line tool for working with unique identifiers. It supports UUID v4/v7, ULID, CUID2, Nanoid, and KSUID — enabling you to generate, validate, and inspect IDs directly from your terminal.

Quick Example

# Generate a UUID v7 (time-ordered)
uniku uuid --version 7
# => 018e5e5c-7c8a-7000-8000-000000000000

# Generate 5 monotonic ULIDs
uniku ulid --monotonic --count 5

# Validate an ID (type auto-detected)
uniku validate 01HW9T2W9W9YJ3JZ1H4P4M2T8Q
# => Valid ULID

# Inspect a time-ordered ID to extract timestamp
uniku inspect 018e5e5c-7c8a-7000-8000-000000000000
# => Shows timestamp, version, and random component

Available Commands

The CLI provides three main categories of commands:

Generate IDs

Create new IDs using any supported generator

Validate IDs

Check if IDs are valid with type auto-detection

Inspect IDs

Extract metadata from time-ordered IDs

Generation Commands

All generation commands support both the explicit uniku generate <type> format and shorthand syntax:
CommandDescriptionShorthand
uniku generate uuidGenerate UUIDs (v4 or v7)uniku uuid
uniku generate ulidGenerate ULIDsuniku ulid
uniku generate nanoidGenerate Nanoidsuniku nanoid
uniku generate cuidGenerate CUIDs (v2)uniku cuid
uniku generate ksuidGenerate KSUIDsuniku ksuid

Utility Commands

CommandDescription
uniku validate <id>Check if an ID is valid (with type auto-detection)
uniku inspect <id>Decode and inspect metadata from an ID

Common Options

These options work across most commands:
--count
number
default:"1"
Number of IDs to generate. Alias: -n
uniku uuid --count 10
--json
boolean
default:"false"
Output results as JSON for programmatic use
uniku uuid --count 3 --json
# [{"id":"..."},{"id":"..."},{"id":"..."}]
--help
boolean
Show help information for any command
uniku uuid --help
uniku validate --help
--version
boolean
Show the CLI version. Alias: -V
uniku --version

Output Formats

By default, commands output plain text (one ID per line). Use --json for structured output:
uniku uuid --count 3
550e8400-e29b-41d4-a716-446655440000
6ba7b810-9dad-11d1-80b4-00c04fd430c8
7c9e6679-7425-40de-944b-e07fc1f90ae7
The CLI uses the Web Crypto API for secure random number generation, ensuring cryptographically strong IDs across all generators.

Next Steps

Installation

Install the CLI using pre-built binaries or npm

Generate IDs

Learn how to generate IDs with all supported types

Validate IDs

Validate IDs with automatic type detection

Inspect IDs

Extract timestamps and metadata from IDs

Build docs developers (and LLMs) love