Work in Progress
pip install git+https://github.com/takahc/streamlit-terminalYou can embed a basic terminal in the app as follows:
from streamlit_terminal import st_terminal
st_terminal(key="terminal1")In this example, the terminal will load with the command echo 'Hello, World!' pre-filled. The user can click the Run button to execute it.
from streamlit_terminal import st_terminal
st_terminal(key="terminal2", command="echo 'Hello, World!'")You can also set up multiple terminals, each with different commands and configurations:
import streamlit as st
from streamlit_terminal import st_terminal
# Set wide mode
st.set_page_config(layout="wide")
st.markdown("# Streamlit Terminal")
# Example 1: Basic Usage
st.markdown("## Example 1: Basic Usage")
st_terminal(key="terminal1")
# Example 2: Custom Command
st.markdown("## Example 2: Custom Command")
st_terminal(key="terminal2", command="echo 'Hello World'")
# Example 3: Custom Command with adjustable height
st.markdown("## Example 3: Custom Command with height")
st_terminal(key="terminal3", command="python -u test/clock.py", height=600)-
Clone the repository: Download the
streamlit-terminalrepository to your local machine.git clone https://github.com/akipg/streamlit-terminal.git
-
Navigate to the project directory: Change into the project’s main directory.
cd streamlit-terminal -
Install the required dependencies: Install Streamlit to run the application.
pip install streamlit
-
Modify the
__init__.pyfile: Set_RELEASE = Falseinstreamlit_terminal/__init__.pyfor development mode._RELEASE = False
-
Run the application: Start the Streamlit app.
streamlit run app.py
To set up the development environment for the frontend:
-
Navigate to the frontend directory: Move into the frontend Vue.js project directory.
cd streamlit_terminal/frontend-vue -
Install dependencies: Install all required Node.js dependencies using
pnpm.pnpm i
-
Start the development server: Run the frontend development server with hot-reload enabled.
pnpm run dev
