| Crates.io | htauth-cli |
| lib.rs | htauth-cli |
| version | 0.1.2 |
| created_at | 2026-01-17 16:27:20.458331+00 |
| updated_at | 2026-01-17 16:54:17.982154+00 |
| description | A CLI tool for managing htpasswd files |
| homepage | |
| repository | https://github.com/mexus/htauth |
| max_upload_size | |
| id | 2050743 |
| size | 41,426 |
A command-line tool for managing htpasswd files with support for bcrypt, SHA-256, SHA-512, and APR1-MD5 password hashing.
cargo install htauth-cli
# Add a user (passwords are prompted securely)
htauth add .htpasswd alice
# Add with specific hash algorithm
htauth add .htpasswd bob --algorithm sha256
# Verify a password
htauth verify .htpasswd alice
# List all users
htauth list .htpasswd
# Update a user's password
htauth update .htpasswd alice
# Delete a user
htauth delete .htpasswd alice
| Command | Description |
|---|---|
add |
Add a new user to the password file |
update |
Update an existing user's password |
verify |
Verify a user's password |
list |
List all users in the password file |
delete |
Delete a user from the password file |
By default, passwords are prompted interactively without echo. Use --password to read from stdin instead:
echo "secret" | htauth add .htpasswd alice --password
| Algorithm | Flag value | Format |
|---|---|---|
| bcrypt | bcrypt |
Default; secure and widely supported |
| SHA-256 | sha256 |
$5$ format |
| SHA-512 | sha512 |
$6$ format |
| APR1-MD5 | apr1 |
$apr1$ format; Apache legacy |
New passwords default to bcrypt unless --algorithm is specified.
Files generated by htauth are fully compatible with Apache's htpasswd tool and vice versa. The CLI uses subcommands instead of flags, so it is not a drop-in replacement for scripts that expect htpasswd's flag-based syntax.
For programmatic access, see the htauth library crate.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.