@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
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 explicituniku generate <type> format and shorthand syntax:
| Command | Description | Shorthand |
|---|---|---|
uniku generate uuid | Generate UUIDs (v4 or v7) | uniku uuid |
uniku generate ulid | Generate ULIDs | uniku ulid |
uniku generate nanoid | Generate Nanoids | uniku nanoid |
uniku generate cuid | Generate CUIDs (v2) | uniku cuid |
uniku generate ksuid | Generate KSUIDs | uniku ksuid |
Utility Commands
| Command | Description |
|---|---|
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:Number of IDs to generate. Alias:
-nOutput results as JSON for programmatic use
Show help information for any command
Show the CLI version. Alias:
-VOutput Formats
By default, commands output plain text (one ID per line). Use--json for structured output:
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
