TinyauthTinyauth

CLI

Reference on the Tinyauth CLI.

Tinyauth offers a simple CLI to configure the app and manage users.

Commands

All commands can be run from the standalone Tinyauth binary:

./tinyauth [options]

Alternatively, when running the app through Docker:

docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v4 [options]

When using Docker Compose, the command docker compose run tinyauth [options] can also be used.

Main Command

The main command starts the API and web UI, waiting for incoming connections. All options are configurable with CLI flags or environment variables. A complete list of configuration options is available on the configuration page.

Healthcheck command

The health check command verifies if Tinyauth is running correctly:

./tinyauth healthcheck

By default, it will use http://127.0.0.1:3000 to check the health endpoint. The URL will automatically change if you set the PORT and/or ADDRESS environment variables. You can also specify a custom URL with:

./tinyauth healthcheck http://tinyauth.example.com

Create User Command

The create command simplifies user creation. To create a user interactively:

./tinyauth user create --interactive

This launches an interactive TUI to input a username and password, generating the username:hash format required by Tinyauth. It can also format the user for Docker Compose or environment variables. For non-interactive creation:

./tinyauth user create --username user@example.com --password password
FlagDescriptionDefaultRequired
--usernameUsername for creating the user.``yes
--passwordPassword for creating the user.``yes
--dockerFormat output for Docker Compose or environment variables.falseno
--interactive (-i)Use an interactive TUI for user creation.falseno

Verify User Command

The verify command checks if a username and password match the username:hash. For interactive verification:

./tinyauth user verify --interactive

A TUI prompts for the username:hash, username, and password, verifying the credentials. For non-interactive verification:

./tinyauth user verify --user 'user@example.com:$2a$10$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u' --username user@example.com --password password

Use quotes (') in bash shells to ensure the hash is passed correctly.

FlagDescriptionDefaultRequired
--userThe username:hash combination to verify.``yes
--usernameUsername for verification.``yes
--passwordPassword for verification.``yes
--interactive (-i)Use an interactive TUI for verification.falseno
--totpOptional TOTP code for verification.``no

Generate TOTP Command

Tinyauth can auto generate TOTP codes for you, the combination is username:hash:secret. You can generate a TOTP user with:

./tinyauth totp generate -i

This prompts for the current username:hash and generates a username:hash:secret along with a QR code for adding to an authenticator app. For non-interactive generation:

./tinyauth totp generate --user 'user@example.com:$2a$10$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u'

Use quotes (') in bash shells to ensure the hash is passed correctly.

FlagDescriptionDefaultRequired
--userThe username:hash combination to verify.``yes
--interactive (-i)Use an interactive TUI for creating the TOTP user.falseno