Skip to main content

A terminal GUI for managing Warden Docker environments

Project description

WardenGUI

A terminal-based GUI for managing Warden Docker development environments.

Python License

Features

  • ๐Ÿณ Interactive Menu - Navigate and manage multiple Warden environments with visual selection
  • ๐Ÿ”„ Environment Switching - Automatically stop current and start new environments with one command
  • ๐Ÿ“Š Docker Stats - View disk usage for images and volumes
  • ๐Ÿ”Œ SSH Access - Quick shell access to running containers (GUI and headless mode)
  • ๐Ÿ“‹ Log Streaming - Follow container logs in real-time with customizable tail options
  • ๐Ÿ  Hosts File Check - Windows hosts file validation
  • โŒจ๏ธ Terminal Commands - Run warden commands directly from the GUI
  • ๐Ÿš€ Headless Mode - Run commands via CLI without interactive GUI (start, info, ssh, log)
  • ๐ŸŽจ Modern UI - Clean, business-like terminal interface with clickable URLs

Installation

Quick Install (One-liner)

From PyPI (recommended):

curl -sSL https://raw.githubusercontent.com/Genaker/WardenGUI/main/install.sh | bash

From GitHub (latest dev version):

curl -sSL https://raw.githubusercontent.com/Genaker/WardenGUI/main/install-git.sh | bash

The Git installer:

  • Clones repository to ~/.wardengui
  • Creates launcher scripts in ~/.local/bin
  • Easy to update with cd ~/.wardengui && git pull

From PyPI

pip install wardengui

From Source

git clone https://github.com/Genaker/WardenGUI.git
cd WardenGUI
pip install -e .

Upgrade to Latest Version

pip install --upgrade wardengui

Or force reinstall:

pip install --upgrade --force-reinstall wardengui

Check Installed Version

pip show wardengui

WSL / Linux Installation

โš ๏ธ Note: WardenGUI uses only Python standard library - no external dependencies! Using --break-system-packages is completely safe as it won't affect any system packages.

Option 1: Direct install (recommended)

pip3 install --break-system-packages wardengui

Option 2: Using pipx (isolated environment)

sudo apt install pipx
pipx ensurepath
pipx install wardengui

Option 3: User install without breaking system

pip3 install --user wardengui

Option 4: Virtual environment

python3 -m venv ~/.wardengui-venv
~/.wardengui-venv/bin/pip install wardengui
~/.wardengui-venv/bin/wardengui

Troubleshooting: Command Not Found

If you see wardengui: command not found after installation, the scripts are installed in ~/.local/bin which is not in your PATH.

Fix 1: Add to PATH (permanent)

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
wardengui

Fix 2: Run directly

~/.local/bin/wardengui

Fix 3: Use Python module

python3 -m wardengui

Usage

# Run with default settings (scans ~/ for projects)
wardengui
# or
warden-gui

# Specify projects directory
wardengui -p /path/to/projects

# Use 'down/up' instead of 'stop/start' (removes containers)
wardengui --down

Commands

Interactive GUI Mode

Navigation:

Command Description
โ†‘/โ†“ or u/d Navigate menu up/down
0-9 Select environment by number
Enter or start Start selected environment
q or quit Exit application
help or ? Show available commands

Environment Actions:

Command Description
ssh or s SSH into running environment
log or logs Follow all container logs
log nginx Follow specific service logs
ls List running containers
run <cmd> Run one-off warden command
port <svc> Show port bindings

Headless Mode (CLI)

Run commands directly without the interactive GUI:

# Start an environment (stops current, starts new)
wardengui myproject start

# Show environment information
wardengui myproject info
# or simply
wardengui myproject

# SSH into running environment
wardengui myproject ssh

# View logs (last 100 lines)
wardengui myproject log

# View logs with custom tail
wardengui myproject log --tail 50

# Follow logs (tail -f)
wardengui myproject log -f

# Follow logs with custom tail
wardengui myproject log --tail 200 -f

Headless Mode Options:

Option Description
--tail N Show last N log lines (default: 100)
-f, --follow Follow log output (like tail -f)
-p, --projects-root Specify projects directory
-d, --down Use env down/up instead of env stop/start

Requirements

  • Python 3.8+
  • Warden installed at /opt/warden/bin/warden
  • Docker running
  • WSL2 (on Windows)

Building & Publishing

Step 1: Install Build Tools

pip install build twine

Step 2: Clean Previous Builds

rm -rf build/ dist/ *.egg-info/

Step 3: Build the Package

cd C:\Users\Yshytikov\WardenGUI
python -m build

