A bidirectional command-line tool for transferring files and folders between your PC and Android device via ADB (Android Debug Bridge).
- Bidirectional transfer: PC → Phone and Phone → PC
- Multi-path support: Register and save frequently used paths
- Manual path input: Enter custom paths on-the-fly
- Interactive selection: Browse and select files/folders with
@clack/prompts - Nested browsing: Choose to copy entire directories or select files inside
- Real-time progress: Transfer statistics (size, time, speed)
- Auto-save paths: Automatically save manually entered paths for future use
Install Bun if you haven't already:
curl -fsSL https://bun.sh/install | bashsudo apt update
sudo apt install adbsudo dnf install android-toolssudo pacman -S android-toolsbrew install android-platform-tools- Download Android SDK Platform Tools
- Extract the ZIP file
- Add the folder to your system PATH
Verify ADB installation:
adb --version- Open Settings on your Android device
- Go to About Phone
- Tap Build Number 7 times until you see "You are now a developer"
- Go back to Settings
- Open Developer Options (or System > Developer Options)
- Enable USB Debugging
- Connect your Android device to your computer via USB
- On your device, a prompt will appear asking to "Allow USB debugging"
- Check "Always allow from this computer" and tap OK
adb devicesYou should see your device listed:
List of devices attached
XXXXXXXXXX device
If you see "unauthorized", check your phone for the authorization prompt.
- Clone or download this project:
git clone <repository-url>
cd adb-transfer-cli- Install dependencies:
bun install- (Optional) Pre-configure paths in
app.config.json:
{
"pcPaths": [
"/home/user/Documents/Files",
"/home/user/Downloads"
],
"phonePaths": [
"/sdcard/Download",
"/sdcard/DCIM"
]
}Note: You can also add paths during runtime via manual input, which will be automatically saved to the config file.
./index.tsOr:
bun startOr:
bun run transfer-
Select transfer direction:
◆ Select transfer direction: │ ○ Copy from PC to Phone │ ○ Copy from Phone to PC └ -
Select source path (from registered paths or manual input):
◆ Select PC path: │ ○ /home/user/Documents │ ○ /home/user/Downloads │ ○ + Enter path manually └ -
Select files/folders from source:
◆ Select items to transfer: │ ☑ 📁 Photos │ ☑ 📄 document.pdf │ ☐ 📁 Videos └ -
For directories: Choose to copy whole or browse inside:
◆ "Photos" is a directory. What would you like to do? │ ○ Copy entire directory │ ○ Select files inside └ -
Select destination path (from registered paths or manual input)
-
Transfer with progress:
⠋ Transferring: Photos ✓ Photos - 245.67 MB - 12.3s - 19.97 MB/s
# List connected devices
adb devices
# Restart ADB server
adb kill-server
adb start-server- Ensure USB debugging is enabled
- Re-authorize your computer on the device
- Try a different USB cable or port
- Check USB connection mode (should be "File Transfer" or "MTP")
# Test if target folder is writable
adb shell ls -la /sdcard/
# Create target folder manually
adb shell mkdir -p /sdcard/Manga- Use USB 3.0 port if available
- Close other ADB connections
- Avoid USB hubs
- Enable "USB Tethering" on some devices for faster transfers
- Verify the path exists and is accessible
- Check permissions for PC folders
- For phone paths, ensure the device is connected and authorized
adb-transfer-cli/
├── app.config.json # Path configuration
├── index.ts # Main entry point
├── package.json # Project dependencies
├── src/
│ ├── config.ts # Config management
│ ├── transfer.ts # Transfer logic
│ ├── ui.ts # Interactive UI
│ └── utils.ts # Helper functions
└── README.md # This file
- Runtime: Bun
- Language: TypeScript
- UI Library: @clack/prompts
- Transfer Method: ADB push/pull commands
- Transfer Mode: Sequential (one item at a time)
- Direction: Bidirectional (PC ↔ Phone)
MIT
Contributions are welcome! Please feel free to submit a Pull Request.