A sophisticated key manager cli tool to manage multiple ssh keys and switch between different ssh keys with ease & grace.
| Workflow | Status |
|---|---|
| Build & Test | |
| Test Coverage | |
| NPM Publish |
Tests run automatically on:
- β Ubuntu (Linux) - Node.js 16.x, 18.x, 20.x
- β macOS - Node.js 16.x, 18.x, 20.x
- β Windows - Node.js 16.x, 18.x, 20.x
35 Tests | 75%+ Coverage | All Platforms Passing
Normally people have difficulty managing different ssh keys for different Github / Bitbucket / Gitlab accounts. This package makes your life easier by creating different ssh profiles & manage them for you. So you can concentrate on your work.
npm install -g ssh-keymanβ ~ ssh-keyman -h
SSH KeyMan - SSH Key Environment Manager
Usage: ssh-keyman <command> [options]
Commands:
-i Initialize keyman directory and default environment
-c [name] Create new ssh environment (interactive if no name)
-s [name] Switch to another ssh environment (interactive if no name)
-d [name] Delete ssh environment (interactive if no name)
-ls List all environments
-h Show help
-v Show version
Tip: Run commands without arguments for interactive mode
ssh-keyman now supports interactive mode with autocomplete! Simply run commands without arguments to get an enhanced interactive experience:
ssh-keyman -s- Interactive environment switcher with autocompletessh-keyman -c- Interactive environment creator with validationssh-keyman -d- Interactive environment deletion with confirmation
Calling ssh-keyman -i creates a ~/.sshkeyman/ directory if it doesn't exist,
and copies your current ~/.ssh as the 'default' ssh profile.
β ~ ssh-keyman -i
π Initializing SSH KeyMan...
β Created ssh-keyman directory: /Users/shahidullahkhan/.sshkeyman
β Created default environment
β Activated 'default' environment
β¨ SSH KeyMan initialized successfully!
With environment name:
β ~ ssh-keyman -c newenvironment
β Saved current ssh config to default
β Created directory for new environment: /Users/shahidullahkhan/.sshkeyman/newenvironment
? Do you want to switch to newly created environment (newenvironment)? (Y/n) y
β Activated environment 'newenvironment'
Interactive mode (just run without name):
β ~ ssh-keyman -c
? Enter name for the new environment: production
β Saved current ssh config to default
β Created directory for new environment: /Users/shahidullahkhan/.sshkeyman/production
? Do you want to switch to newly created environment (production)? (Y/n)
A blank environment will be created. Then modify content of ~/.ssh/. Then whenever you will switch to another environment, your changes will be saved.
β ~ ssh-keyman -ls
Available environments:
β’ default
β newenvironment (active)
With environment name:
β ~ ssh-keyman -s default
β Saved current ssh config to 'newenvironment'
β Activated environment 'default'
Interactive mode with autocomplete (just run without name):
β ~ ssh-keyman -s
? Select environment to switch to: (Use arrow keys or type to search)
β― default
production
staging
Start typing to filter environments with autocomplete!
With environment name:
β ~ ssh-keyman -d newenvironment
β Successfully deleted environment 'newenvironment'
Interactive mode with autocomplete and confirmation (just run without name):
β ~ ssh-keyman -d
? Select environment to delete: (Use arrow keys or type to search)
β― newenvironment
staging
? Are you sure you want to delete environment 'newenvironment'? (y/N) y
β Successfully deleted environment 'newenvironment'
β ~ ssh-keyman -v
ssh-keyman version 1.0.2
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:cissh-keyman/
βββ src/
β βββ __tests__/ # Test files
β βββ cli.js # CLI entry point
β βββ cliOptions.js # CLI argument parsing
β βββ commands.js # Command implementations
β βββ constants.js # Constants and configuration
β βββ extendFs.js # File system utilities
βββ .github/
β βββ workflows/ # GitHub Actions CI/CD
βββ index.js # Main entry point
βββ package.json
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ISC, a permissive free software license published by the Internet Software Consortium.
- GitHub (shahidullahkhan)
- Email (shahid@shahidullahkhan.com)
Made with β€οΈ by Shahid Ullah Khan from Pakistan.