> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shell

> Learn how to use Shell to manage project files, install packages, and run scripts.

Shell lets you work on your projects, like a typical terminal, for managing files,
installing packages, and running scripts. For example, you can browse project files or
use `psql` when your project has a configured database connection.

<Tip>
  For better workflow management, prefer the **Run** button instead of running
  your app from the Shell. The workflow started by the **Run** button sends
  output to the Console tool, which provides a structured way to review the
  logs.
</Tip>

## Features

Shell provides the following capabilities:

* **Run multiple shells**: Open multiple shell instances to work on different tasks simultaneously
* **Search for text**: Find specific text in the shell output

## Usage

Open a project before using either method.

<Tabs>
  <Tab title="Tools & files">
    <Steps>
      <Step title="Open Tools & files">
        Select the **+** button in the tab bar. A **New tab** opens with the **Tools & files** menu.

        <Frame>
          <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-tools-and-files-menu.jpg?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=e9dbfdb59ce73367747d28d480c4d541" alt="New tab showing the Tools and files menu and Search tools field" width="1280" height="236" data-path="images/workspace/shell-tools-and-files-menu.jpg" />
        </Frame>
      </Step>

      <Step title="Find Shell">
        Enter `Shell` in **Search tools**.

        <Frame>
          <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-tools-and-files-search.jpg?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=72978c7b5e2a09515dec52b217aab5d2" alt="Tools and files search field containing Shell with the Shell result" width="1280" height="256" data-path="images/workspace/shell-tools-and-files-search.jpg" />
        </Frame>
      </Step>

      <Step title="Open Shell">
        Select <img class="icon-svg" src="https://mintcdn.com/replit/rJldsgYVucXB_6kW/images/icons/shell.svg?fit=max&auto=format&n=rJldsgYVucXB_6kW&q=85&s=7aa084a4960c955db47ee0531362886c" alt="Shell icon" width="16" height="16" data-path="images/icons/shell.svg" /> **Shell**. Shell opens in a new tab.

        <Frame>
          <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-open-tab.jpg?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=a81df0a85a84fd7283a827c40b8d318c" alt="Shell tab open with an active workspace prompt" width="1280" height="196" data-path="images/workspace/shell-open-tab.jpg" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Search">
    <Steps>
      <Step title="Open project Search">
        Select **Search** at the top of the app sidebar. If **Search** is hidden, expand the sidebar first.
      </Step>

      <Step title="Find Shell">
        Enter `Shell`.

        <Frame>
          <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-project-search.jpg?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=31a1a23dcfcb851d64cd084c43e80795" alt="Project Search showing Shell under Tools" width="1280" height="174" data-path="images/workspace/shell-project-search.jpg" />
        </Frame>
      </Step>

      <Step title="Open Shell">
        Select <img class="icon-svg" src="https://mintcdn.com/replit/rJldsgYVucXB_6kW/images/icons/shell.svg?fit=max&auto=format&n=rJldsgYVucXB_6kW&q=85&s=7aa084a4960c955db47ee0531362886c" alt="Shell icon" width="16" height="16" data-path="images/icons/shell.svg" /> **Shell**. Shell opens in a new tab.

        <Frame>
          <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-open-tab.jpg?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=a81df0a85a84fd7283a827c40b8d318c" alt="Shell tab open with an active workspace prompt" width="1280" height="196" data-path="images/workspace/shell-open-tab.jpg" />
        </Frame>
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Confirm Shell access

To confirm Shell is ready and view the current workspace, run:

```sh theme={null}
pwd
```

Shell prints the path to the current workspace.

<Frame caption="The pwd command prints the current workspace path and returns to the Shell prompt.">
  <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-pwd-output.jpg?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=f1a0ae54ec931eb4d42b8f043004747a" alt="Shell tab showing the pwd command, its workspace path output, and a returned prompt" width="1280" height="246" data-path="images/workspace/shell-pwd-output.jpg" />
</Frame>

For a project with a database, select **Tools** → **Database**, then open the
**Development database** page. This page provides connection controls. Keep
connection values private; do not copy them into documentation, screenshots,
logs, source files, or shared messages.

### Text search

The following steps describe how to access and use the text search tool:

1. Select the <img class="icon-svg" src="https://mintcdn.com/replit/X_IP1EeHGm0cA2VA/images/icons/workspace-search-icon.svg?fit=max&auto=format&n=X_IP1EeHGm0cA2VA&q=85&s=d3feed840da2d19e1ee4873d137114dc" alt="magnifying glass icon" width="16" height="16" data-path="images/icons/workspace-search-icon.svg" /> magnifying glass at the top right of the Shell tab to open the search dialog.
2. Enter a search term and select **Next** to navigate through the matches.
3. Use **Previous** to go back to prior matches.
4. Select **Exit** or click outside the dialog to exit the text search.

### Multiple shells

To create another shell:

1. Select the Shell instance menu in the Shell panel header.
2. Select **New Shell**.

<Frame>
  <img src="https://mintcdn.com/replit/gspzAm1mbsd1biBe/images/workspace/shell-new.png?fit=max&auto=format&n=gspzAm1mbsd1biBe&q=85&s=3c9d01cf27b611a8195ba61e4fa6ec63" alt="Shell instance menu with the current workspace and New Shell option" width="1280" height="224" data-path="images/workspace/shell-new.png" />
</Frame>

Use the same menu to switch between shells. Replit labels each shell with the last command executed to help you identify them.

<Warning>
  When you open more than one shell, Replit automatically closes idle shell
  instances. An idle shell is unselected and not running any user processes.
</Warning>

## Next steps

To learn more about related workspace tools, see the following resources:

* [Console](/features/workspace-tools/console/): Learn how to use Console to monitor your Replit App workflows.
