clipshare-cli v1.0.4
ClipShare CLI
ClipShare CLI is a command-line utility for developers to securely share sensitive information, such as environment variables, directly in their terminals. It uses WebSockets for real-time communication and AES-GCM encryption to ensure the secure transmission of secrets.
Features
End-to-End Encryption: Share secrets securely using AES-GCM encryption.
WebSocket Communication: Real-time exchange of secrets.
Key Management: Generate, encrypt, and decrypt secrets with pre-shared keys.
Simple and Intuitive Commands: Easy-to-use commands for common tasks.
Installation
You can install ClipShare CLI via npm:
npm install -g clipshareGetting Started
Ensure you have a WebSocket server running before using the CLI. You can start the included server with:
node server.tsThis will start a WebSocket server at ws://localhost:8080.
Basic Workflow
Generate or set a pre-shared encryption key.
Encrypt the secret you want to share.
Send the encrypted secret to the recipient.
The recipient receives and decrypts the secret.
Usage
Commands
Here are the commands supported by ClipShare CLI:
1. Generate a New Encryption Key
Generate a secure encryption key for sharing secrets.
clipshare generate-keyOutput:
Generated key: <your-key>2. Set a Pre-Shared Key
Store a pre-shared key for encrypting and decrypting secrets.
clipshare set-key <key>Example:
clipshare set-key mySuperSecretKeyOutput:
Pre-shared key set: mySuperSecretKey3. Encrypt a Secret
Encrypt a secret using a key.
clipshare encrypt <secret>Example:
clipshare encrypt "myPassword123"Output:
Encrypted data: <encrypted-secret>
IV: <initialization-vector>
Key: <key>4. Decrypt a Secret
Decrypt a previously encrypted secret.
clipshare decrypt <encryptedData> <iv> <key>Example:
clipshare decrypt <encrypted-data> <iv> <key>Output:
Decrypted secret: myPassword1235. Send a Secret
Encrypt and send a secret to a recipient via WebSocket.
clipshare send <recipient> <secret> <key>Example:
clipshare send user123 "mySecret123" myEncryptionKeyOutput:
Message sent.6. Receive a Secret
Listen for and decrypt incoming secrets.
clipshare receive <key>Example:
clipshare receive myEncryptionKeyOutput:
Received secret: mySecret123WebSocket Server
The WebSocket server handles client communication. It assigns temporary IDs to clients and facilitates message routing.
Starting the Server
node server.tsOutput:
WebSocket server started on ws://localhost:8080Logs
Client connection:
Client connected with ID: <client-id>Message received:
received: <message>Client disconnection:
Client disconnected with ID: <client-id>
Security Notes
- Use strong, randomly generated keys.
- Avoid sharing keys through insecure channels.
- Run the WebSocket server in a secure environment.
Development
Run Locally
Clone the repository:
git clone https://github.com/jcopperman/clipshare-cli.git
cd clipshare-cliInstall dependencies:
npm installRun the CLI tool:
node cli.tsStart the WebSocket server:
node server.tsLicense
This project is licensed under the MIT License. See the LICENSE file for details.
Support My Work
If you find this tool helpful, please consider supporting me on GitHub Sponsors. Your support helps keep this project alive and maintained!