htauth-cli

Crates.iohtauth-cli
lib.rshtauth-cli
version0.1.2
created_at2026-01-17 16:27:20.458331+00
updated_at2026-01-17 16:54:17.982154+00
descriptionA CLI tool for managing htpasswd files
homepage
repositoryhttps://github.com/mexus/htauth
max_upload_size
id2050743
size41,426
Denis (mexus)

documentation

README

htauth-cli

A command-line tool for managing htpasswd files with support for bcrypt, SHA-256, SHA-512, and APR1-MD5 password hashing.

Crates.io License

Repository

Installation

cargo install htauth-cli

Quick Start

# 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

Commands

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

Password Input

By default, passwords are prompted interactively without echo. Use --password to read from stdin instead:

echo "secret" | htauth add .htpasswd alice --password

Hash Algorithms

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.

Apache Compatibility

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.

Library

For programmatic access, see the htauth library crate.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Commit count: 22

cargo fmt