feat: add SFTP file transfer with upload/download commands#3
Merged
Conversation
- Add glob dependency for pattern matching - Implement local glob expansion for upload command - Support uploading multiple files with wildcards (*.txt, logs/*.log) - Implement remote glob expansion for download via SSH ls command - Support downloading multiple files with wildcards - Add automatic directory detection for multi-file uploads - Add human-readable file size formatting - Update manpage with glob pattern examples - Add test_glob.sh script for testing glob functionality This allows users to: - Upload multiple files: bssh upload "*.log" /remote/dir/ - Download with patterns: bssh download "/var/log/*.log" ./downloads/ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add unit tests for CLI command parsing (upload/download) - Add unit tests for executor file transfer results - Add glob pattern matching tests - Add error handling tests for various failure scenarios - Add integration tests for localhost SSH operations - Test coverage for: * Upload/download result structures * Parallel executor with file transfers * Glob pattern resolution * Error cases (invalid hosts, ports, files) * Multiple file operations All unit tests pass (47 tests total). Integration tests require SSH server on localhost to run successfully. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add SSH key detection for integration tests - Only use SSH key if it exists, otherwise fall back to agent - Update CI workflow to skip integration tests - Fix formatting in all test files - Ensure tests work both locally and in GitHub Actions Integration tests now gracefully handle environments without: - SSH keys - SSH agent identities - localhost SSH access 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
This PR implements comprehensive SFTP file transfer functionality for bssh, enabling secure file upload and download operations across multiple cluster nodes in parallel.
Changes
Core SFTP Implementation
copycommand touploadfor better claritydownloadcommand for retrieving filesGlob Pattern Support (NEW)
*.txt,logs/*.log)Progress Tracking
Documentation
Usage Examples
Upload files with glob patterns
Download files with glob patterns
Single file operations
Technical Details
Testing
test_glob.shscript for glob pattern testingChecklist
This completes the SFTP implementation milestone from TODO.md.