Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions scripts/breakout-to-wave-terminal/README.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clearly AI-generated, but whatever prompt was used didn't prioritize user experience and getting started quickly. I suggest refactoring this to offer a quick start. More specific comments in line.

Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
\
# CML2 Consoles in Wave Terminal (Linux)

A lightweight launcher that integrates **Cisco Modeling Labs 2 (CML2)** with **Wave Terminal**, automatically creating one terminal block for each device console.

This project uses the **CML2 breakout** utility as a local console proxy together with Wave Terminal's `wsh run` command.

> **Repository:** `cml-breakout-wave-terminal`

Repository Base: https://github.com/hendapaim/cml-breakout-wave-terminal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed, but perhaps a link to the Wave terminal would be useful.

---

# Features

- 🚀 Automatic Wave Terminal console creation
- 🔄 Refreshes CML topology every launch
- 🔌 Automatically starts the Breakout proxy when required
- 🖥️ One terminal block per enabled serial console
- 📦 Portable launcher (directory can be moved or renamed)
- 🔒 Local-only console listener by default (`[::1]`)
- ⚡ Supports `telnet`, `nc`, or `ncat`

---

# Requirements

- Linux
- Cisco Modeling Labs 2
- Python 3
- Wave Terminal
- CML2 `breakout` binary
- One of:
- `telnet`
- `netcat-openbsd (nc)`
- `ncat`

---

# Project Structure

```text
.
├── breakout
├── config.yaml
├── labs.yaml
├── main.py
├── wave-cml2
└── README.md
```

---

# Initial Setup

Export your CML credentials:

```bash
export BREAKOUT_USERNAME=admin
export BREAKOUT_PASSWORD='your-cml2-password'
```

Initialize the project:

```bash
./breakout -config config.yaml -labs labs.yaml init INIT

python3 main.py INIT
```

This command:

- Connects to CML2
- Detects the selected lab
- Retrieves console port assignments
- Writes the information into `labs.yaml`

Review `labs.yaml` and ensure the desired lab and devices are enabled.

---

# Launch Consoles

Run:

```bash
python3 main.py INIT --run
```

or execute the generated launcher directly:

```bash
./wave-cml2
```

Every launch automatically:

1. Refreshes the lab from CML2
2. Updates console port assignments
3. Rebuilds the launcher
4. Starts the Breakout proxy if necessary
5. Waits until the local proxy is ready
6. Opens one Wave Terminal block for every enabled serial console

No manual port management is required.

---

# Using a Different Console Host

The launcher searches for the following files relative to its own location:

- `breakout`
- `config.yaml`
- `labs.yaml`

Because of this, the directory can be moved without modifying paths.

To temporarily use another console proxy:

```bash
CONSOLE_HOST=127.0.0.1 ./wave-cml2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is meant by a console host? Is this another instance of the breakout tool? The breakout tool always binds locally. So why would one need another console host?

```

---

# Security

By default the Breakout listener binds only to:

```text
[::1]
```

This keeps console ports accessible only from the local machine.

---

# Supported Console Clients

The launcher automatically uses the first available client:

1. `telnet`
2. `nc`
3. `ncat`

Install `netcat-openbsd` if none are already installed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does one do this?


---

# Legacy Note

`config.ini` is retained only for backward compatibility.

The recommended workflow uses:

- `config.yaml`
- `labs.yaml`
- `wave-cml2`

---

# Workflow

```text
CML2
breakout
Local Console Proxy
wave-cml2
Wave Terminal
├── Router 1
├── Router 2
├── Switch 1
└── ...
```

---


# Author
Henda Paim - https://www.linkedin.com/in/hendapaim0

# License

Use and modify freely according to the license included in this repository.
Binary file added scripts/breakout-to-wave-terminal/breakout

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not have been committed.

Binary file not shown.
40 changes: 40 additions & 0 deletions scripts/breakout-to-wave-terminal/config.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not have been committed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# breakout configuration file
# - 'username' and 'password' for authentication
# NOTE: the password is not exported with 2.8, if it exists
# when starting the breakout then it will be used but it won't
# be saved when exiting the program. Use environment variables
# instead!
# Using the UI *did* save the password in previous versions.
# - replace hostname 'cml-controller.cml.lab' with your IP or FQDN
# - set an empty 'listen_address' to listen globally
#
# Known environment variables:
#
# BREAKOUT_USERNAME
# BREAKOUT_PASSWORD
# BREAKOUT_CONTROLLER
# BREAKOUT_LISTEN_ADDRESS
# BREAKOUT_LAB_CONFIG_NAME
# BREAKOUT_UI_SERVER_PORT
# BREAKOUT_CONSOLE_START_PORT
# BREAKOUT_VNC_START_PORT
# BREAKOUT_POPULATE_ALL
# BREAKOUT_VERIFY_TLS
# BREAKOUT_EXTRA_LF
#

console_start_port: 9000
# CML2 controller. Override any of these values with BREAKOUT_* variables.
controller: https://cml2
extra_lf: false
lab_config_name: labs.yaml
listen_address: '[::1]'
populate_all: false
ui_server_port: 8080
username: admin
password: '240819Hp#'
# Never save the CML2 password here. Export BREAKOUT_PASSWORD before running
# breakout, or let breakout request it interactively.
verify_tls: false
vnc_start_port: 5900
47 changes: 47 additions & 0 deletions scripts/breakout-to-wave-terminal/labs.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not have been committed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
05923109-fe68-41d3-a638-55962bb9977d:
created: "2026-05-15T23:00:44+00:00"
effective_permissions:
- lab_admin
- lab_exec
- lab_edit
- lab_view
enabled: true
id: 05923109-fe68-41d3-a638-55962bb9977d
lab_description: ""
lab_title: INIT
link_count: 4
node_count: 5
nodes:
005dfa97-a3dc-4b4f-b548-372941209b1f:
devices:
- enabled: true
listen_port: 9002
name: serial0
running: false
status: ""
label: "65200"
98bacfe7-5d37-4702-8b00-9c2ffcd81e80:
devices:
- enabled: true
listen_port: 9003
name: serial0
running: false
status: ""
label: "65300"
acae0012-6d7f-4b25-8f30-30938593abf4:
devices:
- enabled: true
listen_port: 9001
name: serial0
running: false
status: ""
label: "65100"
d44f037a-8082-4aa9-9723-f91607c7e3b7:
devices:
- enabled: true
listen_port: 9000
name: serial0
running: false
status: ""
label: "65001"
state: STARTED
Loading