$ streamlit init
This command creates the files for a new Streamlit app.
Syntax
streamlit init <directory>
Arguments
<directory>
(Optional): The directory location of the new project. If no directory is provided, the current working directory will be used.
Examples
Example 1: Create project files the current working directory
-
In your current working directory (CWD), execute the following:
streamlit init
Streamlit creates the following files:
CWD/ βββ requirements.txt βββ streamlit_app.py
-
In your terminal, Streamlit prompts,
β Run the app now? [Y/n]
. EnterY
for yes.This is equivalent to executing
streamlit run streamlit_app.py
from your current working directory. -
Begin editing your
streamlit_app.py
file and save your changes.
Example 2: Create project files in another directory
-
In your current working directory (CWD), execute the following:
streamlit init project
Streamlit creates the following files:
CWD/ βββ project/ βββ requirements.txt βββ streamlit_app.py
-
In your terminal, Streamlit prompts,
β Run the app now? [Y/n]
. EnterY
for yes.This is equivalent to executing
streamlit run project/streamlit_app.py
from your current working directory. -
Begin editing your
streamlit_app.py
file and save your changes.
Still have questions?
Our forums are full of helpful information and Streamlit experts.