Skip to content

betterwebinit/modern-bash-webinterface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ShellUI - Modern Web Interface for Shell Commands

ShellUI provides safe and simple access to predefined shell commands from a modern web interface with advanced theming capabilities.

πŸš€ Features

  • 🎨 Modern Web Interface - Built with React, TypeScript, and Tailwind CSS
  • ⚑ Real-time Execution - WebSocket-based real-time command output streaming
  • πŸ”’ Security First - Built-in authentication and access control
  • πŸ“± Responsive Design - Touch-friendly interface for tablets and mobile
  • πŸ”„ Command History - Track and manage command execution history
  • βš™οΈ YAML Configuration - Simple configuration in YAML format
  • 🐳 Container Ready - Docker support for easy deployment
  • πŸ”Œ API Integration - RESTful API for external integrations
  • 🎯 Advanced Validation - Real-time argument validation with patterns and constraints
  • πŸ“– Built-in Help - Command help integration with man pages
  • 🎨 Custom Themes - Advanced theming with custom colors and effects
  • πŸ“Š Execution Statistics - Track command usage and performance

🎯 Use Cases

For Non-Technical Users

  • Give family members a button to restart services: systemctl restart plex
  • Provide junior admins with simple web forms for complex scripts
  • Enable temporary SSH access: firewall-cmd --add-service ssh --timeout 20m

For System Administrators

  • Expose complex commands on wall-mounted tablets
  • Run long-running commands from mobile devices
  • Create parameterized commands with dropdown selections
  • Manage multiple servers from a single interface

πŸ› οΈ Quick Start

Prerequisites

  • Node.js 18+ or Bun
  • Linux/Unix system with shell access

Installation

  1. Clone the repository

    git clone https://github.com/your-username/shellui.git
    cd shellui
  2. Install dependencies

    bun install
  3. Configure commands

    cp config.example.yaml config.yaml
    # Edit config.yaml with your commands
  4. Start the application

    bun dev
  5. Access the web interface Open http://localhost:3000 in your browser

βš™οΈ Configuration

ShellUI uses YAML configuration files to define commands, themes, and security settings.

Basic Configuration Example

title: "ShellUI - My Server"
theme: "dark"

auth:
  enabled: true
  users:
    - username: "admin"
      password: "secure_password"
      roles: ["admin"]

commands:
  - id: "system-info"
    title: "System Information"
    description: "Display system information"
    icon: "Terminal"
    shell: "/bin/bash"
    command: "uname -a && df -h && free -h"
    category: "System"

Advanced Command with Arguments

commands:
  - id: "ping-test"
    title: "Ping Test"
    description: "Test network connectivity"
    icon: "Wifi"
    category: "Network"
    shell: "/bin/bash"
    command: "ping -c {{ count }} {{ host }}"
    args:
      - name: "host"
        type: "text"
        label: "Host"
        placeholder: "Enter hostname or IP"
        required: true
        pattern: "^[a-zA-Z0-9.-]+$"
        help: "Enter a valid hostname or IP address"
      - name: "count"
        type: "number"
        label: "Count"
        default: 4
        min: 1
        max: 20
        required: false
        help: "Number of ping packets to send"

πŸ—οΈ Architecture

ShellUI follows a modern microservices architecture:

  • Frontend: React + TypeScript + Tailwind CSS
  • Backend: Bun + Elysia.js (TypeScript)
  • Real-time: WebSocket for live command output
  • Storage: JSON-based execution history
  • Authentication: JWT-based with role-based access

πŸ”’ Security Features

  • Authentication: JWT-based user authentication
  • Authorization: Role-based access control
  • Input Validation: Strict parameter validation with patterns
  • Command Sanitization: Safe command execution
  • Rate Limiting: Prevent abuse
  • Audit Logging: Track all command executions

πŸ“š Documentation

πŸ”Œ API Reference

ShellUI provides a comprehensive REST API for integration:

  • Command Execution: POST /api/commands/{id}/execute
  • Real-time Output: WebSocket connection
  • History Management: GET /api/history
  • Configuration: GET /api/config/commands
  • Argument Validation: GET /api/commands/validate-args/{id}

Example API Usage

# Execute a command
curl -X POST http://localhost:3000/api/commands/ping-test/execute \
  -H "Content-Type: application/json" \
  -d '{"args": {"host": "google.com", "count": 4}}'

# Get execution history
curl http://localhost:3000/api/history?limit=10

🐳 Docker Deployment

# Build the image
docker build -t shellui .

# Run with configuration
docker run -d \
  --name shellui \
  -p 3000:3000 \
  -v /path/to/config.yaml:/app/config.yaml \
  -v /path/to/data:/app/data \
  shellui

πŸ§ͺ Development

Prerequisites

  • Node.js 18+ or Bun
  • Git

Setup Development Environment

# Clone repository
git clone https://github.com/your-username/shellui.git
cd shellui

# Install dependencies
bun install

# Start development servers
bun dev

Project Structure

shellui/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ client/          # React frontend
β”‚   └── server/          # Bun backend
β”œβ”€β”€ docs/               # Documentation
β”œβ”€β”€ config.example.yaml # Example configuration
└── package.json        # Root package.json

Available Scripts

# Development
bun dev                 # Start both client and server
bun dev:client          # Start client only
bun dev:server          # Start server only

# Building
bun build               # Build both client and server
bun build:client        # Build client only
bun build:server        # Build server only

# Testing
bun test                # Run all tests
bun test:client         # Run client tests
bun test:server         # Run server tests

# Linting
bun lint                # Lint all packages
bun lint:client         # Lint client
bun lint:server         # Lint server

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests for new functionality
  5. Run tests: bun test
  6. Commit your changes: git commit -m 'Add amazing feature'
  7. Push to the branch: git push origin feature/amazing-feature
  8. Open a Pull Request

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ†˜ Support

πŸ—ΊοΈ Roadmap

  • Kubernetes integration
  • Plugin system
  • Advanced scheduling
  • Multi-server management
  • Mobile app
  • Enterprise features
  • Advanced monitoring
  • Backup and restore
  • Multi-language support

πŸ™ Acknowledgments


ShellUI - Making shell commands accessible to everyone. πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages