Replit provides two command-line interfaces: Shell for interactive commands like installing packages, navigating files, and running scripts, and Console for viewing app output when you click Run. Open Shell from the Tools dock on the left sidebar, use standard Linux commands like ls, cd, npm, and pip, and open multiple Shell instances for parallel tasks. Console output is read-only and structured with metadata.
Master the Replit Terminal: Shell vs Console Explained
This tutorial walks you through everything you need to know about using the command line inside Replit. Whether you are installing packages, navigating your project files, running scripts, or debugging output, understanding the difference between Shell and Console is essential. This guide is aimed at beginners who are comfortable with basic coding but new to terminal-based workflows in a browser IDE.
Prerequisites
- A Replit account (free Starter plan works)
- An existing Repl or the ability to create a new one
- Basic familiarity with what a terminal or command line is
Step-by-step guide
Open the Shell from the Tools Dock
Open the Shell from the Tools Dock
In your Replit workspace, look at the left sidebar for the Tools dock. Click the Shell icon to open an interactive Linux terminal in a new pane. If you do not see it, click the search icon at the top of the sidebar and type Shell. The Shell pane appears inside your workspace and behaves like a standard Linux terminal. You can resize it by dragging the pane border, or float it into its own window using the three-dot menu in the tab header.
Expected result: A blinking cursor appears in the Shell pane, ready for commands.
Navigate your project files with basic commands
Navigate your project files with basic commands
Use standard Linux commands to explore your project. The ls command lists files and directories. Use cd to change directories and pwd to print your current location. These commands work exactly like any Linux system. Replit runs a full Linux environment under the hood via Nix, so most commands you know from local development work here too. Hidden files like .replit and replit.nix live in the project root and can be viewed with ls -a.
1ls -la2pwd3cd src4ls5cd ..Expected result: You see a full file listing including hidden files, your working directory path, and can move between directories.
Install packages using npm or pip
Install packages using npm or pip
The Shell is where you run package managers. For Node.js projects use npm install or pnpm install. For Python projects use pip install. Replit pre-installs common tools like npm, pip, pnpm, poetry, curl, wget, and git in the Shell environment. If a tool is missing, you can add it through the replit.nix file or the Dependencies GUI. After installing packages, they persist in your project storage until you reset the environment.
1# Node.js example2npm install axios34# Python example5pip install requests67# Check installed packages8npm list --depth=09pip listExpected result: The package installs successfully and appears in your node_modules folder or Python site-packages.
Run scripts and custom commands
Run scripts and custom commands
You can execute any script directly from Shell. Run Node.js files with node filename.js, Python files with python filename.py, or use npm run commands defined in your package.json. The Shell supports background processes using the ampersand operator, piping output with the pipe character, and redirecting output to files. This is useful for running build steps, database migrations, or test suites outside of the main Run button workflow.
1# Run a script directly2node index.js34# Run a package.json script5npm run build67# Run a Python script8python3 main.py910# Run a command in the background11node server.js &Expected result: Your script executes and output appears directly in the Shell pane.
Open multiple Shell instances for parallel work
Open multiple Shell instances for parallel work
Replit supports running several Shell tabs at once. Click the plus icon next to your existing Shell tab or open another Shell from the Tools dock. This lets you run a development server in one Shell while running tests or watching logs in another. Each Shell instance shares the same filesystem and environment variables but operates independently. You can split panes horizontally or vertically using the three-dot menu for a side-by-side layout.
Expected result: Multiple Shell tabs are open, each accepting independent commands.
Understand when to use Console instead of Shell
Understand when to use Console instead of Shell
The Console is different from Shell. It only shows output when you click the Run button at the top of the workspace. Console entries are structured with metadata including the command that ran, stdout and stderr content, duration, and exit status. You cannot type interactive commands into the Console. Only one Console instance exists per workspace. Client-side JavaScript logs from your browser preview appear in the Preview DevTools, not in Console. Use Console to monitor your running app and Shell for everything else.
Expected result: You understand that Console is output-only for the Run process, while Shell is your interactive command-line tool.
Use AI-generated commands in Shell
Use AI-generated commands in Shell
Replit includes an AI command helper inside Shell. Right-click inside the Shell pane and select Generate command from the context menu. Describe what you want to do in plain English and the AI suggests a terminal command you can review before executing. This is helpful when you know what you want to accomplish but are unsure of the exact syntax. For more complex workflow automation, teams working on production Replit projects can consult RapidDev for guidance on optimizing terminal-based build and deployment pipelines.
Expected result: The AI suggests a command in your Shell that you can accept or modify before execution.
Complete working example
1# .replit configuration file2# Controls how your Repl runs and deploys34entrypoint = "index.js"5run = ["node", "index.js"]6hidden = [".config", "package-lock.json"]78[nix]9channel = "stable-24_05"10packages = ["nodejs-20_x", "htop", "curl"]1112[[ports]]13localPort = 300014externalPort = 801516[deployment]17run = ["node", "index.js"]18build = ["npm", "run", "build"]19deploymentTarget = "cloudrun"2021# Environment variables for the run command22[run.env]23NODE_ENV = "development"2425# You can also run multiple processes:26# run = "node server.js & npm run watch-css & wait"Common mistakes when using the terminal in Replit
Why it's a problem: Trying to use sudo in the Shell
How to avoid: Replit does not support sudo. Install system packages through the replit.nix file or the Dependencies GUI instead.
Why it's a problem: Looking for client-side console.log output in Console
How to avoid: Browser JavaScript logs appear in the Preview pane DevTools, not in the workspace Console. Open DevTools in the preview panel to see them.
Why it's a problem: Expecting files created in Shell to persist across deployments
How to avoid: The deployment filesystem resets every time you publish. Store persistent data in a database or Replit Object Storage, not the filesystem.
Why it's a problem: Running npm install but getting command not found
How to avoid: Your Nix environment may not include Node.js. Add pkgs.nodejs-20_x to your replit.nix deps array and run exit in Shell to reload.
Best practices
- Use Shell for interactive commands and package management; use Console only to monitor Run output
- Always check the Resources panel when running multiple Shell instances to avoid out-of-memory errors
- Use ls -a to view hidden configuration files like .replit and replit.nix
- Press Escape before Tab to release keyboard focus from the editor when switching to Shell
- Add system-level tools through replit.nix rather than trying to install them via apt or brew
- Run kill 1 in Shell after adding new Secrets to reload environment variables without a full reboot
- Use the Run button for your primary app process and Shell for auxiliary tasks like tests and migrations
- To diagnose Nix environment failures, run cat /run/replit/env/error in Shell
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I am using Replit and need help with terminal commands. My project is a [Node.js/Python] app. How do I [install packages / run scripts / navigate files] using the Replit Shell? Please give me the exact commands to run.
Set up a Shell workflow for my project: install all dependencies, run the build step, and start the development server. Show me the commands I should run in order.
Frequently asked questions
Shell is an interactive Linux terminal where you type and execute commands like ls, npm install, or python script.py. Console is a read-only output pane that shows structured results only when you click the Run button. You cannot type interactive commands into Console.
No. Replit does not support sudo or root access. To install system-level packages, add them to the replit.nix file under the deps array and restart the Shell by typing exit.
Click the plus icon next to an existing Shell tab, or open additional Shell instances from the Tools dock on the left sidebar. Each instance runs independently but shares the same filesystem and environment.
Your Nix environment may not include the required runtime. Open replit.nix and add pkgs.nodejs-20_x for Node.js or pkgs.python310 for Python to the deps array. Then type exit in Shell to reload the environment.
No. The deployment filesystem resets every time you publish. Files created during a Shell session exist only in the development workspace. Use a database or Replit Object Storage for persistent data.
After adding a secret in the Secrets tool, run kill 1 in Shell to restart the environment. Then access the variable with echo $MY_SECRET. Without the restart, new secrets may not be available in the current Shell session.
Yes. RapidDev provides expert assistance for Replit projects including build automation, deployment pipelines, and debugging terminal-related issues. Their team can help optimize your workflow when Shell commands and configurations become complex.
Yes. Right-click inside the Shell pane and select Generate command. Describe what you want in plain English, and Replit AI suggests a command you can review and execute. You can also ask Replit Assistant for help with specific command syntax.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation