https://github.com/sepich/iterm2-cssh
csshX like tool for iTerm2 v3.3 via Python-API
https://github.com/sepich/iterm2-cssh
cssh iterm2
Last synced: 17 days ago
JSON representation
csshX like tool for iTerm2 v3.3 via Python-API
- Host: GitHub
- URL: https://github.com/sepich/iterm2-cssh
- Owner: sepich
- Created: 2019-06-23T15:49:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-03T03:56:14.000Z (almost 7 years ago)
- Last Synced: 2025-02-25T20:33:12.222Z (over 1 year ago)
- Topics: cssh, iterm2
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iterm2-cssh
csshX like tool for iTerm2v3.3 via Python-API
## Description
New [Python-API](https://iterm2.com/python-api/) had been added to iTerm2 v3.3. I have many issues with [wouterdebie/i2cssh](https://github.com/wouterdebie/i2cssh), which uses AppleScript, so decided to try fix them via this new API.
This is a tool to connect to multiple servers in iTerm2 Split-View, and then manage them at once via Broadcasted Input (`Cmd-Shift-I`)
## Install
- Enable API in iTerm2 Settings:
`General > Magic > Enable Python API`
- Install runtime:
`Menu Scripts > Manage > Download runtime`
- Clone repo
```bash
git clone https://github.com/sepich/iterm2-cssh.git
cd iterm2-cssh
python=`ls /Users/aryabov/Library/ApplicationSupport/iTerm2/iterm2env/versions/*/bin/python | cut -d' ' -f1`
$python i2cssh.py host1 [host2 ...]
```
## Usage
Example of usage is provided in `start.sh`:
- Configure new default Profile command to run `start.sh`

- Press `Cmd-T` to open new tab, it would display all your servers from `.ssh/known_hosts`
- You then interactively (via `fzf`) filter the list and select items to connect to:

- If single item is selected - connection opened in current tab
- If there no such name yet in your `.ssh/known_hosts`, you can type it in and press `Enter` to connect
- If multiple is selected (via `Tab`), new tab would be created with Split-Screen and broadcast input activated

For sessions inside Split-Screen it also sets `Session > After a session ends > No action` so that you can press `Right click > Restart` if single session is dropped, without reopening whole set.