Closed
Conversation
- Add ws package as dev dependency for WebSocket client
- Create cli/ystp.js with full CLI support:
* ystp send <file> - sends a file and returns shareable code
* ystp receive <code> [--output filename] - receives a file using code
- Features:
* Configurable host/port with defaults (localhost:8787)
* Progress display during transfers
* Proper WebSocket protocol handling (64KB chunks, JSON metadata, EOF marker, LET_IT_RIP approval)
* Error handling and connection management
- Add bin entry point to package.json for global ystp command usage
- CLI can be used via 'node cli/ystp.js' or after npm link as 'ystp'
Owner
|
@drdoc what if I wanted to do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds a command-line interface (CLI) client for YSTP, allowing you to share files directly from the terminal without needing to use the web interface.
Features
Commands
ystp send <file>- Sends a file and returns a shareable 5-word mnemonic codeystp receive <code>- Receives a file using the shareable code--output <filename>- Optional flag to specify output filename when receivingOptions
--host <hostname>- Connect to a different host (default: localhost)--port <port>- Connect to a different port (default: 8787)Protocol Implementation
The CLI follows the exact WebSocket protocol:
EOFmarker to signal end of transferLET_IT_RIPapproval mechanism for receiver consentUsage Examples
Send a file:
Or after running
npm link:Output:
Receive a file:
Or with a custom output filename:
Output:
Connect to a different server:
Changes Made
New Files
cli/ystp.js- Full-featured CLI client implementationModified Files
package.json- Addedwsdependency and bin entry pointInstallation
After merging, users can:
Technical Details
wspackage for WebSocket client implementation in Node.jswss://(secure) andws://(insecure) protocols