npm-cred
v3.0.0
Published
A secure CLI tool for managing multiple credential vaults
Maintainers
Readme
npm-cred
A secure command-line tool for managing multiple credential vaults. Store and manage your sensitive credentials (like API keys, passwords, tokens) in encrypted vaults with ease.
Features
- 🔒 Create multiple secure vaults for organizing different types of credentials
- 🔑 Strong encryption for all stored credentials
- 🔐 Lock/unlock vaults with passwords
- ✨ Simple and intuitive command-line interface
- 📝 Store, view, and delete credentials easily
- 🛡️ Secure password validation and storage
Installation
npm install -g npm-credRequires Node.js version 14.16 or higher.
Quick Start
- Create a new vault:
npm-cred create- Store a credential (vault must be unlocked):
npm-cred store my-vault api-key "your-secret-api-key"- View credentials in a vault:
npm-cred view my-vaultCommands
Managing Vaults
Create a vault
npm-cred createCreates a new vault with a name and password (minimum 5 characters each)
List all vaults
npm-cred listShows all existing vaults and their lock status
Lock a vault
npm-cred lock <vault-name>Locks an unlocked vault
Unlock a vault
npm-cred unlock <vault-name>Unlocks a locked vault using its password
Delete a vault
npm-cred delete <vault-name>Deletes a vault and all its credentials (requires password verification)
Use
-for--forceflag to delete without password verification:npm-cred delete <vault-name> --force
Managing Credentials
Store a credential
npm-cred store <vault-name> <credential-name> <credential-value>Stores a new credential in an unlocked vault
View credentials
npm-cred view <vault-name>Displays all credentials in an unlocked vault
Delete a credential
npm-cred delete-cred <vault-name> <credential-name>Deletes a specific credential from an unlocked vault
Usage Examples
Example 1: Managing GitHub Credentials
- Create a vault for GitHub credentials:
npm-cred create
# Enter vault name: github-creds
# Enter vault password: your-secure-password- Unlock the vault:
npm-cred unlock github-creds
# Enter vault password: your-secure-password- Store a GitHub token:
npm-cred store github-creds personal-access-token "ghp_your_token_here"- View stored credentials:
npm-cred view github-credsExample 2: Managing Multiple Projects
- Create separate vaults for different projects:
npm-cred create
# Enter vault name: project-a
# Enter vault password: password-a
npm-cred create
# Enter vault name: project-b
# Enter vault password: password-b- Store different credentials in each vault:
npm-cred unlock project-a
npm-cred store project-a db-password "db-secret-here"
npm-cred store project-a api-key "api-secret-here"
npm-cred unlock project-b
npm-cred store project-b aws-key "aws-secret-here"Security Best Practices
- Use strong, unique passwords for each vault
- Lock vaults when not in use
- Don't share vault passwords
- Use different vaults for different security contexts
- Regularly review and update stored credentials
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Troubleshooting
Common Issues
"Command not found" error
# If you see: 'npm-cred' is not recognized as an internal or external command # Try reinstalling globally with: npm uninstall -g npm-cred npm install -g npm-credVault is locked when trying to store/view credentials
# First unlock the vault: npm-cred unlock <vault-name> # Then try your command againForgot vault password
- For security reasons, vault passwords cannot be recovered
- You'll need to delete the vault using the force flag and create a new one:
npm-cred delete <vault-name> --force npm-cred createPermission errors on Linux/Mac
# If you see permission errors, try: sudo npm install -g npm-cred
Tips for Beginners
Start Small
- Create a test vault first to experiment with the commands
- Use simple, memorable passwords while learning (but use strong passwords for real credentials!)
Common Workflows
Basic workflow:
npm-cred create # Create a vault npm-cred store vault1 key1 "value1" # Store a credential npm-cred lock vault1 # Lock when doneDaily usage workflow:
npm-cred unlock vault1 # Start of day npm-cred view vault1 # Use credentials as needed npm-cred lock vault1 # End of dayManaging multiple vaults:
npm-cred list # Check vault status npm-cred unlock vault1 # Unlock needed vault npm-cred view vault1 # Use credentials npm-cred lock vault1 # Lock when doneCommand Structure
npm-cred <command> <vault-name> [additional-parameters]Getting Help
npm-cred --help # Show all commands npm-cred create --help # Show help for create command npm-cred store --help # Show help for store command
Support
If you encounter any issues or have questions, please file an issue at: https://github.com/VinayakGaikwad101/npm-cred/issues
