ptk is a simple and secure command-line tool to generate passwords and tokens, built with Go and Cobra.
- Generate strong, random passwords or API tokens
- Control the output length and type
- Optional clipboard copy
- Cross-platform support (macOS, Linux, Windows)
- Lightweight and fast
Download the latest .zip
archive for your platform from the Releases page:
Unzip the archive and place the binary in your $PATH
.
Here are the main commands available:
# Show package version
ptk --version
# Generate a password (default length, default type)
ptk gen
# Specify the type of string to generate (password or token)
ptk gen --type password
ptk gen --type token
# Specify the length of the generated string (e.g., 32 characters)
ptk gen --length 32
# Copy the generated result to the clipboard
ptk gen --copy
# Combine all options
ptk gen --type token --length 64 --copy