Skip to main content

Terminal User Interface for Hop3 PaaS

Project description

hop3-tui

Terminal User Interface for Hop3 PaaS.

A modern, keyboard-driven terminal interface for managing your Hop3 applications, built with Textual.

Features

  • Dashboard overview - System stats, app summary, recent activity, quick actions
  • Applications management - List, filter, start/stop/restart apps with keyboard shortcuts
  • App detail view - Detailed information with action buttons and logs preview
  • Environment variables - View, add, edit, delete env vars with sensitive value hiding
  • Real-time log streaming - Filter logs, pause/resume, auto-scroll
  • Chat/command interface - Interactive command line with tab completion
  • System monitoring - CPU, memory, disk usage and service status

Installation

# Install from workspace root
uv sync

# Or install the package directly
pip install hop3-tui

Quick Start

# Set your server URL (or use config file)
export HOP3_SERVER_URL="https://hop3.example.com"
export HOP3_TOKEN="your-api-token"

# Run the TUI
hop3-tui

# Or run as a module
python -m hop3_tui

Configuration

Configuration can be provided via environment variables or a TOML config file.

Environment Variables

Variable Description Default
HOP3_SERVER_URL or HOP3_URL Server URL http://localhost:5000
HOP3_AUTH_TOKEN or HOP3_TOKEN API authentication token (none)
HOP3_TUI_THEME Color theme (dark or light) dark
HOP3_TUI_REFRESH Auto-refresh interval in seconds 5

Config File

The TUI looks for configuration in these locations (in order):

  1. ./hop3-tui.toml (current directory)
  2. ./.hop3-tui.toml (hidden file in current directory)
  3. ~/.config/hop3/tui.toml
  4. ~/.hop3/tui.toml

Example configuration file:

# hop3-tui.toml

[server]
url = "https://hop3.example.com"
token = "your-api-token"

[display]
theme = "dark"          # dark or light
refresh_interval = 5    # seconds
show_clock = true

[behavior]
auto_refresh = true
confirm_destructive = true

Keyboard Shortcuts

Global Navigation

Key Action
d Go to Dashboard
a Go to Apps list
s Go to System status
c Go to Chat/command interface
? Show help
q Quit

List Navigation

Key Action
j / Down Move down
k / Up Move up
Enter Select / View details
Escape Go back
/ Focus filter input
R Refresh

Apps Screen

Key Action
s Start selected app
S Stop selected app
r Restart selected app
n New app

App Detail Screen

Key Action
l View logs
e View environment variables
s Stop app
r Restart app
R Refresh

Logs Screen

Key Action
Space Pause/resume streaming
g Scroll to top
G Scroll to bottom
/ Filter logs
d Download logs

Chat Commands

The chat interface supports these commands with Tab completion:

Command Description
apps List all applications
app <name> Show app details
start <name> Start application
stop <name> Stop application
restart <name> Restart application
logs <name> View recent logs
env <name> Show environment variables
status Show system status
clear Clear chat history
help or ? Show help
deploy <name> Deploy application
backup <name> Create backup
restore <id> Restore backup

Tab Completion: Press Tab while typing to auto-complete commands and app names.

Screens Overview

Dashboard

+----------------------------------+----------------------------------+
| APPLICATIONS                     | SYSTEM STATUS                    |
| Running: 5                       | CPU:    ████░░░░░░ 42%           |
| Stopped: 2                       | Memory: ██████░░░░ 63%           |
| Failed:  1                       | Disk:   ████████░░ 81%           |
+----------------------------------+----------------------------------+
| RECENT ACTIVITY                  | QUICK ACTIONS                    |
| No recent activity               | [d] Deploy new app               |
|                                  | [b] Create backup                |
|                                  | [l] View system logs             |
+----------------------------------+----------------------------------+

Apps List

+----------------------------------------------------------------------+
| Applications                                         Filter: [______] |
+----------------------------------------------------------------------+
| NAME           STATUS     PORT    RUNTIME      UPDATED               |
| > myapp        RUNNING    8000    uwsgi        2h ago                |
|   api-server   RUNNING    8001    uwsgi        1d ago                |
|   worker       STOPPED    -       uwsgi        3d ago                |
+----------------------------------------------------------------------+

Chat Interface

