You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Konnect is a tool for managing and connecting to remote hosts. By defining a list of hosts in a configuration file, Konnect allows you to connect and run commands on the defined hosts.
4
8
@@ -17,13 +21,10 @@ You can also download and install Konnect via brew.
17
21
Usage
18
22
--------------
19
23
24
+
#### Defining hosts in the config file
20
25
21
-
Using Konnect is _really_ simple:
22
-
1. Define hosts in a `konnect.yml` config file.
23
-
1. Connect to a defined host.
24
-
25
-
26
-
A `konnect.yml` config file looks like this:
26
+
The configuration file for konnect should be named `konnect.yml`.
27
+
In this `konnect.yml` config, we define two hosts: **app**, and **database**.
27
28
28
29
```
29
30
hosts:
@@ -39,51 +40,78 @@ hosts:
39
40
key: ~/.ssh/id_rsa
40
41
```
41
42
43
+
#### Connecting to hosts
44
+
In order to connect to a host you would run: `konnect to <host>`
42
45
46
+
-_example_: **`konnect to app`**
43
47
44
-
### Isn't this like an ssh config file?
45
-
Yup, Konnect is very much like an ssh config file.
48
+
Alternatively, you can just run `konnect`, and it would start an interactive prompt for you to choose a host to connect to.
46
49
47
-
However, Konnect aims to be more portable and configurable by providing additional functionality on a per-host / multi-host basis.
50
+
#### Defining tasks
51
+
Tasks are essentially bash commands which execute remotely on a host. We can define tasks in the `konnect.yml` file, and then run them on a specific host.
48
52
49
-
Examples
50
-
--------------
53
+
In this `konnect.yml` config, we define one host (**app**) and one task (**tailsys**).
51
54
52
-
-**Create an empty konnect.yml config file**
55
+
```
56
+
hosts:
57
+
app:
58
+
user: root
59
+
host: 192.168.99.100
60
+
port: 22
61
+
key: /home/app/key
53
62
54
-
`konnect init <dir>`
63
+
tasks:
64
+
tailsys: tail -f -n 100 /var/log/syslog
65
+
```
66
+
67
+
#### Running tasks
68
+
In order to connect to run a task on a host you would run: `konnect to <host> and <task>`
55
69
70
+
-_example_: **`konnect to app and tailsys`**
71
+
72
+
73
+
Commands
74
+
--------------
56
75
57
76
-**View all defined hosts**
58
77
59
-
`konnect ls`
78
+
`konnect list`
60
79
61
80
62
81
-**Connect to a defined host**
63
82
64
83
`konnect to <host>`
65
84
66
85
86
+
-**Connect to a host and run a task**
87
+
88
+
`konnect to <host> and <task>`
89
+
90
+
67
91
-**Display the SSH command for a host**
68
92
69
93
`konnect args <host>`
70
94
71
95
72
-
-**Check the status of one or more hosts**
96
+
-**Create an empty konnect.yml config file**
73
97
74
-
`konnect status <host1> <host2>`
98
+
`konnect init <dir>`
75
99
76
-
`konnect status --all`
100
+
-**Edit the konnect.yml config file**
101
+
102
+
`konnect edit`
77
103
78
104
79
-
### Why use konnect?
80
-
...why not? 🤓
105
+
-**Check the status of one or more hosts**
106
+
107
+
`konnect status <host1> <host2>`
81
108
109
+
`konnect status --all`
82
110
83
111
84
112
Authors
85
113
--------------
86
-
Konnect was created by [Sandeep Jadoonanan](https://github.com/TunedMystic)
114
+
Konnect was created by [Sandeep Jadoonanan](https://github.com/TunedMystic) 🤓
0 commit comments