# tunnel

> For AI agents: the complete documentation index is at https://buddy.works/llms.txt

## Usage

```bash
bdy agent tunnel [options] [command]
```

Manage tunnels run by the agent

## Options

| **Option** | **Description** |
| :--- | :--- |
| `--context <name>` | Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation. |
| `--examples` | Show only examples; with this flag --format accepts text, json or jsonl |
| `--verbose` | Show REST API requests, responses, timing and retries on stderr |
| `-h, --help` | display help for command |

## Available Commands

| **Command** | **Description** |
| :--- | :--- |
| [start](https://buddy.works/docs/cli/agent/tunnel/start.md) | Add the tunnels from the configuration file to the agent |
| [disable](https://buddy.works/docs/cli/agent/tunnel/disable.md) | Disable tunneling in the agent |
| [enable](https://buddy.works/docs/cli/agent/tunnel/enable.md) | Enable tunneling in the agent |
| [http](https://buddy.works/docs/cli/agent/tunnel/http.md) | Add an HTTP tunnel run by the agent |
| [list](https://buddy.works/docs/cli/agent/tunnel/list.md) | List tunnels run by the agent |
| [rm](https://buddy.works/docs/cli/agent/tunnel/rm.md) | Remove a tunnel from the agent by ID |
| [status](https://buddy.works/docs/cli/agent/tunnel/status.md) | Show the status of the agent's tunnels, or of one tunnel by ID |
| [tcp](https://buddy.works/docs/cli/agent/tunnel/tcp.md) | Add a TCP tunnel run by the agent |
| [tls](https://buddy.works/docs/cli/agent/tunnel/tls.md) | Add a TLS tunnel run by the agent |

Documentation for bdy v1.25.34

## Examples

### Start http tunnel on port 80

```bash
bdy agent tunnel http 80
```

### Start http tunnel, whitelist ip and turn on on basic auth

```bash
bdy agent tunnel http https://myhost.com -w 1.1.1.1 -a user:pass
```

### Start tls tunnel on port 80

```bash
bdy agent tunnel tls 80
```

### Start tls tunnel and terminate tls at target

```bash
bdy agent tunnel tls 443 -i target
```

### Start tcp tunnel on port 22

```bash
bdy agent tunnel tcp 22
```

### Start named tcp tunnel with whitelist

```bash
bdy agent tunnel tcp 80 -n name -w 1.1.1.1/27
```

### Add tunnel to config

```bash
bdy tunnel config add http name 80
```

### Start agent tunnel from config

```bash
bdy agent tunnel start name
```

### List agent tunnels

```bash
bdy agent tunnel list
```

### Return the result as JSON

```bash
bdy agent tunnel list --format json
```

### Get agent tunnel status

```bash
bdy agent tunnel status tunnel-id
```

### Return the result as JSON

```bash
bdy agent tunnel status --format json
```

### Remove agent tunnel

```bash
bdy agent tunnel rm tunnel-id
```


---
Original source: https://buddy.works/docs/cli/agent/tunnel