close
Skip to content

Sidecar Replit Setup

If you're building on Replit, you can quickly set up the sidecar in your environment by pasting the setup prompt below.

Before starting the Replit Agent, make sure the Agent is set to "Build" (not "Plan") and the application type is NOT set to "Automation":

Replit Agent Settings

Then paste this prompt into the Replit Agent:

Set up the Lexe Sidecar for my Replit project:

1. Read the Lexe Sidecar SDK quickstart for reference:
   https://docs.lexe.tech/sidecar/quickstart/

2. Install the `unzip` system dependency using the Replit tool.
   (This is required for the install script below.)

3. Install the `lexe-sidecar` binary.
   $ curl -fsSL https://lexe.app/install-sidecar.sh | sh

4. Prompt me for my `LEXE_CLIENT_CREDENTIALS` value and configure it as a Replit secret.

5. Ask me to update the `.replit` file to run the sidecar, then confirm it has been configured correctly before proceeding.
   When showing me what to change, provide the exact old and new TOML blocks so I can copy-paste without needing to understand TOML syntax.
   Make these TWO changes:

   A. Add a new "Lexe Sidecar" workflow that runs in parallel with the app.
      Add this workflow definition (do NOT add waitForPort - it causes timeouts):
      ```
      [[workflows.workflow]]
      name = "Lexe Sidecar"
      author = "agent"
      mode = "sequential"

      [[workflows.workflow.tasks]]
      task = "shell.exec"
      args = "./.local/bin/lexe-sidecar"
      ```

      Then add a task to run this workflow in parallel with the main app workflow:
      ```
      [[workflows.workflow.tasks]]
      task = "workflow.run"
      args = "Lexe Sidecar"
      ```

   B. Update the `[deployment]` section's `run` array to prepend the sidecar.
      Wrap the command in a shell invocation.
      For example, change:
      `run = ["npm", "run", "server:prod"]`
      to:
      `run = ["sh", "-c", "./.local/bin/lexe-sidecar & npm run server:prod"]`

6. Restart the workflow using the `restart_workflow` tool, then wait a few seconds for it to restart.

7. Confirm sidecar is up and running.
   - Check the health endpoint: curl http://localhost:5393/v2/health
   - Test the credentials config: curl http://localhost:5393/v2/node/node_info

The sidecar will now run automatically alongside the application at http://localhost:5393.

Once we've confirmed that the sidecar runs smoothly with client credentials configured correctly, return to me and we'll begin working on our app. Don't stop until we've confirmed that the node-info endpoint works correctly.

The Replit Agent will configure everything, prompt you for your credentials, and verify the setup is working.

Manual Setup

If you prefer to configure manually:

  1. Install lexe-sidecar: curl -fsSL https://lexe.app/install-sidecar.sh | sh
  2. Configure your LEXE_CLIENT_CREDENTIALS as a Replit secret
  3. Update .replit to add a "Lexe Sidecar" workflow that runs ./.local/bin/lexe-sidecar in parallel with your app
  4. Update the [deployment] section's run to prepend ./.local/bin/lexe-sidecar &
  5. Restart the workflow

The sidecar will now run automatically alongside your application at http://localhost:5393.