A lightweight CLI tool for establishing SSH connections using password or private key authentication and exploring the files present in server. Easily connect to remote servers via terminal with flexible config options.
- Connect to any SSH server via CLI
- Supports password and private key authentication
- Simple config flags:
--host
,--port
,--username
, etc. - Logs connection status and errors
- File exploration on remote server
- Download files from remote server
- Interactive prompts using
inquirer
- Colored CLI output using
chalk
- Robust error handling and logging
- Cross-platform support (Linux, macOS, Windows)
Clone the repo and install dependencies:
git clone https://github.com/sangleshubham/ssh-file-explorer.git
cd ssh-file-explorer
npm install
Run the CLI tool with required options:
node index.js --host your.server.com --port 22 --username youruser --password yourpassword --authMethod password
Or with a private key:
node index.js --host your.server.com --port 22 --username youruser --privateKeyPath /path/to/key --authMethod privateKey
Flag | Description |
---|---|
--host |
SSH server hostname or IP |
--port |
SSH port (default: 22) |
--username |
SSH login username |
--password |
Password for authentication |
--privateKeyPath |
Path to private key file for key-based auth |
--authMethod |
'password' or 'privateKey' |
node index.js --host 192.168.1.10 --port 22 --username admin --authMethod privateKey --privateKeyPath ~/.ssh/id_ed25519
/project-root
├── src
├── connect-ssh.js # SSH Authenticator is implemented here
├── file-and-folder-ssh.js # Helper code for handling File and Folder download and traversal
├── helper.js # Helper code for project
├── index.js # The main execution js file
├── package.json
└── README.md
- commander (or
yargs
) for CLI parsing - node-ssh or other SSH client lib
- chalk for colored CLI output (planned)
- inquirer for interactive prompts
- password-prompt for getting password in cli
- Initialize Node.js project with
npm init
- Install
commander
andnode-ssh
- Implement basic SSH connection
- Test SSH connectivity
- Add basic CLI commands (connect/disconnect)
- List directories/files on remote server
- Navigate remote directories via CLI
- Download files from remote to local
- Show download progress indicators
- Test and debug file features
- Add colored output using
chalk
- Add interactive prompts via
inquirer
- Implement robust error handling
- Write detailed documentation with examples
- Test on Linux, macOS, Windows
- Known issue with Windows terminals: Some terminals may crash due to a known bug in the inquirer library.
- Issue was fixed by Inquirer.js team some times back.
- Optimize SSH connection & file operations
- Final code/documentation review
- Prepare for deployment/personal use
- Remove password-prompt Dependency.
MIT License — free to use, modify, and distribute.
Have suggestions or improvements? Fork the repo and submit a pull request!
For support, open an issue or email [[email protected]].