+----------------------------------------------------------------------+
| Hop3 Command Interface                                                |
+----------------------------------------------------------------------+
| Welcome to Hop3 Command Interface                                     |
| Type a command or ? for help                                          |
|                                                                       |
| > apps                                                                |
|                                                                       |
| Applications                                                          |
| -----------                                                           |
| * myapp        RUNNING  :8000                                         |
| * api-server   RUNNING  :8001                                         |
| o worker       STOPPED                                                |
|                                                                       |
| > _                                                                   |
+----------------------------------------------------------------------+

Development

Setup

# Clone and install dependencies
git clone <repository>
cd hop3/packages/hop3-tui
uv sync

# Install dev dependencies
uv sync --group dev

Running in Development

# Run with auto-reload on file changes
textual run --dev src/hop3_tui/app.py

# Or run normally
python -m hop3_tui

Running Tests

# Run all tests
uv run pytest tests/ -v

# Run with coverage
uv run pytest tests/ --cov=hop3_tui --cov-report=term-missing

# Run specific test file
uv run pytest tests/test_screens.py -v

Project Structure

packages/hop3-tui/
├── pyproject.toml
├── README.md
├── src/
│   └── hop3_tui/
│       ├── __init__.py
│       ├── __main__.py           # Entry point
│       ├── app.py                # Main Hop3TUI class
│       ├── config.py             # Configuration handling
│       ├── api/
│       │   ├── __init__.py
│       │   ├── client.py         # JSON-RPC API client
│       │   └── models.py         # Pydantic data models
│       ├── screens/
│       │   ├── __init__.py
│       │   ├── dashboard.py      # Main dashboard
│       │   ├── apps.py           # Apps list
│       │   ├── app_detail.py     # App detail view
│       │   ├── env_vars.py       # Environment variables
│       │   ├── logs.py           # Log viewer
│       │   ├── system.py         # System status
│       │   └── chat.py           # Chat interface (with tab completion)
│       ├── widgets/
│       │   ├── __init__.py
│       │   ├── status_badge.py   # Status indicator
│       │   ├── status_panel.py   # System status panel
│       │   └── confirmation.py   # Confirmation dialog
│       └── styles/
│           └── base.tcss         # Global styles
└── tests/
    ├── __init__.py
    ├── test_app.py               # App tests
    ├── test_client.py            # API client tests
    ├── test_config.py            # Configuration tests
    ├── test_models.py            # Model tests
    ├── test_screens.py           # Screen tests
    └── test_widgets.py           # Widget tests

API Integration

The TUI communicates with the Hop3 server via JSON-RPC over HTTP. The API client supports:

  • Authentication via bearer tokens
  • Async operations with httpx
  • Automatic retry on connection errors
  • Request ID tracking

Documentation

Related Packages

  • hop3-server - The server that hop3-tui communicates with
  • hop3-cli - Alternative command-line interface

License

Apache-2.0 - Copyright (c) 2024-2025, Abilian SAS

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

hop3_tui-0.4.0b3.tar.gz (46.1 kB view details)

Uploaded Source

Built Distribution

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

hop3_tui-0.4.0b3-py3-none-any.whl (52.3 kB view details)

Uploaded Python 3

File details

Details for the file hop3_tui-0.4.0b3.tar.gz.

File metadata

  • Download URL: hop3_tui-0.4.0b3.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hop3_tui-0.4.0b3.tar.gz
Algorithm Hash digest
SHA256 d83443fe8b54eecb52a46a62b2e7178705d2039b70f0d3cf59d2184b18414665
MD5 931cfeb5dd7f2340e69a46a5f1aa3cb8
BLAKE2b-256 1655f4b418696957bcc0c5a03e0df4e245cfeb45b0a7233101c3dcba05f23eac

See more details on using hashes here.

File details

Details for the file hop3_tui-0.4.0b3-py3-none-any.whl.

File metadata

  • Download URL: hop3_tui-0.4.0b3-py3-none-any.whl
  • Upload date:
  • Size: 52.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hop3_tui-0.4.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 3ff5c0846540d2f4197b404ccac2e4e5d5fd68440eb617bd172b5fc13fef601f
MD5 378d89a98748da38d0726e9790d9e54a
BLAKE2b-256 94332892a0ed4c6ef1ce6e73920ecc13b0b177e53b66d79a6f680539d67d19c9

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