Skip to content

Authentication

Yousef Ghadiri edited this page May 28, 2026 · 1 revision

Authentication

When --enable-auth is passed, the API server requires authentication. Users are managed via the users subcommand and stored in a persistent users.json file in the application data directory.

Each user has a username, a bcrypt-hashed password, and a Telegram token that can be used to link their Telegram account.

Managing Users

Add a user (you will be prompted for a password):

knightwatch users add <USERNAME>

On success, the command prints the new user's Telegram token — save it if you plan to link Telegram.

Remove a user:

knightwatch users remove <USERNAME>

List all users (shows Telegram link status):

knightwatch users list

Show the Telegram token for a user:

knightwatch users token <USERNAME>

This also indicates whether the user has already linked their Telegram account.

Remove all users:

knightwatch users clear

Clone this wiki locally