aigmixer's picture
Update app.py
cd1c689
raw
history blame
509 Bytes
import gradio as gr
import subprocess
def run_command(command):
try:
# Running the command and capturing the output
result = subprocess.run(command, shell=True, text=True, capture_output=True, check=True)
return result.stdout
except subprocess.CalledProcessError as e:
return e.stderr
iface = gr.Interface(
fn=run_command,
inputs='text',
outputs='text',
title="CLI Interface",
description="Enter your command and see the output."
)
iface.launch()