Skip to content

CLI

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

All commands can be run from the standalone Tinyauth binary:

Terminal window
./tinyauth [options]

Alternatively, when running the app through Docker:

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

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.

The health check command verifies if Tinyauth is running correctly:

Terminal window
docker compose exec 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 TINYAUTH_SERVER_PORT and the TINYAUTH_SERVER_ADDRESS environment variables. You can also specify a custom URL with:

Terminal window
docker compose exec tinyauth healthcheck http://tinyauth.example.com

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

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 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:

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 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
--interactiveUse an interactive TUI for user creation.falseno

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

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 user verify --interactive

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

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 user verify --user 'user@example.com:$2a$10$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u' --username user@example.com --password password
FlagDescriptionDefaultRequired
--userThe username:hash combination to verify.yes
--usernameUsername for verification.yes
--passwordPassword for verification.yes
--interactiveUse an interactive TUI for verification.falseno
--totpOptional TOTP code for verification.no

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

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 totp generate --interactive

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:

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 totp generate --user 'user@example.com:$2a$10$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u'
FlagDescriptionDefaultRequired
--userThe current username:hash combination.yes
--interactiveUse an interactive TUI for creating the TOTP user.falseno