Skip to main content

Configuring a Repl

Every Repl comes with two configuration files .replit and replit.nix. The .replit file controls multiple aspects of your Repl's behavior including the run command, LSP (Language Server Protocol), whether your Repl is a Workspace Extension, and more.

This page will cover configuring the .replit file, which follows the toml configuration format. To view this file, click on the three-dot menu on the file tree and select Show hidden files.


Gets executed when the Run button is clicked.

This command has lower precedence than [interpreter] > command, meaning [interpreter] > command will override run.

run = "node index.js"


The command that executes when your Repl boots up.

onBoot = "npm install"


Runs directly before the run command. Used for compiled languages like C, C++, Java, etc.


During a GitHub import, this tells the workspace which language should be used when creating the Repl.

language = "javascript"


The name of the main file including the extension. This is the file that will be run, and shown by default when opening the editor.

entrypoint = "index.js"


A list of files or folders to hide by default in the side filetree. These filepaths are still accessible through clicking the three dot menu in the file tree, and selecting Show hidden files.

hidden = [".config", "package-lock.json", "*.zip", "**/*.svg"]


Enables system-wide audio for the Repl when configured to true.

audio = true


Specifies whether LSP (Language Server Protocol) should be enabled for the following specified languages.

[languages.<language name>]

Pre-language configuration. The language name has no special meaning other than to allow multiple languages to be configured at once.


Type: string

A glob used to identify which files belong to the specified language configuration.


pattern = "**/{*.js,*.jsx,*.ts,*.tsx,*.json}"

[languages.<language name>.languageServer]

Configuration for setting up LSP for the specified language. This allows for code intelligence (autocomplete, underlined errors, etc).


The command used to start the LSP server for the specified language.


pattern = "**/{*.js,*.jsx,*.ts,*.tsx,*.json}"

start = "typescript-language-server --stdio"


Set hints to display in the console/shell alongside your output. You can have any number of hints in a Repl.

Each hint is required to consist of a regex and a message. The regex is a regular expression that searches through your output. If a match is found, the message is printed logged to the console/shell.

regex = "ERROR"
message = "Something went wrong."

regex = "exit status [12]"
message = "Bad exit code, an error occurred."


Specifies the Nix channel your Repl will use.


A nix channel ID.

channel = "stable-22_11"


Type: {localPort, externalPort}

Allows you to configure which HTTP port to expose for your web output. By default, any exposed HTTP port with host will be exposed as your Repl's web output.

Extra ports can be served without overriding the default port by adding a new [[ports]] entry to your .replit file. You are required to specify both a localPort and externalPort entry. You can add multiple extra ports by adding multiple [[ports]] entries to your .replit file as defined below.

Supported ports

A repl can expose 8099 and 9000 as extra externalPorts.


Determines which port should be run in the background without overriding your Repl's web output.


Determines which port should be exposed as your Repl's web output.

localPort = 3000
externalPort = 8099


Specifies whether a Repl is a Workspace Extension.


Should be set to true in an extension Repl. This makes the Extension Devtools accessible and optimizes the workspace for developing extensions.

isExtension = true


Determines if a Repl is attached to a specific extension. If unset, publishing your Extension creates a new extension and automatically fills extensionID for you.

extensionID = "492a5fcd-f090-4356-ace8-50755e8deb2b"


This command is run to bundle your extension into a static directory (specified by outputDirectory below), which is then uploaded to Replit as an Extension.

buildCommand = "npm run build"


The path to the static directory that should be used to render the Extension. This path is relative to your Repl's root directory.

outputDirectory = "./dist"


A key-value object of environment variables. For sensitive environment variables, use Secrets instead

VIRTUAL_ENV = "/home/runner/${REPL_SLUG}/venv"


If set, enables unit testing for the Repl.


The language for unit tests. Unit testing is only available for java, python, and nodejs.

langhage = "nodejs"


Specifies the interpreter, which should be a compliant prybar binary.


Starts the interpreter. Overrides the run command if set.

command = [
"\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ",


A list of bytes used to detect running state, if unspecified it defaults to [0xEE, 0xA7].

prompt = [0xEE, 0xA7]


If set, enables package management with the Packager .


If set, is executed after a new package is installed via the Packager.

afterInstall = "echo 'package installed'"


A list of paths to ignore while attempting to guess packages.

ignoredPaths = [".git"]


A list of modules to never attempt to guess a package for, when installing packages.

ignoredPackages = ["twitter", "discord"]


Specifies the language to use for package operations. See available languages in the Universal Package Manager repository.

language = "python"


UPM features that are supported by the specified languages.


When set to true, enables support for the Packager.

language = "python3"

packageSearch = true


When set to true, UPM will attempt to guess which packages need to be installed prior to running the Repl.

language = "python3"

guessImports = true


Sets whether hosting the Repl requires running a package installation operation.

language = "python3"

enabledForHosting = false



The command that executes when a Deployment container starts.

run = "npm start"


The command that executes before running a Deployment.

build = "npm run build"


If true, we won't check if a Repl has opened a port in order to deem a deployment as successful.

ignorePorts = true