https://github.com/army-cat/trooper
Trooper is easy library for send remote commands
https://github.com/army-cat/trooper
army automation elixir erlang ssh-client
Last synced: about 1 year ago
JSON representation
Trooper is easy library for send remote commands
- Host: GitHub
- URL: https://github.com/army-cat/trooper
- Owner: army-cat
- License: lgpl-2.1
- Created: 2016-03-07T18:20:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-04-11T22:09:13.000Z (about 1 year ago)
- Last Synced: 2025-04-22T12:08:30.240Z (about 1 year ago)
- Topics: army, automation, elixir, erlang, ssh-client
- Language: Erlang
- Homepage:
- Size: 3.37 MB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: COPYING
Awesome Lists containing this project
README
# Trooper #
Copyright (c) 2016-2025 Altenwald
__Authors:__ "Manuel Rubio ([`manuel@altenwald.com`](mailto:manuel@altenwald.com)).
[](https://codecov.io/gh/army-cat/trooper)
[](https://hex.pm/packages/trooper)
Trooper is a soldier in charge to go to other machines (via SSH) and follow your commands.
### Requirements
Trooper requires to be run over an Erlang/OTP 24+.
### Example
```erlang
1> {ok, File} = file:read_file("/home/trooper/.ssh/id_rsa").
{ok,<<"-----BEGIN RSA PRIVATE KEY-----\nMIIE"...>>}
2> {ok,Trooper} = trooper_ssh:start([{host, "trooper.com"},
{user, "trooper"},
{id_rsa, File}]), ok.
ok
3> trooper_ssh:exec(Trooper, "ls -lha").
{ok,0,
<<"total 128K\ndrwxr-xr-x 10 trooper trooper 4.0K Mar 8 16:54"...>>}
4> trooper_ssh:exec(Trooper, "ls not_found").
{ok,2,
<<"ls: cannot access not_found: No such file or directory\n">>}
5> trooper_ssh:stop(Trooper).
ok
```
You can use for the options whatever from [ssh:connect/3](http://erlang.org/doc/man/ssh.md#connect-3) options.
Enjoy!