Scroll to navigation

OTPCLIENT-CLI(1) OTPClient Manual OTPCLIENT-CLI(1)

NAME

otpclient-cli - command-line interface for OTPClient

SYNOPSIS

otpclient-cli --show [-d DB] [-a ACCOUNT] [-i ISSUER] [-m] [-n] [--output FORMAT]
otpclient-cli --list [-d DB] [--output FORMAT]
otpclient-cli --list-databases [--output FORMAT]
otpclient-cli --list-types
otpclient-cli --import --type TYPE --file PATH [-d DB]
otpclient-cli --export --type TYPE [--output-dir DIR] [-d DB]
otpclient-cli --export-settings [--file PATH]
otpclient-cli --import-settings --file PATH

DESCRIPTION

otpclient-cli is the command-line counterpart to the OTPClient GUI. It can show one-time passwords, list the contents of a database, import or export tokens in any of the supported formats, and back up or restore application settings. The on-disk database format is identical to the one used by the GUI and is encrypted with AES-256-GCM using an Argon2id-derived key.

OPTIONS

Actions

Exactly one action must be supplied on each invocation.

Show the OTP for one or more tokens. Requires --account or --issuer.
List every token in the database (account, issuer, group).
Print the list of known databases from the configuration.
Print the import/export type identifiers accepted by --type.
Import tokens from a backup file. Requires --type and --file.
Export tokens to a backup file. Requires --type.
Print the application settings (GSettings) as JSON, or write them to the file given via --file.
Restore application settings from the JSON file given via --file.
Print the version and exit.

Selection

Path to the database, or a database name as printed by --list-databases. When omitted, the default database from the configuration is used.
Account label to match (used with --show).
Issuer to match (used with --show).
Match --account and --issuer with case-sensitive equality instead of the default case-insensitive contains-style comparison.
Also print the OTP that will become valid after the current period. Has no effect for HOTP tokens.

Input / output

Backup format identifier. Use --list-types to see the accepted values.
Backup file to import or settings file to write/read.
Destination directory for --export. Defaults to the user's home directory. Not available in the Flatpak build.
Read the database decryption password from the first line of PATH instead of prompting on stdin. The file must be a regular file (not a symlink) with mode 0600 or stricter.
Output format for --show, --list, and --list-databases. Accepted values: table (default), json or csv. JSON output is a single document; CSV output starts with a header row.

EXAMPLES

otpclient-cli --list
otpclient-cli --show -a alice -n
otpclient-cli --show -a alice --output=json
otpclient-cli --import --type aegis_enc --file aegis.json
otpclient-cli --export --type twofas_plain -o /tmp
otpclient-cli --show -a alice -p ~/.config/otpclient/passphrase

EXIT STATUS

otpclient-cli exits with 0 on success and a non-zero status on error (incorrect password, missing file, malformed input, etc.). Specific error messages are written to standard error.

FILES

~/.config/otpclient/otpclient.cfg
Configuration file holding the default database path.

SEE ALSO

otpclient(1)

BUGS

Report issues at https://github.com/paolostivanin/OTPClient/issues

May 2026 otpclient-cli