Edit your app

You can edit your app from any development environment of your choice. Community Cloud will monitor your repository and automatically copy any file changes you commit. You will immediately see commits reflected in your deployed app for most changes (such as edits to your app's Python files).

Community Cloud also makes it easy to skip the work of setting up a development environment. With a few simple clicks, you can configure a development environment using GitHub Codespaces.

Spin up a cloud-based development environment for your deployed app in minutes. You can run your app within your codespace to enjoy experimenting in a safe, sandboxed environment. When you are done editing your code, you can commit your changes to your repo or just leave them in your codespace to return to later.

  1. From your workspace at share.streamlit.io, click the overflow icon (more_vert) next to your app. Click "Edit."

    Edit your app with GitHub Codespaces
  2. A .devcontainer/devcontainer.json file will be added to your repository. If you already have a file of the same name in your repository, it will not be changed. You may delete or rename your existing devcontainer configuration if you would like your repository to receive the instance created by Streamlit Community Cloud.

    Adding a devcontainer file to your repository
  3. Click "Create codespace" to confirm the creation of a codespace on your account. Read more about GitHub Codespaces to learn about monthly limits for free use and paid plans.

    Create your GitHub Codespace
  4. Wait for GitHub to set up your codespace.

    GitHub preparing your codespace
  5. GitHub will automatically execute the commands to launch your Streamlit app within your codespace. Your app will be visible in a "Simple Browser" on the right. This may take a minute to complete from when your codespace first appears on screen.

    Your new GitHub Codespace
  6. When you make changes to your app, the file is automatically saved within your codespace. Your edits do not affect your repository unless you choose to commit those changes. We will describe committing your changes in a later step.

    In order to see updates automatically reflected on the right, click "Always rerun" when prompted after an edit.

    Edit the title of your sample Streamlit app
    Select "Always rerun" to automatically see edits in your running app
  7. See your edits appear within the "Simple Browser" tab and keep going with more!

    See the results of your edit to your Streamlit app

After making edits to your app, you can choose to commit your edits to your repository to update your deployed app instantly. If you just want to keep your edits in your codespace to return to later, skip to Stop or delete your codespace.

  1. In the left navigation bar, click the source control icon.

    Click on the source control icon
  2. Fill out your desired commit message and click "Commit."

    Commit your changes
  3. Click "Yes" to stage and commit all your changes. To learn more about source control in GitHub Codespaces, check out Source control in GitHub Docs.

Confirm to stage all changes and commit

When you are done, remember to stop your codespace on GitHub to avoid any undesired use of your capacity.

  1. Go to github.com/codespaces. At the bottom of the page, all your codespaces are listed. Click the overflow menu icon (more_horiz) for your codespace.
Stop or delete your GitHub Codespace
  1. Click "Stop codespace" if you'd like to return to your work later. Otherwise, click "Delete."

    Stop your GitHub codespace
    Delete your GitHub codespace
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.