THE LOVELYAUTH COMMAND LINE

Your vault.
In your terminal.

Get a verification code without leaving your workflow. Connect the same vault you use on the web, manage your accounts, and choose when to watch codes refresh.

Available on npm. Install lovelyauth using the commands below.

Explore the CLI
lovelyauth
$ lovelyauth get github
284109
21s remaining

$ 

Example output. One code, time remaining, then back to your prompt.

01 / INSTALL

One command to get started.

Install Node.js 24 or newer, which includes npm. Then install LovelyAuth globally to use it from any directory.

npm install -g lovelyauth
lovelyauth --version

Prefer to run it without a global installation? Use npx:

npx lovelyauth login device
npx lovelyauth get github

No environment variables to configure. LovelyAuth connects to its service automatically.

02 / CONNECT

Your existing vault, connected.

Sign in once. Your CLI session is saved automatically on this computer.

lovelyauth login device

Open the link printed in your terminal, sign in through your browser, and approve the device. Keep the terminal open while you approve it.

You can also sign in with a code sent to your email address:

lovelyauth login email you@example.com

Your session is saved in ~/.lovelyauth/session.json with owner-only permissions. Treat this file as a credential. Run lovelyauth logout to revoke the session and clear it.

03 / GET A CODE

Once, or on watch.

The default is predictable: print a code and its remaining seconds, then stop.

lovelyauth get github

For an interactive countdown that refreshes automatically, opt in with --watch. Press any key to stop.

lovelyauth get github --watch

Need a newly generated code? --fresh waits until the next code period before printing.

lovelyauth get github --fresh

Codes come from your connected vault. Internet access is required; the CLI does not store an offline copy of your authenticator secrets.

04 / SCRIPT IT

A clear beginning. A clear end.

Ordinary get works the same in a script as it does in your terminal. It exits after one result.

The first output line is the six-digit code; the second is the time remaining. For example, in a shell:

result=$(lovelyauth get github) || exit 1
code=$(printf '%s\n' "$result" | head -n 1)

Successful commands exit with status 0. Sign-in, connection, and service errors print to stderr and exit nonzero. Use --watch when you want an interactive session.

05 / MANAGE YOUR VAULT

The everyday essentials.

A slug is a short account identifier such as github or aws-work. Use lowercase letters, numbers, and hyphens.

lovelyauth list
List active accounts and their slugs.
lovelyauth add "GitHub" github
Add an account. Enter its Base32 secret or otpauth:// URI at the masked prompt, rather than as a command-line argument.
lovelyauth edit github --name "GitHub Work" --slug github-work
Change an account's name or slug.
lovelyauth view github-work
Show the account's name, slug, and code with an interactive countdown.
lovelyauth delete github-work
Move an account to Trash.
lovelyauth trash
List trashed accounts.
lovelyauth restore github-work
Restore an account from Trash.
lovelyauth empty-trash
Permanently purge all trashed account secrets. This command does not ask for confirmation.
lovelyauth logout
Revoke this CLI session and clear its saved credentials.
lovelyauth help
Show the full command list, including available options.