This commit is contained in:
Keep Creating Online
2024-10-21 21:09:06 -04:00
parent e81142adb9
commit 724f0cc7d5

122
README.md
View File

@@ -251,6 +251,16 @@ For any questions, suggestions, or support, please open an issue on the [GitHub
- **Scalability:** Facilitates handling larger databases by allowing the index to be pieced together from multiple posts rather than relying on a single large file.
- **Reliability:** Enhances the robustness of data retrieval by distributing the index across multiple posts, reducing the impact of potential data corruption in any single post.
- **Automatically Post Index to Nostr After Every Edit**
- **Description:** Implement an automated process where any modification to the password index triggers an immediate update to the Nostr relays.
- **Benefits:**
- **Real-Time Backups:** Ensures that backups are always up-to-date with the latest changes.
- **Data Consistency:** Minimizes the risk of discrepancies between local data and Nostr backups.
- **Suggested Approach:**
- **Hook Integration:** Integrate hooks in the `EntryManager` or relevant modules to detect changes and trigger posting.
- **Error Handling:** Implement robust error handling to manage failed posts without disrupting the user's workflow.
- **User Notifications:** Inform users of the backup status after each edit (e.g., success, failure).
### **7. Advanced CLI Mode**
- **Develop an Advanced CLI Mode with Enhanced Functionalities**
- **Description:** Create a more sophisticated Command-Line Interface (CLI) mode that supports advanced operations beyond the basic functionalities.
@@ -258,6 +268,8 @@ For any questions, suggestions, or support, please open an issue on the [GitHub
- **Custom Relays Configuration:** Allow users to specify a custom set of Nostr relays for publishing their backup index.
- **Batch Posting:** Enable the CLI to handle the segmentation of index entries into batches of 10 for Nostr posts.
- **Toggle "Secret" Mode:** Provide CLI commands to enable or disable "secret" mode for clipboard-only password retrieval.
- **Automated Nostr Posting:** Ensure that any edit to the index automatically triggers a post to Nostr.
- **Initial Setup Enhancements:** Implement features to handle the first-time user experience, including seed generation/import and initial Nostr profile creation.
- **Suggested Approach:**
- **Command Structure:** Design intuitive commands and flags to manage advanced settings.
- **User Feedback:** Ensure that the CLI provides clear feedback and confirmations for advanced operations.
@@ -269,71 +281,65 @@ For any questions, suggestions, or support, please open an issue on the [GitHub
Here's an expanded table of **Advanced CLI Commands** that incorporates both your existing commands and the new functionalities you've outlined:
| **Action** | **Command** | **Short Flag** | **Long Flag** | **Example Command** |
|-------------------------------------------|------------------------|----------------|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Add a new password entry | `add` | `-A` | `--add` | `passmgr add --title "GitHub" --url "https://github.com" --username "john_doe" --email "john@example.com" --notes "Primary GitHub account" --tags "work,development" --length 20` |
| **Action** | **Command** | **Short Flag** | **Long Flag** | **Example Command** |
|-------------------------------------------|------------------------|----------------|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Add a new password entry | `add` | `-A` | `--add` | `passmgr add --title "GitHub" --url "https://github.com" --username "john_doe" --email "john@example.com" --notes "Primary GitHub account" --tags "work,development" --length 20` |
| Retrieve a password entry | `retrieve` | `-R` | `--retrieve` | `passmgr retrieve --index 3` or `passmgr retrieve --title "GitHub"` |
| Modify an existing entry | `modify` | `-M` | `--modify` | `passmgr modify --index 3 --title "GitHub Pro" --notes "Updated to pro account" --tags "work,development,pro" --length 22` |
| Delete an entry | `delete` | `-D` | `--delete` | `passmgr delete --index 3` |
| List all entries | `list` | `-L` | `--list` | `passmgr list` |
| Search for a password entry | `search` | `-S` | `--search` | `passmgr search --query "GitHub"` |
| Export passwords to a file | `export` | `-E` | `--export` | `passmgr export --file "backup_passwords.json"` |
| Import passwords from a file | `import` | `-I` | `--import` | `passmgr import --file "backup_passwords.json"` |
| Display help information | `help` | `-H` | `--help` | `passmgr help` |
| Display application version | `version` | `-V` | `--version` | `passmgr version` |
| Change master password | `changepw` | `-C` | `--changepw` | `passmgr changepw --new "NewSecureP@ssw0rd!"` |
| Enable auto-lock | `autolock --enable` | `-AL` | `--auto-lock --enable` | `passmgr autolock --enable --timeout 10` |
| Disable auto-lock | `autolock --disable` | `-DL` | `--auto-lock --disable` | `passmgr autolock --disable` |
| Generate a strong password | `generate` | `-G` | `--generate` | `passmgr generate --length 20` |
| Verify script checksum | `verify` | `-V` | `--verify` | `passmgr verify` |
| Post encrypted index to Nostr | `post` | `-P` | `--post` | `passmgr post` |
| Retrieve from Nostr | `get-nostr` | `-GN` | `--get-nostr` | `passmgr get-nostr` |
| Display Nostr public key | `show-pubkey` | `-K` | `--show-pubkey` | `passmgr show-pubkey` |
| **Set Custom Nostr Relays** | `set-relays` | `-SR` | `--set-relays` | `passmgr set-relays --add "wss://relay1.example.com" --add "wss://relay2.example.com"` |
| **Enable "Secret" Mode** | `set-secret` | `-SS` | `--set-secret` | `passmgr set-secret --enable` or `passmgr set-secret --disable` |
| **Batch Post Index Items to Nostr** | `batch-post` | `-BP` | `--batch-post` | `passmgr batch-post --start 0 --end 9` or `passmgr batch-post --range 10-19` |
| **Show All Passwords** | `show-all` | `-SA` | `--show-all` | `passmgr show-all` |
| **Add Notes to an Entry** | `add-notes` | `-AN` | `--add-notes` | `passmgr add-notes --index 3 --notes "This is a secured account"` |
| **Add Tags to an Entry** | `add-tags` | `-AT` | `--add-tags` | `passmgr add-tags --index 3 --tags "personal,finance"` |
| **Search by Tag or Title** | `search-by` | `-SB` | `--search-by` | `passmgr search-by --tag "work"` or `passmgr search-by --title "GitHub"` |
| Delete an entry | `delete` | `-D` | `--delete` | `passmgr delete --index 3` |
| List all entries | `list` | `-L` | `--list` | `passmgr list` |
| Search for a password entry | `search` | `-S` | `--search` | `passmgr search --query "GitHub"` |
| Export passwords to a file | `export` | `-E` | `--export` | `passmgr export --file "backup_passwords.json"` |
| Import passwords from a file | `import` | `-I` | `--import` | `passmgr import --file "backup_passwords.json"` |
| Display help information | `help` | `-H` | `--help` | `passmgr help` |
| Display application version | `version` | `-V` | `--version` | `passmgr version` |
| Change master password | `changepw` | `-C` | `--changepw` | `passmgr changepw --new "NewSecureP@ssw0rd!"` |
| Enable auto-lock | `autolock --enable` | `-AL` | `--auto-lock --enable` | `passmgr autolock --enable --timeout 10` |
| Disable auto-lock | `autolock --disable` | `-DL` | `--auto-lock --disable` | `passmgr autolock --disable` |
| Generate a strong password | `generate` | `-G` | `--generate` | `passmgr generate --length 20` |
| Verify script checksum | `verify` | `-V` | `--verify` | `passmgr verify` |
| Post encrypted index to Nostr | `post` | `-P` | `--post` | `passmgr post` |
| Retrieve from Nostr | `get-nostr` | `-GN` | `--get-nostr` | `passmgr get-nostr` |
| Display Nostr public key | `show-pubkey` | `-K` | `--show-pubkey` | `passmgr show-pubkey` |
| **Set Custom Nostr Relays** | `set-relays` | `-SR` | `--set-relays` | `passmgr set-relays --add "wss://relay1.example.com" --add "wss://relay2.example.com"` |
| **Enable "Secret" Mode** | `set-secret` | `-SS` | `--set-secret` | `passmgr set-secret --enable` or `passmgr set-secret --disable` |
| **Batch Post Index Items to Nostr** | `batch-post` | `-BP` | `--batch-post` | `passmgr batch-post --start 0 --end 9` or `passmgr batch-post --range 10-19` |
| **Show All Passwords** | `show-all` | `-SA` | `--show-all` | `passmgr show-all` |
| **Add Notes to an Entry** | `add-notes` | `-AN` | `--add-notes` | `passmgr add-notes --index 3 --notes "This is a secured account"` |
| **Add Tags to an Entry** | `add-tags` | `-AT` | `--add-tags` | `passmgr add-tags --index 3 --tags "personal,finance"` |
| **Search by Tag or Title** | `search-by` | `-SB` | `--search-by` | `passmgr search-by --tag "work"` or `passmgr search-by --title "GitHub"` |
| **Automatically Post Index to Nostr After Edit** | `auto-post` | `-AP` | `--auto-post` | `passmgr auto-post --enable` or `passmgr auto-post --disable` |
| **Initial Setup Prompt for Seed Generation/Import** | `setup` | `-ST` | `--setup` | `passmgr setup` |
---
### **Notes on New CLI Commands**
1. **Set Custom Nostr Relays (`set-relays`):**
- **Purpose:** Allows users to specify which Nostr relays their backup indexes should be published to.
1. **Automatically Post Index to Nostr After Edit (`auto-post`):**
- **Purpose:** Enables or disables the automatic posting of the index to Nostr whenever an edit occurs.
- **Usage Examples:**
- Add multiple relays: `passmgr set-relays --add "wss://relay1.example.com" --add "wss://relay2.example.com"`
- Remove a relay: `passmgr set-relays --remove "wss://relay1.example.com"`
- List current relays: `passmgr set-relays --list`
- Enable auto-post: `passmgr auto-post --enable`
- Disable auto-post: `passmgr auto-post --disable`
2. **Enable "Secret" Mode (`set-secret`):**
- **Purpose:** Toggles the "secret" mode where passwords are copied to the clipboard instead of being displayed on the screen.
- **Usage Examples:**
- Enable secret mode: `passmgr set-secret --enable`
- Disable secret mode: `passmgr set-secret --disable`
2. **Initial Setup Prompt for Seed Generation/Import (`setup`):**
- **Purpose:** Guides users through the initial setup process, allowing them to choose between generating a new seed or importing an existing one.
- **Features to Implement:**
- **Seed Choice Prompt:** Ask users whether they want to generate a new seed or import an existing one.
- **Encryption of Seed:** Use the user-selected password to encrypt the seed, whether generated or imported.
- **Nostr Profile Creation:** Upon first login, automatically generate a Nostr profile and check for existing index data notes that can be pulled and decrypted.
- **Usage Example:** `passmgr setup`
3. **Batch Post Index Items to Nostr (`batch-post`):**
- **Purpose:** Publishes segments of the index (e.g., 10 items per post) to Nostr to manage large databases efficiently.
- **Usage Examples:**
- Post indexes 0-9: `passmgr batch-post --start 0 --end 9`
- Post indexes 10-19: `passmgr batch-post --range 10-19`
4. **Show All Passwords (`show-all`):**
- **Purpose:** Displays all stored passwords along with their index entries.
- **Usage Example:** `passmgr show-all`
5. **Add Notes to an Entry (`add-notes`):**
- **Purpose:** Adds or updates the "Notes" field for a specific password entry.
- **Usage Example:** `passmgr add-notes --index 3 --notes "This is a secured account"`
6. **Add Tags to an Entry (`add-tags`):**
- **Purpose:** Adds or updates the "Tags" field for a specific password entry.
- **Usage Example:** `passmgr add-tags --index 3 --tags "personal,finance"`
7. **Search by Tag or Title (`search-by`):**
- **Purpose:** Enables searching for password entries based on tags or titles.
- **Usage Examples:**
- Search by tag: `passmgr search-by --tag "work"`
- Search by title: `passmgr search-by --title "GitHub"`
3. **Advanced CLI Enhancements:**
- **Toggle "Secret" Mode via CLI:**
- **Description:** Allow users to enable or disable "secret" mode directly through the CLI.
- **Usage Examples:**
- Enable secret mode: `passmgr set-secret --enable`
- Disable secret mode: `passmgr set-secret --disable`
- **Initial Seed Setup Flow:**
- **Description:** When running `passmgr setup`, prompt users to either enter an existing seed or generate a new one, followed by password creation for encryption.
- **Usage Example:** `passmgr setup`
- **Automatic Nostr Profile Generation and Index Retrieval:**
- **Description:** During the initial setup or first login, generate a Nostr profile and attempt to retrieve and decrypt any existing index data from Nostr.
- **Usage Example:** `passmgr setup` (handles internally)