|
| 1 | +# CLI Usage |
| 2 | + |
| 3 | +``` |
| 4 | +WinAuth command line authenticator |
| 5 | +Usage: winauth-cli [--file PATH] [--password VALUE] COMMAND |
| 6 | +``` |
| 7 | + |
| 8 | +Global options: |
| 9 | + |
| 10 | +| Option | Description | |
| 11 | +|---|---| |
| 12 | +| `--file PATH` | Path to the vault XML file (defaults to `~/.config/winauth-cli/winauth.xml`) | |
| 13 | +| `--password VALUE` | Vault password, if encrypted. Prefer the `WINAUTH_PASSWORD` environment variable over passing this on the command line — it avoids exposing the password in the process list. | |
| 14 | + |
| 15 | +## Commands |
| 16 | + |
| 17 | +| Command | Description | |
| 18 | +|---|---| |
| 19 | +| `list` | List all entries in the vault | |
| 20 | +| `code NAME\|ID` | Print the current TOTP/HOTP/Steam Guard code for an entry | |
| 21 | +| `add --name NAME --secret BASE32 [--type totp\|hotp\|steam] [--issuer TEXT] [--digits N] [--period N] [--counter N] [--algorithm SHA1\|SHA256\|SHA512]` | Add a new entry manually | |
| 22 | +| `import --uri otpauth://...` | Import an entry from a standard `otpauth://` URI | |
| 23 | +| `show NAME\|ID` | Print an entry's `otpauth://` URI | |
| 24 | +| `rename NAME\|ID NEW_NAME` | Rename an entry | |
| 25 | +| `remove NAME\|ID` | Remove an entry | |
| 26 | +| `sync NAME\|ID COUNTER` | Set an HOTP counter value | |
| 27 | +| `export DESTINATION` | Export the vault | |
| 28 | +| `passwd --new-password VALUE` | Encrypt, re-key, or decrypt the vault | |
| 29 | + |
| 30 | +## Examples |
| 31 | + |
| 32 | +```sh |
| 33 | +# Import from an otpauth:// URI (e.g. from a QR code export) |
| 34 | +./winauth-cli import --uri 'otpauth://totp/Example:email?secret=JBSWY3DPEHPK3PXP&issuer=Example' |
| 35 | + |
| 36 | +# Add a Steam Guard entry directly from its Base32 secret |
| 37 | +./winauth-cli add --type steam --name steam --secret JBSWY3DPEHPK3PXP |
| 38 | + |
| 39 | +# Get the current code |
| 40 | +./winauth-cli code steam |
| 41 | + |
| 42 | +# List everything in the vault |
| 43 | +./winauth-cli list |
| 44 | + |
| 45 | +# Encrypt the vault with a password (use WINAUTH_PASSWORD instead of --password where possible) |
| 46 | +export WINAUTH_PASSWORD='your-vault-password' |
| 47 | +./winauth-cli passwd --new-password "$WINAUTH_PASSWORD" |
| 48 | +``` |
| 49 | + |
| 50 | +## Vault location |
| 51 | + |
| 52 | +By default, the vault is stored at `~/.config/winauth-cli/winauth.xml`. Keep this file's permissions restrictive (`chmod 600`) since it contains authenticator secrets, whether or not the vault itself is password-encrypted. |
0 commit comments