Skip to content

One‐Off Code Generation

Dave Walker edited this page Jan 28, 2025 · 1 revision

The following forms of the "generate" command are accepted:

  • Generate for all entries
  • Generate for the service with a specified Id
  • Generate for all entries for a service, given its name
  • Generate for a specific service and account combination

Generate for All Entries

To generate TOTPs for all entries in the database, use the following form of the command:

/path/to/OtpGenerator.Terminal --generate

Where:

Argument Comments
/path/to/OtpGenerator.Terminal The path to the OTP Generator binary, named "OtpGenerator.Terminal" on MacOS and Linux and "OtpGenerator.Terminal.exe" on Windows

Generate for a Single Service by ID

Each service is assigned a unique "Id" when it's added to the database. This is shown when 2FA codes are generated and when the contents of the database are listed. For example:

Service List

This Id can be used to specify a service for which a TOTP should be generated as follows:

/path/to/OtpGenerator.Terminal --generate id

Where:

Argument Comments
/path/to/OtpGenerator.Terminal The path to the OTP Generator binary, named "OtpGenerator.Terminal" on MacOS and Linux and "OtpGenerator.Terminal.exe" on Windows
id The unique Id for the service/account pair

Generate for a Service and Account Pair

To generate a TOTP for a single service/account combination, use the following form of the command:

/path/to/OtpGenerator.Terminal --generate "service" "account"

Where:

Argument Comments
/path/to/OtpGenerator.Terminal The path to the OTP Generator binary, named "OtpGenerator.Terminal" on MacOS and Linux and "OtpGenerator.Terminal.exe" on Windows
service The service name
account The account name

Values need only be quoted "..." if they contain special characters or spaces.

Generate for All Accounts for a Service

To generate TOTPs for all accounts at a specific service use the following form of the command:

/path/to/OtpGenerator.Terminal --generate "service"

Where:

Argument Comments
/path/to/OtpGenerator.Terminal The path to the OTP Generator binary, named "OtpGenerator.Terminal" on MacOS and Linux and "OtpGenerator.Terminal.exe" on Windows
service The service name

Values need only be quoted "..." if they contain special characters or spaces.

Output

For all forms of the command, the output is similar to the following screen shot. Only the number of entries shown may differ.

One-Time TOTP Generation

Note that the "Generate" option does not create a continuously updating display - it generates the TOTPs, displays them and then exits. To see a continuously updating display, use the "Live View" option.

Clone this wiki locally