Skip to content

ratandeepbansal/terminal-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Bash Command Runner - Streamlit App

A Streamlit application that allows you to execute bash commands through a web interface with a terminal-like output display.

Features

  • 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

Installation

  1. Install the required dependencies:
pip install -r requirements.txt

Running the App

Execute the following command in your terminal:

streamlit run bash_runner.py

The app will open in your default web browser at http://localhost:8501

Usage

  1. Enter Commands: Type your bash commands in the text box on the left (one command per line)
  2. Execute: Click the "🚀 Run Commands" button
  3. View Output: See the results in the terminal view on the right

Example Commands

echo "Hello World"
ls -la
pwd
date
python --version
pip list

Features in Detail

Terminal Output Display

  • 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

Sidebar Options

  • 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

Safety Considerations

⚠️ Important: This app executes commands directly on your system. Be cautious with:

  • File modification commands
  • System configuration changes
  • Commands requiring elevated privileges
  • Network operations

Customization

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_style variable
  • Layout: Adjust column widths and container sizes
  • Text Area Height: Change the height parameter in st.text_area()

Troubleshooting

  • 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

License

This is a demonstration application. Use at your own risk.

About

run any command in terminal from your streamlit app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages