{"id":13586697,"url":"https://github.com/wouterdebie/i2cssh","last_synced_at":"2025-04-07T18:34:30.795Z","repository":{"id":668319,"uuid":"1884917","full_name":"wouterdebie/i2cssh","owner":"wouterdebie","description":"csshX like ssh tool for iTerm2","archived":false,"fork":false,"pushed_at":"2024-12-23T20:48:04.000Z","size":1423,"stargazers_count":554,"open_issues_count":0,"forks_count":68,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-18T05:08:29.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wouterdebie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-06-12T15:20:00.000Z","updated_at":"2025-02-26T16:06:17.000Z","dependencies_parsed_at":"2023-11-21T16:44:02.755Z","dependency_job_id":"c9405aec-870a-400d-b5d5-390aa600ea46","html_url":"https://github.com/wouterdebie/i2cssh","commit_stats":{"total_commits":207,"total_committers":19,"mean_commits":"10.894736842105264","dds":"0.27053140096618356","last_synced_commit":"6532f49f93b4fda2d808758943e3a7eb6b168349"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterdebie%2Fi2cssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterdebie%2Fi2cssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterdebie%2Fi2cssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterdebie%2Fi2cssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wouterdebie","download_url":"https://codeload.github.com/wouterdebie/i2cssh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247707763,"owners_count":20982844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:05:45.062Z","updated_at":"2025-04-07T18:34:30.787Z","avatar_url":"https://github.com/wouterdebie.png","language":"Python","readme":"# i2cssh\n\n`i2cssh` is a csshX (http://code.google.com/p/csshx/) like tool for connecting ssh to multiple machines using ssh. But instead of creating separate windows and having a master window for input, `i2cssh` uses [Iterm2](https://iterm2.com/) split panes and allows to \"Send input to all sessions\" (⌘-shift-I) to send commands to all sessions.\n\n![Settings](images/recording.gif)\n\n## Features\n\n- Opening sessions in the current or new tabs\n- Multiple cluster configuration\n- Enable broadcast by default\n- Multiple profiles\n- Configurable SSH and shell parameters\n- Custom layouts\n\n## Installing\n\n    $ brew install wouterdebie/repo/i2cssh\n\nMake sure to enable the Python API in Iterm2. Go to Preferences -\u003e General -\u003e Magic -\u003e Enable Python API.\n\n![Settings](images/settings.png)\n\n## Usage\n\n    Usage: i2cssh [OPTIONS] [HOSTS_OR_CLUSTER]...\n\n    HOSTS: [(login@host [login@host] | login@cluster)]\n\n    Options:\n    General options:\n        -c, --clusters TEXT           Comma-separated list of clusters specified\n                                      in ~/.i2csshrc\n        -m, --machines TEXT           Comma-separated list of hosts\n        -f, --file TEXT               Cluster file (one hostname per line)\n        -t, --tab-split               Split servers/clusters into tabs and put all\n                                      hosts specified on the command line in one\n                                      tab\n        -T, --tab-split-nogroup       Split servers/clusters into tabs and put\n                                      each host specified on the command line in a\n                                      separate tab\n        -W, --same-window             Use existing window for spawning new tabs\n        -v, --version                 Show version\n    SSH options:\n        -A, --forward-agent           Enable SSH agent forwarding\n        -l, --login TEXT              SSH user name\n        -e, --environment TEXT        Send environment vars (comma-separated list,\n                                      need to start with LC_)\n        -r, --rank                    Send LC_RANK with the host number as\n                                      environment variable\n        -X, --extra TEXT              Additional ssh parameters (e.g.\n                                      -Xi=myidentity.pem)\n        -g, --gateway TEXT            Multihop SSH connection gateway string (e.g.\n                                      username@gateway) - usually used with -A\n        -x, --custom-command TEXT     Custom command to run instead of SSH. Use\n                                      \"{host}\" to for host substitution (e.g.\n                                      \"kubectl exec -it {host} -- /bin/bash\")\n    iTerm2 options:\n        -F, --fullscreen              Make the window fullscreen\n        -b, --broadcast               Start with broadcast input (DANGEROUS!)\n        -nb, --nobroadcast            Disable broadcast input\n        -p, --profile TEXT            iTerm2 profile name (default: Default)\n        -s, --sleep INTEGER           Number of seconds to sleep between creating\n                                      SSH sessions\n        -S, --shell TEXT              Shell to use when spawning the SSH sessions\n                                      (default: $SHELL)\n        -d, --direction [column|row]  Direction that new sessions are created\n                                      (default: column)\n    Layout: [mutually_exclusive]\n        -C, --columns INTEGER         Number of columns (rows will be calculated)\n        -R, --rows INTEGER            Number of rows (columns will be calculated)\n    --help                            Show this message and exit.\n\n`i2cssh` will assume you want to connect to a cluster when only one host is given.\n\nFor `-c` and `-m` options, the format `username@cluster` or `username@host` can be used.\n\nThe following commands are exactly the same, however, they might serve different purposes:\n\n    $ i2cssh -m user1@host1,user2@host2\n    $ i2cssh user1@host1 user2@host2\n\nYou can combine these options and use them multiple times:\n\n    $ i2cssh -m user1@host1,user2@host2 user4@host3 user5@host4\n\nUsing the `-l` option will override all usernames:\n\n    $ i2cssh -l foo user1@host1 user2@host2\n\nThis will connect to both `host1` and `host2` as the user `foo`\n\n## i2csshrc\n\nThe `i2csshrc` file is a YAML formatted file that contains the following structure:\n\n```yaml\n---\nversion: 2\n[optional parameters]\nclusters:\n    mycluster:\n    [optional parameters]\n    hosts:\n        - host1\n        - host2\n```\n\nOptional parameters can be used globally or per cluster and include:\n\n```yaml\nbroadcast: (true/false) # Enable/disable broadcast on start\nlogin: \u003cusername\u003e # Use this username for login\nprofile: \u003ciTerm2 profile\u003e # Use this iTerm profile\nrank: (true/false) # Enable sending LC_RANK as an environment variable\ncolumns: \u003ccols\u003e # Amount of columns\nrows: \u003crows\u003e # Amount of rows\nsleep: \u003csecs\u003e # Seconds to sleep between creating SSH sessions\ndirection: (column/row) # Direction that new sessions are created (default: column)\nshell: \u003cshell\u003e # Shell to use (default: /bin/bash)\n\nenvironment: # Send the following enviroment variables\n  LC_FOO: foo\n  LC_BAR: bar\n\nextra:\n  i: myidentity.pem\n  p: 2222\n```\n\nNote: rows and columns can't be used at the same time.\n\nClusters can also include hosts from other clusters through a cluster specific optional parameter `include_from`:\n\n```yaml\nversion: 2\nclusters:\n  cluster1:\n    hosts:\n      - host1\n      - host2\n  cluster2:\n    hosts:\n      - host3\n      - host4\n    include_from:\n      - cluster1\n```\n\nNote that only the hosts will be included, but no additional configuration options. Secondly, includes\naren't transitive, so if `cluster1` includes `cluster2`, which in turn includes `cluster3`, only the\nhosts from `cluster2` will be included in `cluster1`.\n\nThe following precedence is used:\n\n`global options from config` \u003c `cluster options from config` \u003c `command line flags`\n\nMake sure the config file is valid YAML (e.g. use spaces instead of tabs)\n\n## Options\n\n| Option                                    | Description                                                                                                                                                                                                                                         |\n| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| \u003cnobr\u003e`-A, --forward-agent`\u003c/nobr\u003e        | Enable SSH agent forwarding                                                                                                                                                                                                                         |\n| \u003cnobr\u003e`-l, --login LOGIN`\u003c/nobr\u003e          | This option will override all logins passed in to i2cssh. This goes for global config, cluster config or username@host passed on the command line.                                                                                                  |\n| \u003cnobr\u003e`-e, --environment KEY=VAL`\u003c/nobr\u003e  | Allows for passing environment varables to the SSH session. This can be a comma-separated list: `-e LC_FOO=foo,LC_BAR=bar`                                                                                                                          |\n| \u003cnobr\u003e`-F, --fullscreen`\u003c/nobr\u003e           | Enable fullscreen on startup.                                                                                                                                                                                                                       |\n| \u003cnobr\u003e`-C, --columns COLUMNS`\u003c/nobr\u003e      | Set the amount of columns. Can't be used in conjunction with `-R`.                                                                                                                                                                                  |\n| \u003cnobr\u003e`-R, --rows ROWS`\u003c/nobr\u003e            | Set the amount of columns. Can't be used in conjunction with `-C`.                                                                                                                                                                                  |\n| \u003cnobr\u003e`-b, --broadcast`\u003c/nobr\u003e            | Enable broadcast on startup.                                                                                                                                                                                                                        |\n| \u003cnobr\u003e`-nb, --nobroadcast`\u003c/nobr\u003e         | Disable broadcast. This setting can be used to disable any broadcast that was set in the config.                                                                                                                                                    |\n| \u003cnobr\u003e`-p, --profile PROFILE`\u003c/nobr\u003e      | Use a specific iTerm profile.                                                                                                                                                                                                                       |\n| \u003cnobr\u003e`-f, --file FILE`\u003c/nobr\u003e            | Will read nodes from a file. These will be added to any hosts specified on the command line or in the config.                                                                                                                                       |\n| \u003cnobr\u003e`-c, --clusters clus1,clus2`\u003c/nobr\u003e | Connect to one or more clusters that are specified in the config.                                                                                                                                                                                   |\n| \u003cnobr\u003e`-r, --rank`\u003c/nobr\u003e                 | Send a LC_RANK environment variable different for each host (from 0 to n).                                                                                                                                                                          |\n| \u003cnobr\u003e`-m, --machines a,b,c`\u003c/nobr\u003e       | Connect to the machines a, b and c                                                                                                                                                                                                                  |\n| \u003cnobr\u003e`-t, --tab-split`\u003c/nobr\u003e            | Split servers/clusters into tabs, grouping arguments. Tabs are created as follows: hosts after a -m option are put in one tab, each cluster is always in its own tab, all the arguments are in one tab.                                             |\n| \u003cnobr\u003e`-T, --tab-split-nogroup`\u003c/nobr\u003e    | Split servers/clusters into tabs, _not_ grouping arguments. Tabs are created as follows: hosts after a -m option are put in one tab, each cluster is always in its own tab, each argument is in its own tab.                                        |\n| \u003cnobr\u003e`-W, --same-window`\u003c/nobr\u003e          | Do not create new Window, but spawn new cluster tabs in current (last used) iterm window.                                                                                                                                                           |\n| \u003cnobr\u003e`-s, --sleep SLEEP`\u003c/nobr\u003e          | Wait SLEEP seconds between starting each ssh session. This will take decimals as well (0.5 for half a second)                                                                                                                                       |\n| \u003cnobr\u003e`-E, --exec`\u003c/nobr\u003e                 | Run ssh using exec, rather than just the command in the shell. This causes the pane to close when ssh exits. Note that any errors or logs will disappear.                                                                                           |\n| \u003cnobr\u003e`-X, --extra EXTRA`\u003c/nobr\u003e          | Set extra ssh parameters in the form `-Xk=v` \u003cbr\u003e\u003cbr\u003eE.g: `i2cssh -Xi=myidentity.pem` will result in `ssh -i myidentity.pem`, or `i2cssh -Xp=2222 -XL=8080:localhost:8080` will result in `ssh -p 2222 -L 8080:localhost:8080`                      |\n| \u003cnobr\u003e`-x, --custom-command`\u003c/nobr\u003e       | Use a custom command to connect to the hosts. This will override the default `ssh` command. Use `{host}` as a substitution for the actual host will be used. E.g. `-x \"kubectl exec -it {host} -- /bin/bash\"` to execute `kubectl` instead of `ssh` |\n\n## TODO\n\n- Better release process (homebrew update after new release)\n- Proper handling of resizing and full screen when the window is too small for the amount of rows or columns.\n\n## NOTE (fall 2022)\n\nI finally took some time to rewrite `i2cssh` in python. For a while now Iterm2 has had a python API that allows you to automate a bunch of stuff. This python implementation uses that API to do the same thing as the original ruby script. This should make this app more maintainable, since it doesn't rely on any weird AppleScript bindings and emitting key codes. Secondly, it should be quite a bit faster in generating the ssh windows.\n\nI've regained new interest, so if you find a bug, please report! Make sure to include your configuration!\n\n## Contributing to i2cssh\n\nI know that `i2cssh` doesn't have all the functionality of csshX, but either let me know what you really need or fork, hack and create a pull request.\n\n- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet\n- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it\n- Fork the project\n- Start a feature/bugfix branch\n- Commit and push until you are happy with your contribution\n\n## Copyright\n\nCopyright (c) 2011-2023 Wouter de Bie. See LICENSE.txt for\nfurther details.\n","funding_links":[],"categories":["Apps","Python"],"sub_categories":["Multiplexers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouterdebie%2Fi2cssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwouterdebie%2Fi2cssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouterdebie%2Fi2cssh/lists"}