Skip to main content

Encrypted CLI vault for FreeOTP JSON exports with system keyring support

Project description

freeotp-vault

Encrypted CLI vault for FreeOTP JSON exports with system keyring support.

PyPI Python Coverage Ruff

Install

pip install freeotp-vault

For system keyring support (to store password securely):

pip install freeotp-vault[keyring]
# or on Debian/Ubuntu:
sudo apt install libsecret-1-0 libsecret-tools

Usage

Import a FreeOTP backup

freeotp-vault init path/to/freeotp-export.json

List accounts

freeotp-vault list
freeotp-vault list --filter github

Generate tokens

freeotp-vault token
freeotp-vault token --filter github

Change password

freeotp-vault change-password

Remove accounts

freeotp-vault remove --filter "old account"

Automatic Backups

Every time the vault is saved, a timestamped backup is created in ~/.config/freeotp-vault/backups/. Up to 5 backups are retained.

Google Drive Sync

Backup and sync your vault with Google Drive for cross-device access.

Setup:

  1. Create OAuth credentials:

    • Go to Google Cloud Console
    • Create OAuth client IDDesktop app
    • Download as credentials.json
    • Save to ~/.config/freeotp-vault/credentials.json
  2. Authenticate:

freeotp-vault gdrive-login

Sync commands:

# Upload vault to Google Drive
freeotp-vault gdrive-sync --upload

# Download vault from Google Drive
freeotp-vault gdrive-sync --download

Python API

from freeotp_vault import (
    encrypt_vault,
    decrypt_vault,
    parse_freeotp_json,
    generate_token,
    get_password_from_keyring,
    store_password_in_keyring,
)

# Parse a FreeOTP JSON export
tokens = parse_freeotp_json(json_string)

# Encrypt/decrypt vault data
blob = encrypt_vault(data, "password")
plaintext = decrypt_vault(blob, "password")

# Generate OTP code
code = generate_token(token_dict)

Development

git clone https://github.com/daedalus/freeotp-vault.git
cd freeotp-vault
pip install -e ".[test]"

# With Google Drive support
pip install -e ".[gdrive]"

License

MIT License - see LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freeotp_vault-0.1.4.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

freeotp_vault-0.1.4-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file freeotp_vault-0.1.4.tar.gz.

File metadata

  • Download URL: freeotp_vault-0.1.4.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for freeotp_vault-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e095debef01dccf15eb8debfe62666c332a54a840dc12480a91f77b6ff95cd06
MD5 a4938fbdbb669c1a1ab77e24d5b7bd57
BLAKE2b-256 ec7995fa755521fd5aa8a13fa724941247e64e7c05dfb075b8587c240f7970a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for freeotp_vault-0.1.4.tar.gz:

Publisher: pypi-publish.yml on daedalus/freeotp-vault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file freeotp_vault-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: freeotp_vault-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for freeotp_vault-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2364ee7166b421fcf690101017810c747c67ea9eb8f7ba092762748c7538cf7d
MD5 f9769f8df44959bcf73cb65bc474d0c7
BLAKE2b-256 d0f7c65edea53a4d694cca70548d4ad48bad712d769b23aa7cc0ca4a8dfef7ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for freeotp_vault-0.1.4-py3-none-any.whl:

Publisher: pypi-publish.yml on daedalus/freeotp-vault

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page