A tiny Rust-based CLI tool to generate unique IDs, primarily UUIDs. Built as a more capable alternative to uuidgen, with support for all UUID versions (v1-v8), multiple output formats, and clipboard integration.
- Quick shortcuts:
mkid4andmkid7for instant UUID generation - All UUID versions supported: v1 through v8
- Smart defaults:
mkidgenerates UUID v7 (sortable, database-friendly) - Multiple formats: hyphenated, simple, URN, braced
- Case control: lowercase (default) or uppercase
- Clipboard integration: Copy output directly to clipboard
- Bulk generation: Generate multiple UUIDs at once
- Fast and lightweight: Three small binaries, minimal dependencies
The fastest way to install pre-built binaries:
cargo binstall mkidDownload pre-built binaries directly from GitHub releases.
Build from source via crates.io:
cargo install mkid --lockedBuild from the repository:
git clone https://github.com/asaaki/mkid
cd mkid
cargo install --path .For maximum convenience, use the shortcut commands:
# UUID v4 (random) - fastest way
mkid4
# Output: 18431fda-68f1-42af-9318-1ece3d60281e
# UUID v7 (sortable) - fastest way
mkid7
# Output: 019c1064-a92c-74f0-98d9-03496f8a9693Generate a UUID v7 (default):
mkid
# Output: 019c0edc-d74c-7c02-beb9-40fcf2eee5f6Generate specific UUID versions:
# UUID v4 (random)
mkid uuid v4
# UUID v7 (timestamp-based, sortable)
mkid uuid v7
# UUID v1 (time-based with node ID)
mkid uuid v1 --random-node
# UUID v3 (MD5 hash-based)
mkid uuid v3 --namespace dns --name example.com
# UUID v5 (SHA-1 hash-based)
mkid uuid v5 --namespace url --name https://example.com
# UUID v6 (sortable time-based)
mkid uuid v6 --random-node
# UUID v8 (custom)
mkid uuid v8 --bytes 0123456789abcdef0123456789abcdefFor v1/v6 (time-based):
--random-node: Use random 6-byte node ID (default)--node-id <HEX>: Specify custom node ID (12 hex characters)
mkid uuid v1 --node-id aabbccddeeffFor v3/v5 (hash-based):
--namespace <NS>: Namespace (dns, url, oid, x500, or custom UUID)--name <NAME>: Name to hash (required)
mkid uuid v5 --namespace dns --name example.com
# Output is deterministic: same namespace + name = same UUIDFor v8 (custom):
--bytes <HEX>: 32 hex characters (16 bytes)
mkid uuid v8 --bytes 0123456789abcdef0123456789abcdef# Hyphenated (default)
mkid uuid v7 --format hyphenated
# 019c0edc-d74c-7c02-beb9-40fcf2eee5f6
# Simple (no hyphens)
mkid uuid v7 --format simple
# 019c0edcd74c7c02beb940fcf2eee5f6
# URN
mkid uuid v7 --format urn
# urn:uuid:019c0edc-d74c-7c02-beb9-40fcf2eee5f6
# Braced
mkid uuid v7 --format braced
# {019c0edc-d74c-7c02-beb9-40fcf2eee5f6}# Uppercase
mkid uuid v7 --uppercase
# 019C0EDC-D74C-7C02-BEB9-40FCF2EEE5F6
# Lowercase (default)
mkid uuid v7
# 019c0edc-d74c-7c02-beb9-40fcf2eee5f6# Generate 5 UUIDs
mkid uuid v7 --count 5
# 019c0edd-19ee-7903-8ec0-cc2098967b15
# 019c0edd-19ee-7903-8ec0-cc324e67abd2
# 019c0edd-19ee-7903-8ec0-cc4871c57653
# 019c0edd-19ee-7903-8ec0-cc552b063bff
# 019c0edd-19ee-7903-8ec0-cc6150da757cNote: v7 UUIDs are monotonic (sortable by generation time).
# Copy to clipboard
mkid --clipboard
mkid uuid v7 --clipboard
# Copy multiple UUIDs (newline-separated)
mkid uuid v4 --count 5 --clipboard# Multiple options at once
mkid uuid v7 --uppercase --format simple --count 3 --clipboard
# 019C0EDD08B37C42AABE599AEA317DE1
# 019C0EDD08B37C42AABE599D2F5B8A92
# 019C0EDD08B37C42AABE599E5C9A1B23
# (also copied to clipboard)UUID v7 is the default because it provides:
- Database performance: Time-ordered UUIDs reduce B-tree fragmentation (up to 10x better than v4)
- Sortability: Lexicographic comparison works directly on the UUID bytes
- Modern timestamps: Uses Unix epoch in milliseconds (familiar to developers)
- Monotonicity: Sequential UUIDs are guaranteed to be ordered
- No clock drift issues: Better than v1/v6 for distributed systems
| Version | Type | Use Case | Deterministic |
|---|---|---|---|
| v1 | Time + Node | Legacy systems | No |
| v3 | MD5 hash | Namespace-based (legacy) | Yes |
| v4 | Random | General purpose | No |
| v5 | SHA-1 hash | Namespace-based | Yes |
| v6 | Sortable time | Database keys (modern) | No |
| v7 | Timestamp | Database keys (recommended) | No |
| v8 | Custom | Special requirements | Depends |
mkid uuid v4 --format simple --uppercasemkid uuid v7 --count 100mkid uuid v5 --namespace dns --name test-user-1
mkid uuid v5 --namespace dns --name test-user-2mkid -c # Generate v7 and copy to clipboard
# Paste anywhere: Cmd+V (macOS) or Ctrl+V (Linux/Windows)Run the test suite:
cargo testThe project includes comprehensive integration tests covering:
- All UUID versions
- Format options
- Deterministic behavior (v3/v5)
- Monotonicity (v7)
- Error handling
- Count functionality
The architecture supports future addition of other ID formats:
- ULID (Universally Unique Lexicographically Sortable Identifier)
- NanoID (URL-friendly unique ID)
- Snowflake (Twitter's distributed ID)
- CUID (Collision-resistant Unique ID)
Example future usage:
mkid ulid
mkid nanoid
mkid snowflakeLicensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributions welcome! Please feel free to submit a Pull Request.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.