feat(release): merge feature/mosh, bump version to v6.4.0b1 and update pdoc documentation

This commit is contained in:
fluzzi32 committed 2026-10-22 13:23:54 -03:00
1 parent 4d9ebdb80f
commit 5f2aa958a2
7 files changed
+271 -66

No files matched your search

+4 -3
View File
@@ -3,7 +3,7 @@
</p> </p>
# Connpy (v6.3.0) # Connpy (v6.4.0b1)
[![](https://img.shields.io/pypi/v/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/) [![](https://img.shields.io/pypi/v/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/)
[![](https://img.shields.io/pypi/pyversions/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/) [![](https://img.shields.io/pypi/pyversions/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/)
[![](https://img.shields.io/pypi/dm/connpy.svg?style=flat-square&cacheSeconds=86400)](https://pypi.org/pypi/connpy/) [![](https://img.shields.io/pypi/dm/connpy.svg?style=flat-square&cacheSeconds=86400)](https://pypi.org/pypi/connpy/)
@@ -13,7 +13,7 @@
[![](https://img.shields.io/badge/MCP-compatible-orange?style=flat-square)](https://modelcontextprotocol.io) [![](https://img.shields.io/badge/MCP-compatible-orange?style=flat-square)](https://modelcontextprotocol.io)
[![](https://img.shields.io/pypi/l/connpy.svg?style=flat-square)](https://github.com/fluzzi/connpy/blob/main/LICENSE) [![](https://img.shields.io/pypi/l/connpy.svg?style=flat-square)](https://github.com/fluzzi/connpy/blob/main/LICENSE)
**Connpy** is a powerful Connection Manager and Network Automation Platform for Linux, Mac, and Docker. It provides a unified interface for **SSH, SFTP, Telnet, kubectl, Docker pods, and AWS SSM**. **Connpy** is a powerful Connection Manager and Network Automation Platform for Linux, Mac, and Docker. It provides a unified interface for **SSH, SFTP, Mosh, Telnet, kubectl, Docker pods, and AWS SSM**.
The v6 release introduces a comprehensive **AI Copilot** and **AI Playbook Engine**, transforming your terminal into an interactive network assistant that understands your device outputs, configures parameters safely, and runs simulations. The v6 release introduces a comprehensive **AI Copilot** and **AI Playbook Engine**, transforming your terminal into an interactive network assistant that understands your device outputs, configures parameters safely, and runs simulations.
@@ -134,9 +134,10 @@ tags: { "os": "cisco_ios", "prompt": ".*#", "screen_length_command": "terminal l
## 4. 🔌 Protocols & Connection Features ## 4. 🔌 Protocols & Connection Features
### 4a. SSH / SFTP / Telnet / kubectl / Docker / AWS SSM ### 4a. SSH / SFTP / Mosh / Telnet / kubectl / Docker / AWS SSM
Connect to various architectures using native protocols: Connect to various architectures using native protocols:
* **SSH / Telnet**: Standard CLI protocols. * **SSH / Telnet**: Standard CLI protocols.
* **Mosh**: Mobile Shell with roaming and local echo support.
* **SFTP**: Transfer files securely (`conn --sftp node`). * **SFTP**: Transfer files securely (`conn --sftp node`).
* **Docker**: Connect directly to local container names (host set to container name/ID). * **Docker**: Connect directly to local container names (host set to container name/ID).
* **Kubernetes (kubectl)**: Connect to pods (namespace customizable via options). * **Kubernetes (kubectl)**: Connect to pods (namespace customizable via options).
+1 -1
View File
@@ -5,7 +5,7 @@
</p> </p>
# Connpy (v6.3.0) # Connpy (v6.4.0b1)
[![](https://img.shields.io/pypi/v/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/) [![](https://img.shields.io/pypi/v/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/)
[![](https://img.shields.io/pypi/pyversions/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/) [![](https://img.shields.io/pypi/pyversions/connpy.svg?style=flat-square)](https://pypi.org/pypi/connpy/)
[![](https://img.shields.io/pypi/dm/connpy.svg?style=flat-square&cacheSeconds=86400)](https://pypi.org/pypi/connpy/) [![](https://img.shields.io/pypi/dm/connpy.svg?style=flat-square&cacheSeconds=86400)](https://pypi.org/pypi/connpy/)
+1 -1
View File
@@ -1 +1 @@
__version__ = "6.3.0" __version__ = "6.4.0b1"
+4
View File
@@ -91,6 +91,7 @@ Here are some important instructions and tips for configuring your new node:
2. **Available Protocols and Apps**: 2. **Available Protocols and Apps**:
- ssh - ssh
- mosh (requires remote mosh-server and UDP ports 60000-61000 open; --sftp uses SSH TCP)
- telnet - telnet
- kubectl (`kubectl exec`) - kubectl (`kubectl exec`)
- docker (`docker exec`) - docker (`docker exec`)
@@ -121,6 +122,9 @@ Here are some important instructions and tips for configuring your new node:
- `profile`: AWS Profile used for `aws ssm start-session`. - `profile`: AWS Profile used for `aws ssm start-session`.
- `ssh_options`: Additional SSH options injected when an SSM node is used as a jumphost (e.g., `-i ~/.ssh/key.pem`). - `ssh_options`: Additional SSH options injected when an SSM node is used as a jumphost (e.g., `-i ~/.ssh/key.pem`).
- `nc_command`: Replaces the default `nc` command used when bridging connections through Docker or Kubernetes (e.g., `ip netns exec global-vrf nc`). - `nc_command`: Replaces the default `nc` command used when bridging connections through Docker or Kubernetes (e.g., `ip netns exec global-vrf nc`).
- `mosh_udp_port`: Server-side UDP port or range (`PORT` or `PORT1:PORT2`) passed as `-p` to `mosh`.
- `mosh_server`: Path to the `mosh-server` binary on the remote host (`--server`).
- `mosh_ssh_options`: Additional SSH options injected into `mosh --ssh=&#34;ssh ...&#34;` and reused when connecting via `--sftp` or running batch commands (`run`/`test`).
&#34;&#34;&#34; &#34;&#34;&#34;
if type == &#34;bashcompletion&#34;: if type == &#34;bashcompletion&#34;:
return &#39;&#39;&#39; return &#39;&#39;&#39;
+10 -10
View File
@@ -67,14 +67,14 @@ el.replaceWith(d);
_raise_val_err(&#34;Profile {} don&#39;t exist&#34;.format(current)) _raise_val_err(&#34;Profile {} don&#39;t exist&#34;.format(current))
return True return True
def profile_protocol_validation(self, answers, current, regex = &#34;(^ssh$|^telnet$|^kubectl$|^docker$|^ssm$|^$)&#34;): def profile_protocol_validation(self, answers, current, regex = &#34;(^ssh$|^mosh$|^telnet$|^kubectl$|^docker$|^ssm$|^$)&#34;):
if not re.match(regex, current): if not re.match(regex, current):
_raise_val_err(&#34;Pick between ssh, telnet, kubectl, docker, ssm or leave empty&#34;) _raise_val_err(&#34;Pick between ssh, mosh, telnet, kubectl, docker, ssm or leave empty&#34;)
return True return True
def protocol_validation(self, answers, current, regex = &#34;(^ssh$|^telnet$|^kubectl$|^docker$|^ssm$|^$|^@.+$)&#34;): def protocol_validation(self, answers, current, regex = &#34;(^ssh$|^mosh$|^telnet$|^kubectl$|^docker$|^ssm$|^$|^@.+$)&#34;):
if not re.match(regex, current): if not re.match(regex, current):
_raise_val_err(&#34;Pick between ssh, telnet, kubectl, docker, ssm, leave empty or @profile&#34;) _raise_val_err(&#34;Pick between ssh, mosh, telnet, kubectl, docker, ssm, leave empty or @profile&#34;)
if current.startswith(&#34;@&#34;): if current.startswith(&#34;@&#34;):
if current[1:] not in self.app.profiles: if current[1:] not in self.app.profiles:
_raise_val_err(&#34;Profile {} don&#39;t exist&#34;.format(current)) _raise_val_err(&#34;Profile {} don&#39;t exist&#34;.format(current))
@@ -389,16 +389,16 @@ el.replaceWith(d);
<div class="desc"></div> <div class="desc"></div>
</dd> </dd>
<dt id="connpy.cli.validators.Validators.profile_protocol_validation"><code class="name flex"> <dt id="connpy.cli.validators.Validators.profile_protocol_validation"><code class="name flex">
<span>def <span class="ident">profile_protocol_validation</span></span>(<span>self, answers, current, regex='(^ssh$|^telnet$|^kubectl$|^docker$|^ssm$|^$)')</span> <span>def <span class="ident">profile_protocol_validation</span></span>(<span>self,<br>answers,<br>current,<br>regex='(^ssh$|^mosh$|^telnet$|^kubectl$|^docker$|^ssm$|^$)')</span>
</code></dt> </code></dt>
<dd> <dd>
<details class="source"> <details class="source">
<summary> <summary>
<span>Expand source code</span> <span>Expand source code</span>
</summary> </summary>
<pre><code class="python">def profile_protocol_validation(self, answers, current, regex = &#34;(^ssh$|^telnet$|^kubectl$|^docker$|^ssm$|^$)&#34;): <pre><code class="python">def profile_protocol_validation(self, answers, current, regex = &#34;(^ssh$|^mosh$|^telnet$|^kubectl$|^docker$|^ssm$|^$)&#34;):
if not re.match(regex, current): if not re.match(regex, current):
_raise_val_err(&#34;Pick between ssh, telnet, kubectl, docker, ssm or leave empty&#34;) _raise_val_err(&#34;Pick between ssh, mosh, telnet, kubectl, docker, ssm or leave empty&#34;)
return True</code></pre> return True</code></pre>
</details> </details>
<div class="desc"></div> <div class="desc"></div>
@@ -425,16 +425,16 @@ el.replaceWith(d);
<div class="desc"></div> <div class="desc"></div>
</dd> </dd>
<dt id="connpy.cli.validators.Validators.protocol_validation"><code class="name flex"> <dt id="connpy.cli.validators.Validators.protocol_validation"><code class="name flex">
<span>def <span class="ident">protocol_validation</span></span>(<span>self,<br>answers,<br>current,<br>regex='(^ssh$|^telnet$|^kubectl$|^docker$|^ssm$|^$|^@.+$)')</span> <span>def <span class="ident">protocol_validation</span></span>(<span>self,<br>answers,<br>current,<br>regex='(^ssh$|^mosh$|^telnet$|^kubectl$|^docker$|^ssm$|^$|^@.+$)')</span>
</code></dt> </code></dt>
<dd> <dd>
<details class="source"> <details class="source">
<summary> <summary>
<span>Expand source code</span> <span>Expand source code</span>
</summary> </summary>
<pre><code class="python">def protocol_validation(self, answers, current, regex = &#34;(^ssh$|^telnet$|^kubectl$|^docker$|^ssm$|^$|^@.+$)&#34;): <pre><code class="python">def protocol_validation(self, answers, current, regex = &#34;(^ssh$|^mosh$|^telnet$|^kubectl$|^docker$|^ssm$|^$|^@.+$)&#34;):
if not re.match(regex, current): if not re.match(regex, current):
_raise_val_err(&#34;Pick between ssh, telnet, kubectl, docker, ssm, leave empty or @profile&#34;) _raise_val_err(&#34;Pick between ssh, mosh, telnet, kubectl, docker, ssm, leave empty or @profile&#34;)
if current.startswith(&#34;@&#34;): if current.startswith(&#34;@&#34;):
if current[1:] not in self.app.profiles: if current[1:] not in self.app.profiles:
_raise_val_err(&#34;Profile {} don&#39;t exist&#34;.format(current)) _raise_val_err(&#34;Profile {} don&#39;t exist&#34;.format(current))
+3
View File
@@ -1467,6 +1467,9 @@ interceptor chooses to service this RPC, or None otherwise.</p></div>
setattr(n, attr, params[attr]) setattr(n, attr, params[attr])
if &#34;tags&#34; in params: if &#34;tags&#34; in params:
n.tags = params[&#34;tags&#34;] n.tags = params[&#34;tags&#34;]
n._orig_protocol = n.protocol
if sftp:
n.protocol = &#34;sftp&#34;
else: else:
try: try:
node_data = user_config.getitem(unique_id, extract=False) node_data = user_config.getitem(unique_id, extract=False)
+248 -51
View File
@@ -41,7 +41,7 @@ el.replaceWith(d);
<p align="center"> <p align="center">
<img src="https://nginx.gederico.dynu.net/images/CONNPY-resized.png" alt="App Logo"> <img src="https://nginx.gederico.dynu.net/images/CONNPY-resized.png" alt="App Logo">
</p> </p>
<h1 id="connpy-v630">Connpy (v6.3.0)</h1> <h1 id="connpy-v640b1">Connpy (v6.4.0b1)</h1>
<p><a href="https://pypi.org/pypi/connpy/"><img alt="" src="https://img.shields.io/pypi/v/connpy.svg?style=flat-square"></a> <p><a href="https://pypi.org/pypi/connpy/"><img alt="" src="https://img.shields.io/pypi/v/connpy.svg?style=flat-square"></a>
<a href="https://pypi.org/pypi/connpy/"><img alt="" src="https://img.shields.io/pypi/pyversions/connpy.svg?style=flat-square"></a> <a href="https://pypi.org/pypi/connpy/"><img alt="" src="https://img.shields.io/pypi/pyversions/connpy.svg?style=flat-square"></a>
<a href="https://pypi.org/pypi/connpy/"><img alt="" src="https://img.shields.io/pypi/dm/connpy.svg?style=flat-square&amp;cacheSeconds=86400"></a> <a href="https://pypi.org/pypi/connpy/"><img alt="" src="https://img.shields.io/pypi/dm/connpy.svg?style=flat-square&amp;cacheSeconds=86400"></a>
@@ -50,7 +50,7 @@ el.replaceWith(d);
<a href="https://github.com/fluzzi/connpy"><img alt="" src="https://img.shields.io/badge/AI%20Core-LiteLLM-green?style=flat-square"></a> <a href="https://github.com/fluzzi/connpy"><img alt="" src="https://img.shields.io/badge/AI%20Core-LiteLLM-green?style=flat-square"></a>
<a href="https://modelcontextprotocol.io"><img alt="" src="https://img.shields.io/badge/MCP-compatible-orange?style=flat-square"></a> <a href="https://modelcontextprotocol.io"><img alt="" src="https://img.shields.io/badge/MCP-compatible-orange?style=flat-square"></a>
<a href="https://github.com/fluzzi/connpy/blob/main/LICENSE"><img alt="" src="https://img.shields.io/pypi/l/connpy.svg?style=flat-square"></a></p> <a href="https://github.com/fluzzi/connpy/blob/main/LICENSE"><img alt="" src="https://img.shields.io/pypi/l/connpy.svg?style=flat-square"></a></p>
<p><strong>Connpy</strong> is a powerful Connection Manager and Network Automation Platform for Linux, Mac, and Docker. It provides a unified interface for <strong>SSH, SFTP, Telnet, kubectl, Docker pods, and AWS SSM</strong>.</p> <p><strong>Connpy</strong> is a powerful Connection Manager and Network Automation Platform for Linux, Mac, and Docker. It provides a unified interface for <strong>SSH, SFTP, Mosh, Telnet, kubectl, Docker pods, and AWS SSM</strong>.</p>
<p>The v6 release introduces a comprehensive <strong>AI Copilot</strong> and <strong>AI Playbook Engine</strong>, transforming your terminal into an interactive network assistant that understands your device outputs, configures parameters safely, and runs simulations.</p> <p>The v6 release introduces a comprehensive <strong>AI Copilot</strong> and <strong>AI Playbook Engine</strong>, transforming your terminal into an interactive network assistant that understands your device outputs, configures parameters safely, and runs simulations.</p>
<hr> <hr>
<h2 id="1-ai-system">1. 🤖 AI System</h2> <h2 id="1-ai-system">1. 🤖 AI System</h2>
@@ -136,9 +136,10 @@ tags: { &quot;os&quot;: &quot;cisco_ios&quot;, &quot;prompt&quot;: &quot;.*#&quo
</code></pre> </code></pre>
<hr> <hr>
<h2 id="4-protocols-connection-features">4. 🔌 Protocols &amp; Connection Features</h2> <h2 id="4-protocols-connection-features">4. 🔌 Protocols &amp; Connection Features</h2>
<h3 id="4a-ssh-sftp-telnet-kubectl-docker-aws-ssm">4a. SSH / SFTP / Telnet / kubectl / Docker / AWS SSM</h3> <h3 id="4a-ssh-sftp-mosh-telnet-kubectl-docker-aws-ssm">4a. SSH / SFTP / Mosh / Telnet / kubectl / Docker / AWS SSM</h3>
<p>Connect to various architectures using native protocols: <p>Connect to various architectures using native protocols:
* <strong>SSH / Telnet</strong>: Standard CLI protocols. * <strong>SSH / Telnet</strong>: Standard CLI protocols.
* <strong>Mosh</strong>: Mobile Shell with roaming and local echo support.
* <strong>SFTP</strong>: Transfer files securely (<code>conn --sftp node</code>). * <strong>SFTP</strong>: Transfer files securely (<code>conn --sftp node</code>).
* <strong>Docker</strong>: Connect directly to local container names (host set to container name/ID). * <strong>Docker</strong>: Connect directly to local container names (host set to container name/ID).
* <strong>Kubernetes (kubectl)</strong>: Connect to pods (namespace customizable via options). * <strong>Kubernetes (kubectl)</strong>: Connect to pods (namespace customizable via options).
@@ -1715,7 +1716,7 @@ class node:
- port (str): Port to connect to node, default 22 for ssh and 23 - port (str): Port to connect to node, default 22 for ssh and 23
for telnet. for telnet.
- protocol (str): Select ssh, telnet, kubectl or docker. Default is ssh. - protocol (str): Select ssh, mosh, telnet, kubectl, docker or ssm. Default is ssh.
- user (str): Username to of the node. - user (str): Username to of the node.
@@ -1751,6 +1752,7 @@ class node:
setattr(self,key,&#34;ssh&#34;) setattr(self,key,&#34;ssh&#34;)
else: else:
setattr(self,key,attr[key]) setattr(self,key,attr[key])
self._orig_protocol = self.protocol
if isinstance(password,list): if isinstance(password,list):
self.password = [] self.password = []
for i, s in enumerate(password): for i, s in enumerate(password):
@@ -1827,6 +1829,11 @@ class node:
jh = config.getitem(jumphost_name) jh = config.getitem(jumphost_name)
jh = self._resolve_jumphost_data(jh, config) jh = self._resolve_jumphost_data(jh, config)
if jh[&#34;protocol&#34;] == &#34;mosh&#34;:
raise ValueError(
f&#34;Jumphost &#39;{jumphost_name}&#39; uses protocol &#39;mosh&#39; which cannot be used as a jumphost.&#34;
)
passwords = [] passwords = []
inner_proxy_opt = &#34;&#34; inner_proxy_opt = &#34;&#34;
@@ -2542,12 +2549,14 @@ class node:
str: Output of the commands you ran on the node. str: Output of the commands you ran on the node.
&#39;&#39;&#39; &#39;&#39;&#39;
connect = self._connect(timeout = timeout, logger = logger) force_ssh = (self.protocol == &#34;mosh&#34;)
connect = self._connect(timeout=timeout, logger=logger, force_ssh=force_ssh)
now = datetime.datetime.now().strftime(&#39;%Y-%m-%d_%H%M%S&#39;) now = datetime.datetime.now().strftime(&#39;%Y-%m-%d_%H%M%S&#39;)
if connect == True: if connect == True:
if logger: if logger:
port_str = f&#34;:{self.port}&#34; if self.port and self.protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34; effective_protocol = &#34;ssh&#34; if force_ssh else self.protocol
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {self.protocol}&#34;) port_str = f&#34;:{self.port}&#34; if self.port and effective_protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34;
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {effective_protocol}&#34;)
if &#34;prompt&#34; in self.tags: if &#34;prompt&#34; in self.tags:
prompt = self.tags[&#34;prompt&#34;] prompt = self.tags[&#34;prompt&#34;]
@@ -2659,11 +2668,13 @@ class node:
&#39;&#39;&#39; &#39;&#39;&#39;
now = datetime.datetime.now().strftime(&#34;%Y-%m-%d_%H-%M-%S&#34;) now = datetime.datetime.now().strftime(&#34;%Y-%m-%d_%H-%M-%S&#34;)
connect = self._connect(timeout = timeout, logger = logger) force_ssh = (self.protocol == &#34;mosh&#34;)
connect = self._connect(timeout=timeout, logger=logger, force_ssh=force_ssh)
if connect == True: if connect == True:
if logger: if logger:
port_str = f&#34;:{self.port}&#34; if self.port and self.protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34; effective_protocol = &#34;ssh&#34; if force_ssh else self.protocol
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {self.protocol}&#34;) port_str = f&#34;:{self.port}&#34; if self.port and effective_protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34;
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {effective_protocol}&#34;)
if &#34;prompt&#34; in self.tags: if &#34;prompt&#34; in self.tags:
prompt = self.tags[&#34;prompt&#34;] prompt = self.tags[&#34;prompt&#34;]
@@ -2755,16 +2766,45 @@ class node:
return connect return connect
@MethodHook @MethodHook
def _generate_ssh_sftp_cmd(self): def _generate_ssh_sftp_cmd(self, force_ssh=False):
cmd = self.protocol is_from_mosh = getattr(self, &#34;_orig_protocol&#34;, &#34;&#34;) == &#34;mosh&#34;
if self.port: if is_from_mosh:
if self.protocol == &#34;ssh&#34;: if str(self.host).startswith(&#34;-&#34;):
cmd += &#34; -p &#34; + self.port raise ValueError(&#34;Host cannot start with &#39;-&#39;&#34;)
elif self.protocol == &#34;sftp&#34;: if self.user and str(self.user).startswith(&#34;-&#34;):
cmd += &#34; -P &#34; + self.port raise ValueError(&#34;User cannot start with &#39;-&#39;&#34;)
if self.options:
opts = self.options proto = &#34;ssh&#34; if force_ssh else self.protocol
if self.protocol == &#34;sftp&#34;: cmd = proto
if self.port != &#34;&#34; and self.port is not None:
if is_from_mosh:
port_s = str(self.port).strip()
if port_s:
if not re.fullmatch(r&#34;^\d+$&#34;, port_s) or not (1 &lt;= int(port_s) &lt;= 65535):
raise ValueError(f&#34;Invalid TCP SSH port &#39;{self.port}&#39;&#34;)
cmd += (&#34; -p &#34; if proto == &#34;ssh&#34; else &#34; -P &#34;) + port_s
else:
if proto == &#34;ssh&#34;:
cmd += &#34; -p &#34; + str(self.port)
elif proto == &#34;sftp&#34;:
cmd += &#34; -P &#34; + str(self.port)
if is_from_mosh:
raw_opts = self.tags.get(&#34;mosh_ssh_options&#34;, &#34;&#34;) if isinstance(self.tags, dict) else &#34;&#34;
if raw_opts:
ssh_opts = str(raw_opts).strip()
if re.search(r&#39;(?:LocalCommand|ProxyCommand)&#39;, ssh_opts, re.IGNORECASE):
raise ValueError(&#34;mosh_ssh_options cannot contain LocalCommand or ProxyCommand&#34;)
try:
shlex.split(ssh_opts)
except ValueError as exc:
raise ValueError(&#34;Invalid mosh_ssh_options: unbalanced quotes&#34;) from exc
else:
raw_opts = self.options
if raw_opts:
opts = str(raw_opts).strip()
if proto == &#34;sftp&#34;:
# Strip SSH-only flags that sftp doesn&#39;t support # Strip SSH-only flags that sftp doesn&#39;t support
opts = re.sub(r&#39;(?&lt;!\S)-[XxtTAaNf]\b&#39;, &#39;&#39;, opts).strip() opts = re.sub(r&#39;(?&lt;!\S)-[XxtTAaNf]\b&#39;, &#39;&#39;, opts).strip()
if opts: if opts:
@@ -2775,6 +2815,73 @@ class node:
cmd += f&#34; {user_host}&#34; cmd += f&#34; {user_host}&#34;
return cmd return cmd
@MethodHook
def _generate_mosh_cmd(self):
if str(self.host).startswith(&#34;-&#34;):
raise ValueError(&#34;Host cannot start with &#39;-&#39;&#34;)
if self.user and str(self.user).startswith(&#34;-&#34;):
raise ValueError(&#34;User cannot start with &#39;-&#39;&#34;)
if not self.host or re.search(r&#39;[\s;|&amp;$`&gt;&lt;&#34;\&#39;\\]&#39;, str(self.host)):
raise ValueError(f&#34;Invalid characters in host: &#39;{self.host}&#39;&#34;)
if self.user and re.search(r&#39;[\s;|&amp;$`&gt;&lt;&#34;\&#39;\\]&#39;, str(self.user)):
raise ValueError(f&#34;Invalid characters in user: &#39;{self.user}&#39;&#34;)
cmd_parts = [&#34;mosh&#34;]
if isinstance(self.tags, dict):
if self.tags.get(&#34;mosh_server&#34;):
server_bin = str(self.tags[&#34;mosh_server&#34;]).strip()
if server_bin:
cmd_parts.append(f&#34;--server={shlex.quote(server_bin)}&#34;)
if self.tags.get(&#34;mosh_udp_port&#34;):
udp_port = str(self.tags[&#34;mosh_udp_port&#34;]).strip()
if udp_port:
if not re.match(r&#34;^\d+(:\d+)?$&#34;, udp_port):
raise ValueError(
f&#34;Invalid mosh_udp_port &#39;{udp_port}&#39;: must be PORT or PORT1:PORT2&#34;
)
cmd_parts.append(f&#34;-p {shlex.quote(udp_port)}&#34;)
ssh_parts = [&#34;ssh&#34;]
if self.port != &#34;&#34; and self.port is not None:
port_s = str(self.port).strip()
if port_s:
if not re.fullmatch(r&#34;^\d+$&#34;, port_s) or not (1 &lt;= int(port_s) &lt;= 65535):
raise ValueError(f&#34;Invalid TCP SSH port &#39;{self.port}&#39;&#34;)
ssh_parts.append(f&#34;-p {port_s}&#34;)
if isinstance(self.tags, dict) and self.tags.get(&#34;mosh_ssh_options&#34;):
ssh_opts = str(self.tags[&#34;mosh_ssh_options&#34;]).strip()
if ssh_opts:
if re.search(r&#39;(?:LocalCommand|ProxyCommand)&#39;, ssh_opts, re.IGNORECASE):
raise ValueError(&#34;mosh_ssh_options cannot contain LocalCommand or ProxyCommand&#34;)
try:
shlex.split(ssh_opts)
except ValueError as exc:
raise ValueError(&#34;Invalid mosh_ssh_options: unbalanced quotes&#34;) from exc
ssh_parts.append(ssh_opts)
if self.jumphost:
ssh_parts.append(self.jumphost)
if len(ssh_parts) &gt; 1:
raw_ssh = &#34; &#34;.join(ssh_parts)
cmd_parts.append(f&#34;--ssh={shlex.quote(raw_ssh)}&#34;)
if self.options:
opts = str(self.options).strip()
if opts:
if re.search(r&#39;--(?:ssh|server|client)(?:=|\s|$)&#39;, opts):
raise ValueError(&#34;Options cannot override --ssh, --server or --client for mosh&#34;)
if re.search(r&#39;(?:LocalCommand|ProxyCommand)&#39;, opts, re.IGNORECASE):
raise ValueError(&#34;Options cannot contain LocalCommand or ProxyCommand&#34;)
try:
shlex.split(opts)
except ValueError as exc:
raise ValueError(&#34;Invalid options: unbalanced quotes&#34;) from exc
cmd_parts.append(opts)
user_host = f&#34;{self.user}@{self.host}&#34; if self.user else self.host
cmd_parts.extend([&#34;--&#34;, user_host])
return &#34; &#34;.join(cmd_parts)
@MethodHook @MethodHook
def _generate_telnet_cmd(self): def _generate_telnet_cmd(self):
cmd = f&#34;telnet {self.host}&#34; cmd = f&#34;telnet {self.host}&#34;
@@ -2813,9 +2920,11 @@ class node:
@MethodHook @MethodHook
def _get_cmd(self): def _get_cmd(self, force_ssh=False):
if self.protocol in [&#34;ssh&#34;, &#34;sftp&#34;]: if force_ssh or self.protocol in [&#34;ssh&#34;, &#34;sftp&#34;]:
return self._generate_ssh_sftp_cmd() return self._generate_ssh_sftp_cmd(force_ssh=force_ssh)
elif self.protocol == &#34;mosh&#34;:
return self._generate_mosh_cmd()
elif self.protocol == &#34;telnet&#34;: elif self.protocol == &#34;telnet&#34;:
return self._generate_telnet_cmd() return self._generate_telnet_cmd()
elif self.protocol == &#34;kubectl&#34;: elif self.protocol == &#34;kubectl&#34;:
@@ -2830,25 +2939,56 @@ class node:
printer.error(f&#34;Invalid protocol: {self.protocol}&#34;) printer.error(f&#34;Invalid protocol: {self.protocol}&#34;)
sys.exit(1) sys.exit(1)
def _spawn_child(self, args, protocol=None):
if protocol is None:
protocol = getattr(self, &#34;protocol&#34;, &#34;&#34;)
env = None
if protocol == &#34;mosh&#34;:
env = os.environ.copy()
if not any(
&#34;utf-8&#34; in env.get(k, &#34;&#34;).lower() or &#34;utf8&#34; in env.get(k, &#34;&#34;).lower()
for k in (&#34;LC_ALL&#34;, &#34;LC_CTYPE&#34;, &#34;LANG&#34;)
):
env[&#34;LC_ALL&#34;] = &#34;C.UTF-8&#34;
env.setdefault(&#34;TERM&#34;, &#34;xterm-256color&#34;)
try:
if env is not None:
return pexpect.spawn(args[0], args[1:], env=env), None
return pexpect.spawn(args[0], args[1:]), None
except pexpect.exceptions.ExceptionPexpect as e:
return None, f&#34;Connection failed: {e}&#34;
@MethodHook @MethodHook
def _connect(self, debug=False, timeout=10, max_attempts=3, logger=None): def _connect(self, debug=False, timeout=10, max_attempts=3, logger=None, force_ssh=False):
if self.protocol == &#34;local&#34;: effective_protocol = &#34;ssh&#34; if force_ssh else self.protocol
if effective_protocol == &#34;mosh&#34;:
import shutil
if shutil.which(&#34;mosh&#34;) is None:
return &#34;Connection failed: mosh binary not found in PATH&#34;
timeout = max(timeout, 15)
if effective_protocol == &#34;local&#34;:
cmd = self._get_cmd() cmd = self._get_cmd()
args = shlex.split(cmd) args = shlex.split(cmd)
self.child = pexpect.spawn(args[0], args[1:], env=os.environ.copy()) child, err = self._spawn_child(args, protocol=effective_protocol)
if err:
return err
self.child = child
from pexpect import fdpexpect from pexpect import fdpexpect
self.raw_child = fdpexpect.fdspawn(self.child.child_fd) self.raw_child = fdpexpect.fdspawn(self.child.child_fd)
if self.logs != &#39;&#39;: if self.logs != &#39;&#39;:
self.logfile = self._logfile() self.logfile = self._logfile()
return True return True
cmd = self._get_cmd() cmd = self._get_cmd(force_ssh=force_ssh)
passwords = self._passtx(self.password) if self.password and any(self.password) else [] passwords = self._passtx(self.password) if self.password and any(self.password) else []
if self.logs != &#39;&#39;: if self.logs != &#39;&#39;:
self.logfile = self._logfile() self.logfile = self._logfile()
default_prompt = r&#39;&gt;$|#$|\$$|&gt;.$|#.$|\$.$&#39; default_prompt = r&#39;&gt;$|#$|\$$|&gt;.$|#.$|\$.$&#39;
prompt = self.tags.get(&#34;prompt&#34;, default_prompt) if isinstance(self.tags, dict) else default_prompt prompt = self.tags.get(&#34;prompt&#34;, default_prompt) if isinstance(self.tags, dict) else default_prompt
password_prompt = &#39;[p|P]assword:|[u|U]sername:&#39; if self.protocol != &#39;telnet&#39; else &#39;[p|P]assword:&#39; password_prompt = &#39;[p|P]assword:|[u|U]sername:&#39; if effective_protocol != &#39;telnet&#39; else &#39;[p|P]assword:&#39;
prompt_unanchored = &#34;|&#34;.join([t[:-1] if t.endswith(&#34;$&#34;) else t for t in prompt.split(&#34;|&#34;)])
mosh_prompt = r&#34;(?:&#34; + prompt_unanchored + r&#34;)\s*(?:\[[0-9;?]*[a-zA-Z])*$&#34;
expects = { expects = {
&#34;ssh&#34;: [&#39;yes/no&#39;, &#39;refused&#39;, &#39;supported&#39;, &#39;Invalid|[u|U]sage: ssh&#39;, &#39;ssh-keygen.*\&#34;&#39;, &#39;timeout|timed.out&#39;, &#39;unavailable&#39;, &#39;closed&#39;, password_prompt, prompt, &#39;suspend&#39;, pexpect.EOF, pexpect.TIMEOUT, &#34;No route to host&#34;, &#34;resolve hostname&#34;, &#34;no matching&#34;, &#34;[b|B]ad (owner|permissions)&#34;], &#34;ssh&#34;: [&#39;yes/no&#39;, &#39;refused&#39;, &#39;supported&#39;, &#39;Invalid|[u|U]sage: ssh&#39;, &#39;ssh-keygen.*\&#34;&#39;, &#39;timeout|timed.out&#39;, &#39;unavailable&#39;, &#39;closed&#39;, password_prompt, prompt, &#39;suspend&#39;, pexpect.EOF, pexpect.TIMEOUT, &#34;No route to host&#34;, &#34;resolve hostname&#34;, &#34;no matching&#34;, &#34;[b|B]ad (owner|permissions)&#34;],
@@ -2858,6 +2998,28 @@ class node:
&#34;docker&#34;: [&#39;[u|U]sername:&#39;, &#39;Cannot&#39;, &#39;[E|e]rror&#39;, &#39;failed&#39;, &#39;not a docker command&#39;, &#39;unknown&#39;, &#39;unable to resolve&#39;, pexpect.TIMEOUT, password_prompt, prompt, pexpect.EOF], &#34;docker&#34;: [&#39;[u|U]sername:&#39;, &#39;Cannot&#39;, &#39;[E|e]rror&#39;, &#39;failed&#39;, &#39;not a docker command&#39;, &#39;unknown&#39;, &#39;unable to resolve&#39;, pexpect.TIMEOUT, password_prompt, prompt, pexpect.EOF],
&#34;ssm&#34;: [&#39;[u|U]sername:&#39;, &#39;Cannot&#39;, &#39;[E|e]rror&#39;, &#39;failed&#39;, &#39;SessionManagerPlugin&#39;, &#39;[u|U]nknown&#39;, &#39;unable to resolve&#39;, pexpect.TIMEOUT, password_prompt, prompt, pexpect.EOF] &#34;ssm&#34;: [&#39;[u|U]sername:&#39;, &#39;Cannot&#39;, &#39;[E|e]rror&#39;, &#39;failed&#39;, &#39;SessionManagerPlugin&#39;, &#39;[u|U]nknown&#39;, &#39;unable to resolve&#39;, pexpect.TIMEOUT, password_prompt, prompt, pexpect.EOF]
} }
expects[&#34;mosh&#34;] = [
&#39;yes/no&#39;, # 0 (initial)
r&#39;(?:ssh: connect to host .* port .*: Connection refused|Connection refused)&#39;, # 1 (error)
r&#39;(?:ssh|mosh): .*supported&#39;, # 2 (error)
r&#39;(?:(?:ssh|mosh): (?:Invalid|usage)|Unknown option:)&#39;, # 3 (error)
&#39;ssh-keygen.*\&#34;&#39;, # 4 (error)
r&#39;(?:ssh: connect to host .* port .*: Connection timed out|mosh: .* timed out)&#39;, # 5 (error)
r&#39;(?:ssh|mosh): .*unavailable&#39;, # 6 (error)
r&#39;(?:Connection to .* closed|Connection closed by remote host)&#39;, # 7 (error)
password_prompt, # 8 (eof)
mosh_prompt, # 9 (eof)
&#39;suspend&#39;, # 10 (eof)
pexpect.EOF, # 11 (eof)
pexpect.TIMEOUT, # 12 (error)
&#34;No route to host&#34;, # 13 (error)
&#34;resolve hostname&#34;, # 14 (error)
r&#39;(?:ssh|mosh): .*no matching&#39;, # 15 (error)
&#34;[b|B]ad (owner|permissions)&#34;, # 16 (error)
&#34;mosh-server:.*not found|command not found&#34;, # 17 (error)
r&#34;(?:Did not find mosh server startup message|(?:mosh: )?Nothing received from server on UDP port \d+\.?|Nothing received from server)&#34;, # 18 (error)
&#34;needs a UTF-8 native locale to run|requires a UTF-8 locale|locale.*not available&#34;, # 19 (error)
]
error_indices = { error_indices = {
&#34;ssh&#34;: [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16], &#34;ssh&#34;: [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16],
@@ -2865,7 +3027,8 @@ class node:
&#34;telnet&#34;: [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16], &#34;telnet&#34;: [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16],
&#34;kubectl&#34;: [1, 2, 3, 4, 8], # Define error indices for kube &#34;kubectl&#34;: [1, 2, 3, 4, 8], # Define error indices for kube
&#34;docker&#34;: [1, 2, 3, 4, 5, 6, 7], # Define error indices for docker &#34;docker&#34;: [1, 2, 3, 4, 5, 6, 7], # Define error indices for docker
&#34;ssm&#34;: [1, 2, 3, 4, 5, 6, 7] &#34;ssm&#34;: [1, 2, 3, 4, 5, 6, 7],
&#34;mosh&#34;: [1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19]
} }
eof_indices = { eof_indices = {
@@ -2874,7 +3037,8 @@ class node:
&#34;telnet&#34;: [8, 9, 10, 11], &#34;telnet&#34;: [8, 9, 10, 11],
&#34;kubectl&#34;: [5, 6, 7], # Define eof indices for kube &#34;kubectl&#34;: [5, 6, 7], # Define eof indices for kube
&#34;docker&#34;: [8, 9, 10], # Define eof indices for docker &#34;docker&#34;: [8, 9, 10], # Define eof indices for docker
&#34;ssm&#34;: [8, 9, 10] &#34;ssm&#34;: [8, 9, 10],
&#34;mosh&#34;: [8, 9, 10, 11]
} }
initial_indices = { initial_indices = {
@@ -2883,13 +3047,17 @@ class node:
&#34;telnet&#34;: [0], &#34;telnet&#34;: [0],
&#34;kubectl&#34;: [0], # Define special indices for kube &#34;kubectl&#34;: [0], # Define special indices for kube
&#34;docker&#34;: [0], # Define special indices for docker &#34;docker&#34;: [0], # Define special indices for docker
&#34;ssm&#34;: [0] &#34;ssm&#34;: [0],
&#34;mosh&#34;: [0]
} }
attempts = 1 attempts = 1
handshake_progressed = False
while attempts &lt;= max_attempts: while attempts &lt;= max_attempts:
args = shlex.split(cmd) args = shlex.split(cmd)
child = pexpect.spawn(args[0], args[1:]) child, err = self._spawn_child(args, protocol=effective_protocol)
if err:
return err
if isinstance(self.tags, dict) and self.tags.get(&#34;console&#34;): if isinstance(self.tags, dict) and self.tags.get(&#34;console&#34;):
child.sendline() child.sendline()
if debug: if debug:
@@ -2903,33 +3071,58 @@ class node:
endloop = False endloop = False
for i in range(len(passwords) if passwords else 1): for i in range(len(passwords) if passwords else 1):
while True: while True:
results = child.expect(expects[self.protocol], timeout=timeout) results = child.expect(expects[effective_protocol], timeout=timeout)
results_value = expects[self.protocol][results] results_value = expects[effective_protocol][results]
if results in initial_indices[self.protocol]: if results in initial_indices[effective_protocol]:
if self.protocol in [&#34;ssh&#34;, &#34;sftp&#34;]: if effective_protocol in [&#34;ssh&#34;, &#34;sftp&#34;, &#34;mosh&#34;]:
child.sendline(&#39;yes&#39;) child.sendline(&#39;yes&#39;)
elif self.protocol in [&#34;telnet&#34;, &#34;kubectl&#34;, &#34;docker&#34;, &#34;ssm&#34;]: handshake_progressed = True
elif effective_protocol in [&#34;telnet&#34;, &#34;kubectl&#34;, &#34;docker&#34;, &#34;ssm&#34;]:
if self.user: if self.user:
child.sendline(self.user) child.sendline(self.user)
else: else:
self.missingtext = True self.missingtext = True
break break
elif results in error_indices[self.protocol]: elif results in error_indices[effective_protocol]:
try:
child.terminate() child.terminate()
if results_value == pexpect.TIMEOUT and attempts != max_attempts: except Exception:
pass
can_retry = (
results_value == pexpect.TIMEOUT
and attempts != max_attempts
and not (effective_protocol == &#34;mosh&#34; and handshake_progressed)
)
if can_retry:
attempts += 1 attempts += 1
endloop = True endloop = True
break break
else: else:
after = &#34;Connection timeout&#34; if results_value == pexpect.TIMEOUT else child.after.decode() def _to_str(val):
return f&#34;Connection failed code: {results}\n{child.before.decode().lstrip()}{after}{child.readline().decode()}&#34;.rstrip() if val is None:
return &#34;&#34;
if hasattr(val, &#34;decode&#34;):
return val.decode()
return str(val)
after = &#34;Connection timeout&#34; if results_value == pexpect.TIMEOUT else _to_str(child.after)
before = _to_str(child.before)
readline_val = _to_str(child.readline())
if effective_protocol == &#34;mosh&#34;:
after = self._logclean(after, True)
before = self._logclean(before, True)
readline_val = self._logclean(readline_val, True)
if effective_protocol == &#34;mosh&#34; and results == 18 and (&#34;Nothing received from server&#34; in after or &#34;Nothing received from server&#34; in before):
err_msg = after.strip() if &#34;Nothing received from server&#34; in after else before.strip()
return f&#34;Connection failed code: {results}\n{err_msg} — UDP traffic is blocked or unreachable. Verify firewall rules for UDP ports (60000-61000 or mosh_udp_port).&#34;
return f&#34;Connection failed code: {results}\n{before.lstrip()}{after}{readline_val}&#34;.rstrip()
elif results in eof_indices[self.protocol]: elif results in eof_indices[effective_protocol]:
if results_value == password_prompt: if results_value == password_prompt:
if passwords: if passwords:
child.sendline(passwords[i]) child.sendline(passwords[i])
handshake_progressed = True
else: else:
self.missingtext = True self.missingtext = True
break break
@@ -2990,7 +3183,7 @@ class node:
- port (str): Port to connect to node, default 22 for ssh and 23 - port (str): Port to connect to node, default 22 for ssh and 23
for telnet. for telnet.
- protocol (str): Select ssh, telnet, kubectl or docker. Default is ssh. - protocol (str): Select ssh, mosh, telnet, kubectl, docker or ssm. Default is ssh.
- user (str): Username to of the node. - user (str): Username to of the node.
@@ -3154,12 +3347,14 @@ def run(self, commands, vars = None,*, folder = &#39;&#39;, prompt = r&#39;&gt;$
str: Output of the commands you ran on the node. str: Output of the commands you ran on the node.
&#39;&#39;&#39; &#39;&#39;&#39;
connect = self._connect(timeout = timeout, logger = logger) force_ssh = (self.protocol == &#34;mosh&#34;)
connect = self._connect(timeout=timeout, logger=logger, force_ssh=force_ssh)
now = datetime.datetime.now().strftime(&#39;%Y-%m-%d_%H%M%S&#39;) now = datetime.datetime.now().strftime(&#39;%Y-%m-%d_%H%M%S&#39;)
if connect == True: if connect == True:
if logger: if logger:
port_str = f&#34;:{self.port}&#34; if self.port and self.protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34; effective_protocol = &#34;ssh&#34; if force_ssh else self.protocol
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {self.protocol}&#34;) port_str = f&#34;:{self.port}&#34; if self.port and effective_protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34;
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {effective_protocol}&#34;)
if &#34;prompt&#34; in self.tags: if &#34;prompt&#34; in self.tags:
prompt = self.tags[&#34;prompt&#34;] prompt = self.tags[&#34;prompt&#34;]
@@ -3312,11 +3507,13 @@ def test(self, commands, expected, vars = None,*, folder = &#39;&#39;, prompt =
&#39;&#39;&#39; &#39;&#39;&#39;
now = datetime.datetime.now().strftime(&#34;%Y-%m-%d_%H-%M-%S&#34;) now = datetime.datetime.now().strftime(&#34;%Y-%m-%d_%H-%M-%S&#34;)
connect = self._connect(timeout = timeout, logger = logger) force_ssh = (self.protocol == &#34;mosh&#34;)
connect = self._connect(timeout=timeout, logger=logger, force_ssh=force_ssh)
if connect == True: if connect == True:
if logger: if logger:
port_str = f&#34;:{self.port}&#34; if self.port and self.protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34; effective_protocol = &#34;ssh&#34; if force_ssh else self.protocol
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {self.protocol}&#34;) port_str = f&#34;:{self.port}&#34; if self.port and effective_protocol not in [&#34;ssm&#34;, &#34;kubectl&#34;, &#34;docker&#34;] else &#34;&#34;
logger(&#34;success&#34;, f&#34;Connected to {self.unique} at {self.host}{port_str} via: {effective_protocol}&#34;)
if &#34;prompt&#34; in self.tags: if &#34;prompt&#34; in self.tags:
prompt = self.tags[&#34;prompt&#34;] prompt = self.tags[&#34;prompt&#34;]
@@ -4112,7 +4309,7 @@ def test(self, commands, expected, vars = None,*, folder = None, prompt = None,
<nav id="sidebar"> <nav id="sidebar">
<div class="toc"> <div class="toc">
<ul> <ul>
<li><a href="#connpy-v630">Connpy (v6.3.0)</a><ul> <li><a href="#connpy-v640b1">Connpy (v6.4.0b1)</a><ul>
<li><a href="#1-ai-system">1. 🤖 AI System</a><ul> <li><a href="#1-ai-system">1. 🤖 AI System</a><ul>
<li><a href="#1a-terminal-copilot-ctrlspace">1a. Terminal Copilot (Ctrl+Space)</a></li> <li><a href="#1a-terminal-copilot-ctrlspace">1a. Terminal Copilot (Ctrl+Space)</a></li>
<li><a href="#1b-ai-chat-conn-ai">1b. AI Chat (conn ai)</a></li> <li><a href="#1b-ai-chat-conn-ai">1b. AI Chat (conn ai)</a></li>
@@ -4135,7 +4332,7 @@ def test(self, commands, expected, vars = None,*, folder = None, prompt = None,
</ul> </ul>
</li> </li>
<li><a href="#4-protocols-connection-features">4. 🔌 Protocols &amp; Connection Features</a><ul> <li><a href="#4-protocols-connection-features">4. 🔌 Protocols &amp; Connection Features</a><ul>
<li><a href="#4a-ssh-sftp-telnet-kubectl-docker-aws-ssm">4a. SSH / SFTP / Telnet / kubectl / Docker / AWS SSM</a></li> <li><a href="#4a-ssh-sftp-mosh-telnet-kubectl-docker-aws-ssm">4a. SSH / SFTP / Mosh / Telnet / kubectl / Docker / AWS SSM</a></li>
<li><a href="#4b-jumphosts">4b. Jumphosts</a></li> <li><a href="#4b-jumphosts">4b. Jumphosts</a></li>
<li><a href="#4c-debug-mode-keepalive-logging">4c. Debug Mode, Keepalive, Logging</a></li> <li><a href="#4c-debug-mode-keepalive-logging">4c. Debug Mode, Keepalive, Logging</a></li>
</ul> </ul>