MCPcopy Index your code
hub / github.com/crosbymichael/slex

github.com/crosbymichael/slex @20.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 20.9.0 ↗ · + Follow
38 symbols 87 edges 7 files 24 documented · 63% updated 5y ago20.9.0 · 2020-09-04★ 5593 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SLEX

Build Status

slex is a simple binary that allows you to run a command on multiple hosts via SSH. It is very similar to fabric except that it is written in Go so you don't have to have python installed on your system and you don't have to write a script or configuration files if you do not want to.

Building

To build slex you must have a working Go install then you can run:

go get -u github.com/crosbymichael/slex
slex -h
NAME:
   slex - SSH commands multiplexed

USAGE:
   slex [global options] command [command options] [arguments...]

VERSION:
   1

AUTHOR:
  @crosbymichael - <crosbymichael@gmail.com>

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug                     enable debug output for the logs
   --host value                SSH host address
   --hosts value               file containing host addresses separated by a new line
   --user value, -u value      user to execute the command as (default: "root")
   --identity value, -i value  SSH identity to use for connecting to the host
   --option value, -o value    SSH client option
   --agent, -A                 Forward authentication request to the ssh agent
   --env value, -e value       set environment variables for SSH command
   --quiet, -q                 disable output from the ssh command
   --help, -h                  show help
   --version, -v               print the version

For the list of supported SSH client option, see SSHClientOptions on config.go

Get the uptime for all servers

slex --host 192.168.1.3 --host 192.168.1.4 uptime
[192.168.1.3:22]  01:05:20 up  4:44,  0 users,  load average: 0.35, 0.39, 0.33
[192.168.1.4:22]  01:05:20 up  9:45,  0 users,  load average: 0.04, 0.07, 0.06

Run a docker container on all servers

slex --host 192.168.1.3 --host 192.168.1.4 docker run --rm busybox echo "hi slex"
[192.168.1.3:22] hi slex
[192.168.1.4:22] hi slex

Pipe scripts to all servers

echo "echo hi again" | slex --host 192.168.1.3 --host 192.168.1.4
[192.168.1.3:22] hi again
[192.168.1.4:22] hi again

License - MIT

Core symbols most depended-on inside this repo

ParseOptions
called by 6
config.go
ParseSSHConfigFile
called by 5
config.go
Close
called by 3
ssh.go
newSSHPublicKeyAuthMethod
called by 2
ssh.go
NewProxyCmdConn
called by 1
proxycommand.go
getEffectiveClientOptions
called by 1
ssh.go
newSSHClientConfig
called by 1
ssh.go
NewSession
called by 1
ssh.go

Shape

Function 21
Method 11
Struct 6

Languages

Go100%

Modules by API surface

ssh.go10 symbols
proxycommand.go8 symbols
main.go7 symbols
writer.go4 symbols
command.go4 symbols
config.go3 symbols
config_test.go2 symbols

For agents

$ claude mcp add slex \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact