diff --git a/README.md b/README.md index 011ab13..92cb53c 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ SeedPass now uses the `portalocker` library for cross-platform file locking. No - **SeedPass 2FA:** Generate TOTP codes with a real-time countdown progress bar. - **2FA Secret Issuance & Import:** Derive new TOTP secrets from your seed or import existing `otpauth://` URIs. - **Export 2FA Codes:** Save all stored TOTP entries to an encrypted JSON file for use with other apps. +- **Display TOTP Codes:** Show all active 2FA codes with a countdown timer. - **Optional External Backup Location:** Configure a second directory where backups are automatically copied. - **Auto‑Lock on Inactivity:** Vault locks after a configurable timeout for additional security. - **Secret Mode:** Copy retrieved passwords directly to your clipboard and automatically clear it after a delay. @@ -175,7 +176,8 @@ seedpass import --file "~/seedpass_backup.json" seedpass search "github" seedpass search --tags "work,personal" seedpass get "github" -seedpass totp "email" +# Retrieve a TOTP entry +seedpass entry get "email" # The code is printed and copied to your clipboard # Sort or filter the list view @@ -186,6 +188,9 @@ seedpass list --filter totp # on an external drive. ``` +For additional command examples, see [docs/advanced_cli.md](docs/advanced_cli.md). +Details on the REST API can be found in [docs/api_reference.md](docs/api_reference.md). + ### Vault JSON Layout The encrypted index file `seedpass_entries_db.json.enc` begins with `schema_version` `2` and stores an `entries` map keyed by entry numbers. @@ -213,6 +218,12 @@ After successfully installing the dependencies, you can run SeedPass using the f python src/main.py ``` +You can also use the new Typer-based CLI: +```bash +seedpass --help +``` +For a full list of commands see [docs/advanced_cli.md](docs/advanced_cli.md). The REST API is described in [docs/api_reference.md](docs/api_reference.md). + ### Running the Application 1. **Start the Application:** @@ -373,7 +384,7 @@ Back in the Settings menu you can: ## Running Tests -SeedPass includes a small suite of unit tests located under `src/tests`. After activating your virtual environment and installing dependencies, run the tests with **pytest**. Use `-vv` to see INFO-level log messages from each passing test: +SeedPass includes a small suite of unit tests located under `src/tests`. **Before running `pytest`, be sure to install the test requirements.** Activate your virtual environment and run `pip install -r src/requirements.txt` to ensure all testing dependencies are available. Then run the tests with **pytest**. Use `-vv` to see INFO-level log messages from each passing test: ```bash @@ -441,6 +452,7 @@ Mutation testing is disabled in the GitHub workflow due to reliability issues an - **Backup Your Data:** Regularly back up your encrypted data and checksum files to prevent data loss. - **Backup the Settings PIN:** Your settings PIN is stored in the encrypted configuration file. Keep a copy of this file or remember the PIN, as losing it will require deleting the file and reconfiguring your relays. - **Protect Your Passwords:** Do not share your master password or seed phrases with anyone and ensure they are strong and unique. +- **Revealing the Parent Seed:** The `vault reveal-parent-seed` command and `/api/v1/parent-seed` endpoint print your seed in plain text. Run them only in a secure environment. - **No PBKDF2 Salt Needed:** SeedPass deliberately omits an explicit PBKDF2 salt. Every password is derived from a unique 512-bit BIP-85 child seed, which already provides stronger per-password uniqueness than a conventional 128-bit salt. - **Checksum Verification:** Always verify the script's checksum to ensure its integrity and protect against unauthorized modifications. - **Potential Bugs and Limitations:** Be aware that the software may contain bugs and lacks certain features. Snapshot chunks are capped at 50 KB and the client rotates snapshots after enough delta events accumulate. The security of memory management and logs has not been thoroughly evaluated and may pose risks of leaking sensitive information. diff --git a/docs/README.md b/docs/README.md index bd25730..bece44b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,14 +4,22 @@ This directory contains supplementary guides for using SeedPass. ## Quick Example: Get a TOTP Code -Run `seedpass totp ` to retrieve a time-based one-time password (TOTP). The -`` can be a label, title, or index. A progress bar shows the remaining +Run `seedpass entry get ` to retrieve a time-based one-time password (TOTP). +The `` can be a label, title, or index. A progress bar shows the remaining seconds in the current period. ```bash -$ seedpass totp "email" +$ seedpass entry get "email" [##########----------] 15s Code: 123456 ``` -See [advanced_cli.md](advanced_cli.md) (future feature set) for details on the upcoming advanced CLI. +To show all stored TOTP codes with their countdown timers, run: + +```bash +$ seedpass entry totp-codes +``` + +## CLI and API Reference + +See [advanced_cli.md](advanced_cli.md) for a list of command examples. Detailed information about the REST API is available in [api_reference.md](api_reference.md). When starting the API, set `SEEDPASS_CORS_ORIGINS` if you need to allow requests from specific web origins. diff --git a/docs/advanced_cli.md b/docs/advanced_cli.md index 0ed3070..0148aa5 100644 --- a/docs/advanced_cli.md +++ b/docs/advanced_cli.md @@ -6,7 +6,7 @@ Welcome to the **Advanced CLI and API Documentation** for **SeedPass**, a secure SeedPass uses a `noun-verb` command structure (e.g., `seedpass entry get `) for a clear, scalable, and discoverable interface. You can explore the available actions for any command group with the `--help` flag (for example, `seedpass entry --help`). -> **Note:** These commands describe planned functionality. The advanced CLI is not yet part of the stable release but will follow the current SeedPass design of fingerprint-based profiles and a local API for secure integrations. +The commands in this document reflect the Typer-based CLI shipped with SeedPass. Each command accepts the optional `--fingerprint` flag to operate on a specific seed profile. --- @@ -20,8 +20,9 @@ SeedPass uses a `noun-verb` command structure (e.g., `seedpass entry get - [Config Commands](#config-commands) - [Fingerprint Commands](#fingerprint-commands) - [Utility Commands](#utility-commands) + - [API Commands](#api-commands) 3. [Detailed Command Descriptions](#detailed-command-descriptions) -4. [Planned API Integration](#planned-api-integration) +4. [API Integration](#api-integration) 5. [Usage Guidelines](#usage-guidelines) --- @@ -45,12 +46,22 @@ Manage individual entries within a vault. | Action | Command | Examples | | :--- | :--- | :--- | -| Add a new entry | `entry add` | `seedpass entry add --type password --label "GitHub" --username "user" --length 20` | -| Retrieve an entry's secret | `entry get` | `seedpass entry get "GitHub"` | | List entries | `entry list` | `seedpass entry list --sort label` | | Search for entries | `entry search` | `seedpass entry search "GitHub"` | -| Modify an entry | `entry modify` | `seedpass entry modify "GitHub" --notes "New note"` | -| Delete an entry | `entry delete` | `seedpass entry delete "GitHub"` | +| Retrieve an entry's secret (password or TOTP code) | `entry get` | `seedpass entry get "GitHub"` | +| Add a password entry | `entry add` | `seedpass entry add Example --length 16` | +| Add a TOTP entry | `entry add-totp` | `seedpass entry add-totp Email --secret JBSW...` | +| Add an SSH key entry | `entry add-ssh` | `seedpass entry add-ssh Server --index 0` | +| Add a PGP key entry | `entry add-pgp` | `seedpass entry add-pgp Personal --user-id me@example.com` | +| Add a Nostr key entry | `entry add-nostr` | `seedpass entry add-nostr Chat` | +| Add a seed phrase entry | `entry add-seed` | `seedpass entry add-seed Backup --words 24` | +| Add a key/value entry | `entry add-key-value` | `seedpass entry add-key-value "API Token" --value abc123` | +| Add a managed account entry | `entry add-managed-account` | `seedpass entry add-managed-account Trading` | +| Modify an entry | `entry modify` | `seedpass entry modify 1 --username alice` | +| Archive an entry | `entry archive` | `seedpass entry archive 1` | +| Unarchive an entry | `entry unarchive` | `seedpass entry unarchive 1` | +| Export all TOTP secrets | `entry export-totp` | `seedpass entry export-totp --file totp.json` | +| Show all TOTP codes | `entry totp-codes` | `seedpass entry totp-codes` | ### Vault Commands @@ -60,7 +71,9 @@ Manage the entire vault for a profile. | :--- | :--- | :--- | | Export the vault | `vault export` | `seedpass vault export --file backup.json` | | Import a vault | `vault import` | `seedpass vault import --file backup.json` | -| Change master password | `vault changepw` | `seedpass vault changepw` | +| Change the master password | `vault change-password` | `seedpass vault change-password` | +| Lock the vault | `vault lock` | `seedpass vault lock` | +| Show profile statistics | `vault stats` | `seedpass vault stats` | ### Nostr Commands @@ -70,7 +83,6 @@ Interact with the Nostr network for backup and synchronization. | :--- | :--- | :--- | | Sync with relays | `nostr sync` | `seedpass nostr sync` | | Get public key | `nostr get-pubkey` | `seedpass nostr get-pubkey` | -| Manage relays | `nostr relays` | `seedpass nostr relays --add wss://relay.example.com` | ### Config Commands @@ -79,7 +91,7 @@ Manage profile‑specific settings. | Action | Command | Examples | | :--- | :--- | :--- | | Get a setting value | `config get` | `seedpass config get inactivity_timeout` | -| Set a setting value | `config set` | `seedpass config set secret_mode true` | +| Set a setting value | `config set` | `seedpass config set inactivity_timeout 300` | ### Fingerprint Commands @@ -87,10 +99,10 @@ Manage seed profiles (fingerprints). | Action | Command | Examples | | :--- | :--- | :--- | -| Add a new profile | `fingerprint add` | `seedpass fingerprint add` | | List all profiles | `fingerprint list` | `seedpass fingerprint list` | -| Remove a profile | `fingerprint remove` | `seedpass fingerprint remove ` | -| Set active profile | `fingerprint use` | `seedpass fingerprint use ` | +| Add a profile | `fingerprint add` | `seedpass fingerprint add` | +| Remove a profile | `fingerprint remove` | `seedpass fingerprint remove ` | +| Switch profile | `fingerprint switch` | `seedpass fingerprint switch ` | ### Utility Commands @@ -100,6 +112,16 @@ Miscellaneous helper commands. | :--- | :--- | :--- | | Generate a password | `util generate-password` | `seedpass util generate-password --length 24` | | Verify script checksum | `util verify-checksum` | `seedpass util verify-checksum` | +| Update script checksum | `util update-checksum` | `seedpass util update-checksum` | + +### API Commands + +Run or stop the local HTTP API. + +| Action | Command | Examples | +| :--- | :--- | :--- | +| Start the API | `api start` | `seedpass api start --host 0.0.0.0 --port 8000` | +| Stop the API | `api stop` | `seedpass api stop` | --- @@ -107,47 +129,76 @@ Miscellaneous helper commands. ### `entry` Commands -- **`seedpass entry add`** – Add a new entry. Use `--type` to specify `password`, `totp`, `ssh`, `pgp`, `nostr`, `key-value`, or `managed-account`. Include `--tags tag1,tag2` to categorize the entry. -- **`seedpass entry get `** – Retrieve the primary secret for one matching entry. - **`seedpass entry list`** – List entries in the vault, optionally sorted or filtered. -- **`seedpass entry search `** – Search across labels, usernames, URLs, notes, and tags. -- **`seedpass entry modify `** – Update fields on an existing entry. Use `--archive` to hide or `--restore` to un‑archive. Specify `--tags tag1,tag2` to replace the entry's tags. -- **`seedpass entry delete `** – Permanently delete an entry after confirmation. +- **`seedpass entry search `** – Search across labels, usernames, URLs and notes. +- **`seedpass entry get `** – Retrieve the password or TOTP code for one matching entry, depending on the entry's type. +- **`seedpass entry add