https://github.com/iximiuz/labctl
iximiuz Labs control - start remote microVM playgrounds from the command line.
https://github.com/iximiuz/labctl
devops docker kubernetes linux networking playgrounds
Last synced: 7 months ago
JSON representation
iximiuz Labs control - start remote microVM playgrounds from the command line.
- Host: GitHub
- URL: https://github.com/iximiuz/labctl
- Owner: iximiuz
- License: apache-2.0
- Created: 2024-02-29T19:55:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-26T09:08:59.000Z (8 months ago)
- Last Synced: 2025-04-03T19:12:40.750Z (8 months ago)
- Topics: devops, docker, kubernetes, linux, networking, playgrounds
- Language: Go
- Homepage: https://labs.iximiuz.com/playgrounds
- Size: 290 KB
- Stars: 268
- Watchers: 4
- Forks: 27
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iximiuz Labs control - Start Remote microVM Playgrounds From The Command Line
This is a command line tool for [iximiuz Labs](https://labs.iximiuz.com).
You can use it to start and access Linux, Docker, Kubernetes, networking, and other types of DevOps playgrounds.
Playgrounds are ephemeral, disposable, and secure enough for happy experimentation.
Some popular playgrounds:
- [ubuntu](https://labs.iximiuz.com/playgrounds/ubuntu) - A vanilla Ubuntu server.
- [k3s](https://labs.iximiuz.com/playgrounds/k3s) - A multi-node K3s cluster with a load balancer, Helm, and more.
- [docker](https://labs.iximiuz.com/playgrounds/docker) - A Linux server with Docker engine pre-installed.
- [podman](https://labs.iximiuz.com/playgrounds/podman) - A Linux server with Podman, a daemonless Docker alternative.
- [mini-lan-ubuntu](https://labs.iximiuz.com/playgrounds/mini-lan-ubuntu) - Four refined Ubuntu VMs connected into a single network.
- [k8s-client-go](https://labs.iximiuz.com/playgrounds/k8s-client-go) - Mini-programs demonstrating Kubernetes client-go usage.
- [golang](https://labs.iximiuz.com/playgrounds/golang) - A fresh Go version and a loaded VS Code (or Vim) is all you need.
See the full list of playgrounds at [labs.iximiuz.com/playgrounds](https://labs.iximiuz.com/playgrounds).
## 🎬 Getting started
Check out this short recording on YouTube to get started:
## Installation
The below command will download the latest release to `~/.iximiuz/labctl/bin`, adding it to your PATH.
```sh
curl -sf https://labs.iximiuz.com/cli/install.sh | sh
```
## Usage
### Authentication
First, you need to authenticate the CLI session with iximiuz Labs.
The below command will open a browser page with a one-time use URL.
```sh
labctl auth login
```
### Starting playgrounds
Once you have authenticated, you can start a new playground with a simple:
```sh
labctl playground start docker
```
You can also automatically **open the playground in a browser** with:
```sh
labctl playground start k3s --open
```
...or **SSH into the playground's machine** with:
```sh
labctl playground start ubuntu-24-04 --ssh
```
### SSH into a playground
Once you have started a playground, you can access it with:
```sh
labctl ssh
```
...or run a one-off command with:
```sh
labctl ssh -- ls -la /
```
### Using IDE (VSCode, JetBrains, etc) to access playgrounds
You can start a playground and open it in your IDE with:
```sh
labctl playground start docker --ide
```
You can use the **SSH proxy mode** to access playgrounds from your IDE:
```sh
labctl ssh-proxy
```
Example output:
```text
SSH proxy is running on 58279
# Connect from the terminal:
ssh -i ~/.ssh/iximiuz_labs_user ssh://root@127.0.0.1:58279
# Or add the following to your ~/.ssh/config:
Host 65ea1e10f6af43783e69fe68-docker-01
HostName 127.0.0.1
Port 58279
User root
IdentityFile ~/.ssh/iximiuz_labs_user
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
# To access the playground in Visual Studio Code:
code --folder-uri vscode-remote://ssh-remote+127.0.0.1:58279/root
Press Ctrl+C to stop
```
After adding the above piece to your SSH config,
you'll be able to develop right on the playground machine using the [Visual Studio Code Remote - SSH extension](https://code.visualstudio.com/docs/remote/ssh) or its JetBrains counterpart.
Check out this [short recording on YouTube](https://youtu.be/wah_yLoYk0M) demonstrating the use case.
### Sharing the playground access with a web terminal
You can share the playground access with others by sending them a URL to an exposed web terminal session:
```sh
labctl expose shell --public
```
### Exposing HTTP(s) services running in the playground
You can expose HTTP(s) services running in the playground to the public internet with:
```sh
labctl expose port
```
Example:
```sh
# Start a new Docker playground
PLAYGROUND_ID=$(labctl playground start -q docker)
# Run a container that listens on port 8080
labctl ssh $PLAYGROUND_ID -- docker run -p 8080:80 -d nginx:alpine
# Expose port 8080 to the internet
labctl expose port $PLAYGROUND_ID 8080 --open
```
The `labctl expose port` command supports a number of options to enable/disable HTTPS,
set the Host header and path overrides, and control the URL access.
### Port forwarding
You can securely expose any service (HTTP, TCP, UDP, etc) running in the playground to your local machine with:
```sh
labctl port-forward -L :
```
You can also expose locally running services to the playground using **remote port forwarding** (via SSH):
```sh
labctl ssh-proxy --address
ssh -i ~/.ssh/iximiuz_labs_user \
-R ::: \
ssh://root@
```
### Listing and stopping playgrounds
You can list recent playgrounds with:
```sh
labctl playground list
```
And stop a running playground with:
```sh
labctl playground stop
```
### Signing out and deleting the CLI
You can sign out and delete the CLI session with:
```sh
labctl auth logout
```
To uninstall the CLI, just remove the `~/.iximiuz/labctl` directory.
## License
APACHE-2.0
