A simple, local password manager built with Go and Cobra. This project serves as a learning exercise for building command-line interface (CLI) applications in Go.
This is one of my first projects in Go, created for learning purposes. It was a great way for me to understand CLI development with Cobra, file I/O, and basic cryptography in Go.
Please DO NOT use this tool to store real, sensitive passwords. The project might contain bugs, security vulnerabilities, or practices that are not ideal for a production-grade security application or anything close to that.
For development and testing convenience, the vault.json file is currently created in the same directory where you run the command.
If you'd like to experiment, you can easily change this to a more conventional location, such as your user's home or configuration directory. To do so, simply modify the GetVaultPath() function within the utils package to return a static path like ~/.config/passkey-cli/vault.json.
This change would prevent a new vault from being created in every directory you use the tool from, making it feel more like a system-wide application. Just remember, this is still a learning project, and this modification does not make it secure for real-world use.
- Secure Vault Initialization: Creates a local vault protected by a master passkey.
- CRUD Operations: Full support for adding, listing, updating, and deleting services.
- Automatic Password Generation: Automatically generates a strong, random password for each new service.
- Clipboard Integration: Easily copy any service's password directly to the clipboard.
- Secure Passkey Hashing: Uses Argon2id to securely hash the master passkey.
You need to have Go installed on your system to run this application.
-
Clone the repository to your local machine:
git clone https://github.com/diegoAndradeD/passkey-cli.git cd passkey-cli -
Install the binary:
go install .This will compile the project and place the
passkey-cliexecutable in your Go bin directory (usually$GOPATH/binor$HOME/go/bin). Make sure this directory is in your system'sPATH.
All commands require a master passkey to access the vault. This ensures that your stored credentials can only be accessed by you.
Before you can use the password manager, you must initialize the vault. This command creates the vault.json file in your current directory.
passkey-cli setup --passkey "your-strong-master-password"Adds a new service to the vault and automatically generates a password for it.
Usage:
passkey-cli add --name <service-name> --passkey <your-master-passkey>Example:
passkey-cli add --name "github" --passkey "your-strong-master-password"Lists all stored services or shows the details for a specific one.
Usage:
# List all services
passkey-cli list --passkey <your-master-passkey>
# Show details for a specific service
passkey-cli list --service <service-name> --passkey <your-master-passkey>Examples:
passkey-cli list --passkey "your-strong-master-password"
passkey-cli list --service "github" --passkey "your-strong-master-password"Copies a service's password directly to your system's clipboard.
Usage:
passkey-cli copy --name <service-name> --passkey <your-master-passkey>Example:
passkey-cli copy --name "github" --passkey "your-strong-master-password"Updates a service's name and can optionally regenerate its password.
Usage:
passkey-cli update --old <current-name> --new <new-name> --passkey <your-master-passkey>Examples:
# Update the name only
passkey-cli update --old "github" --new "github-work" --passkey "your-strong-master-password"
# Update the name and regenerate the password
passkey-cli update --old "github" --new "github-work" --regen --passkey "your-strong-master-password"Removes a service from the vault permanently.
Usage:
passkey-cli delete --name <service-name> --passkey <your-master-passkey>Example:
passkey-cli delete --name "github" --passkey "your-strong-master-password"- The application stores all data in a single
vault.jsonfile in the directory where you run the command. - The contents of the vault are stored in plain text, but the vault itself is protected by a hashed master passkey.
- The master passkey you provide is hashed using Argon2id, a modern and secure key derivation function.
- Access to the vault is only granted if the passkey you provide matches the stored hash. This prevents anyone from reading the vault file without knowing the master passkey.
This project is licensed under the MIT License.