A Streamlit application that allows you to execute bash commands through a web interface with a terminal-like output display.
- Large Text Input Area: Write multiple bash commands (one per line)
- Execute Button: Run all commands with a single click
- Terminal View: See command outputs in a styled terminal-like interface
- Command History: View timestamps and exit codes for each command
- Progress Tracking: Visual progress bar during command execution
- Safety Features: 30-second timeout per command to prevent hanging
- Install the required dependencies:
pip install -r requirements.txtExecute the following command in your terminal:
streamlit run bash_runner.pyThe app will open in your default web browser at http://localhost:8501
- Enter Commands: Type your bash commands in the text box on the left (one command per line)
- Execute: Click the "🚀 Run Commands" button
- View Output: See the results in the terminal view on the right
echo "Hello World"
ls -la
pwd
date
python --version
pip list- Timestamps: Each command execution is timestamped
- Color Coding:
- Commands appear in cyan
- Errors appear in red
- Standard output in green
- Exit codes shown for failed commands
- Clear Terminal: Remove all command history
- Command Counter: Shows total commands executed
- Safety Notice: Important warnings about command execution
- Example Commands: Quick reference for common commands
- File modification commands
- System configuration changes
- Commands requiring elevated privileges
- Network operations
You can modify the following in the code:
- Timeout: Change the 30-second timeout in the
run_bash_command()function - Terminal Colors: Modify the CSS styles in the
terminal_stylevariable - Layout: Adjust column widths and container sizes
- Text Area Height: Change the
heightparameter inst.text_area()
- Commands not running: Ensure the command syntax is correct for your operating system
- Timeout errors: Complex commands may need the timeout value increased
- Permission errors: Some commands may require appropriate system permissions
This is a demonstration application. Use at your own risk.