This creates:

dist/
โ”œโ”€โ”€ wardengui-1.0.0-py3-none-any.whl    # Wheel (binary)
โ””โ”€โ”€ wardengui-1.0.0.tar.gz              # Source distribution

Step 4: Test Locally

# Install locally in editable mode
pip install -e .

# Test the command works
wardengui --help

Step 5: Create PyPI Account

  1. Go to https://pypi.org/account/register/
  2. Create an account
  3. Go to Account Settings โ†’ API tokens
  4. Create a new API token (scope: entire account or project-specific)
  5. Save the token (starts with pypi-)

Step 6: Configure Twine

Create ~/.pypirc (or C:\Users\YourName\.pypirc on Windows):

[pypi]
username = __token__
password = pypi-YOUR_API_TOKEN_HERE

Or use environment variable:

export TWINE_PASSWORD=pypi-YOUR_API_TOKEN_HERE

Step 7: Upload to TestPyPI (Optional - Recommended First)

# Upload to TestPyPI for testing
twine upload --repository testpypi dist/*

# Test install from TestPyPI
pip install --index-url https://test.pypi.org/simple/ wardengui

Step 8: Upload to PyPI

twine upload dist/*

Step 9: Verify Installation

# Install from PyPI
pip install wardengui

# Run
wardengui

Quick Build & Push Script

Use the included build_and_push.sh script:

chmod +x build_and_push.sh
./build_and_push.sh

This script will:

  1. Clean previous builds
  2. Build the package
  3. Check for errors
  4. Ask for confirmation before uploading to PyPI

Version Bump

Before publishing a new version, update version in pyproject.toml:

[project]
version = "1.0.1"  # Increment this

Project Structure

wardengui/
โ”œโ”€โ”€ pyproject.toml          # Package configuration
โ”œโ”€โ”€ README.md               # This file
โ”œโ”€โ”€ LICENSE                 # MIT License
โ”œโ”€โ”€ warden_gui.py           # Direct execution script
โ”œโ”€โ”€ build_and_push.sh       # Build and publish script
โ”œโ”€โ”€ tests/                  # Unit tests
โ”‚   โ”œโ”€โ”€ test_headless.py    # Headless mode tests
โ”‚   โ””โ”€โ”€ test_warden_mocking.py  # WardenManager tests
โ””โ”€โ”€ src/
    โ””โ”€โ”€ wardengui/
        โ”œโ”€โ”€ __init__.py     # Package init, exports
        โ”œโ”€โ”€ __main__.py     # Module execution entry point
        โ”œโ”€โ”€ warden.py       # WardenManager class (core logic)
        โ”œโ”€โ”€ cli.py          # CLI entry point (GUI + headless)
        โ””โ”€โ”€ colors.py       # ANSI color codes and formatting

Configuration

Option Default Description
-p, --projects-root ~ Root directory to scan for Warden projects
-d, --down false Use env down/up instead of env stop/start (removes containers)

Environment Variables

WardenGUI automatically detects:

  • Warden installation at /opt/warden/bin/warden
  • WSL environment (for Windows users)
  • Docker availability
  • Project locations by scanning for .warden directories

Project Detection

WardenGUI scans the specified directory (default: ~) for directories containing .warden folders. Each project must have:

  • A .warden directory
  • A .env file with WARDEN_ENV_NAME defined

Example project structure:

~/myproject/
โ”œโ”€โ”€ .warden/
โ”œโ”€โ”€ .env          # Contains WARDEN_ENV_NAME=myproject
โ””โ”€โ”€ ...

Screenshot

Interactive GUI Mode

๐Ÿณ WARDEN ENVIRONMENT MANAGER

๐Ÿ“ฆ ENVIRONMENTS:
> 0. [myproject]  โ— RUNNING  ->  https://app.example.test
  1. [example]  โ—‹ STOPPED  ->  https://app.demo.test
  2. [test-env]  โ—‹ STOPPED  ->  https://app.test.local

  q. [Exit]

๐Ÿ“‹ MYPROJECT DETAILS:
  ๐Ÿ“ Path:        /home/user/myproject
  ๐ŸŒ URL:         https://app.example.test/
  ๐Ÿ“ฆ Repo:        https://github.com/user/myproject
  ๐Ÿ  Hosts:       โœ“ 127.0.0.1 -> app.example.test
  ๐Ÿ”ง Environment: myproject
  ๐Ÿ“ฆ Type:        symfony
  ๐Ÿ˜ PHP:         8.4
  ๐Ÿ—„๏ธ  DB:          10.11
  ๐Ÿ” ES:          8.15.0
  ๐Ÿ’พ Volumes: 6                     ๐ŸณContainers: 3/8 running
  โ””โ”€ dbdata: 8.58GB                โ— php-fpm
  โ””โ”€ esdata: 43.45MB               โ— nginx
  โ””โ”€ bashhistory: 1.401kB          โ— elasticsearch
  โ””โ”€ sshdirectory: 278B            โ—‹ db
  โ””โ”€ redis: 93B                    โ—‹ elasticsearch-hq
                                   โ—‹ php-debug

  โ— Status: RUNNING

Headless Mode Examples

Starting an environment:

$ wardengui myproject start
Stopping current environment 'example'...

STOPPING EXAMPLE
  $ cd /home/user/example && /opt/warden/bin/warden env stop

  โœ“ Container example-php-fpm-1 Stopped
  โœ“ Container example-nginx-1 Stopped
  โœ“ Environment example stopped successfully

Starting environment 'myproject'...

STARTING MYPROJECT
  Step 1/3: Starting Warden services...
  $ /opt/warden/bin/warden svc up -d

  Running:
    โ— traefik
    โ— portainer
  โœ“ Warden services ready

  Step 2/3: Starting myproject environment...
  $ cd /home/user/myproject && /opt/warden/bin/warden env up -d

  โœ“ Container myproject-php-fpm-1 Created
  โœ“ Container myproject-php-fpm-1 Started
  โœ“ Container myproject-nginx-1 Started
  โœ“ Network myproject_default Created

  Step 3/3: Restarting Warden services...
  $ /opt/warden/bin/warden svc restart

  โœ“ Services restarted
  โœ“ Environment myproject started successfully

โœ“ myproject is now running!
  -> https://app.example.test/

Viewing environment info:

$ wardengui myproject info
๐Ÿ“‹ MYPROJECT DETAILS:
  ๐Ÿ“ Path:        /home/user/myproject
  ๐ŸŒ URL:         https://app.example.test/
  ๐Ÿ“ฆ Repo:        https://github.com/user/myproject
  ๐Ÿ”ง Environment: myproject
  ๐Ÿ“ฆ Type:        symfony
  ๐Ÿ˜ PHP:         8.4
  ๐Ÿ—„๏ธ  DB:          10.11
  ๐Ÿ” ES:          8.15.0
  ๐Ÿ’พ Volumes: 6                     ๐ŸณContainers: 8/8 running
  โ””โ”€ dbdata: 12.3GB                โ— php-fpm
  โ””โ”€ appcode: 2.1GB                โ— nginx
  โ””โ”€ esdata: 156MB                 โ— elasticsearch
  โ””โ”€ bashhistory: 2.1kB            โ— db
  โ””โ”€ redis: 93B                    โ— elasticsearch-hq
                                   โ— php-debug

  โ— Status: RUNNING

SSH access:

$ wardengui myproject ssh
๐Ÿ”Œ Connecting to myproject...
  $ cd /home/user/myproject && /opt/warden/bin/warden shell

Type 'exit' to return.

[user@myproject-php-fpm-1 /app]$ 

Viewing logs:

$ wardengui myproject log --tail 50 -f
๐Ÿ“‹ Showing logs for myproject...
  $ cd /home/user/myproject && /opt/warden/bin/warden env logs --tail 50 -f

Press Ctrl+C to stop following logs.

[Log output follows...]

License

MIT License - see LICENSE file for details.

Author

Yehor Shytikov

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wardengui-1.0.19.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wardengui-1.0.19-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file wardengui-1.0.19.tar.gz.

File metadata

  • Download URL: wardengui-1.0.19.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for wardengui-1.0.19.tar.gz
Algorithm Hash digest
SHA256 b7f97b7ad69111236180dd752d8b9da2aca54fa97346615f444fddc0044521d9
MD5 440750e9407e510a6fb1e0b64cf0c3ed
BLAKE2b-256 5a36c666c3c1121205483dcb527da26af6145f4887c7b51c0657933612cfd1fa

See more details on using hashes here.

File details

Details for the file wardengui-1.0.19-py3-none-any.whl.

File metadata

  • Download URL: wardengui-1.0.19-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for wardengui-1.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 ea5bfd9045b978ca27625f3eecdb3093f2a0c22e468ce17883260d7f6f5fd028
MD5 bff581e3bc9ec211ab1a77a4e932b37a
BLAKE2b-256 48699dbc00b62734847b6f2c0001a8391418cb738b28646bb6ef912ec49683fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page