A cli tool to manage multiple ssh keys and switch between different ssh keys with ease & grace.
npm install ssh-keymanssh-keyman
=====


!Test Coverage
!Tests Passing


!Node Version







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 | !Coverage |
| NPM Publish | !Publish |
> š View Detailed Status Report ā
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.
Installation
------------
`` sh`
npm install -g ssh-keyman
Usage
-----
`
ā ~ ssh-keyman -h
SSH KeyMan - SSH Key Environment Manager
Usage: ssh-keyman
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 autocomplete
- ssh-keyman -c - Interactive environment creator with validation
- ssh-keyman -d - Interactive environment deletion with confirmation
#### Initialisation
Calling ssh-keyman -i creates a ~/.sshkeyman/ directory if it doesn't exist,~/.ssh
and copies your current 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!
`
#### Create a new ssh environment
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.
#### List available ssh environments
`
ā ~ ssh-keyman -ls
Available environments:
⢠default
ā newenvironment (active)
`
#### Switch to a specific ssh environment
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!
#### Delete a specific ssh environment
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'
#### Get the current ssh-keyman version
``
ā ~ ssh-keyman -v
ssh-keyman version 1.0.2
Development
-----------
`bashRun all tests
npm test
$3
`
ssh-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
`$3
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)License
-------
ISC, a permissive free software license published by the Internet Software Consortium.
Contact
-------
* GitHub (shahidullahkhan)
* Email (shahid@shahidullahkhan.com)
Made with ā¤ļø by Shahid Ullah Khan from Pakistan.