idt
A fast, ergonomic CLI tool for working with various ID formats.
Installation
# Cargo
# Homebrew
# Nix (flakes)
Docker
# From Docker hub
# From GitHub Container Registry
Docker image is published to the registries below:
See installation docs for more.
Usage
# Generate IDs
# Generate multiple IDs
# Inspect any ID
# Convert formats
# Validate IDs
# Compare two IDs
# Sort IDs by timestamp
|
# Show supported types
Supported ID Types
| Type | Sortable | Time | Bits | Description |
|---|---|---|---|---|
| uuidv1 | No | Yes | 128 | Timestamp + MAC address |
| uuidv3 | No | No | 128 | MD5 namespace hash |
| uuidv4 | No | No | 128 | Random |
| uuidv5 | No | No | 128 | SHA-1 namespace hash |
| uuidv6 | Yes | Yes | 128 | Reordered timestamp |
| uuidv7 | Yes | Yes | 128 | Unix timestamp + random |
| uuid-nil | - | - | 128 | All zeros |
| uuid-max | - | - | 128 | All ones |
| ulid | Yes | Yes | 128 | Crockford Base32, lexicographically sortable |
| nanoid | No | No | ~126 | Compact URL-friendly ID |
| ksuid | Yes | Yes | 160 | K-Sortable Unique Identifier |
| snowflake | Yes | Yes | 64 | Twitter/Discord-style distributed ID |
| objectid | Partial | Yes | 96 | MongoDB ObjectId |
| typeid | Yes | Yes | 128 | Type-prefixed sortable ID |
| xid | Yes | Yes | 96 | Globally unique sortable ID |
| cuid | Partial | Yes | 128 | Collision-resistant ID |
| cuid2 | No | No | 128 | Secure collision-resistant ID |
| tsid | Yes | Yes | 64 | Time-sorted unique identifier |
Generation Options
# UUID versions
# NanoID customization
# Snowflake customization
Output Formats
# JSON output
# Encoding formats
Examples
Generate and inspect UUIDv7:
)
)
Inspect ULID:
)
)
Sort IDs by timestamp:
Pipe support:
|
|
|
|
Options
| Flag | Description |
|---|---|
-n, --count |
Number of IDs to generate |
-f, --format |
Output encoding format |
-r, --reverse |
Sort in descending order |
--show-time |
Show timestamps alongside IDs |
-t, --type |
ID type hint |
-j, --json |
JSON output |
-p, --pretty |
Pretty print JSON |
--no-color |
Disable colors |
Call for contributions
This project is still in its infancy, so any contributions are welcome!
Please open an issue or a PR if you have any suggestions.
License
Licensed under either of Apache License Version 2.0 or MIT License at your option.