Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Retool CLI

The Retool CLI enables you to build, manage, and publish Retool-native React apps from the command line and with the help of your chosen code development agent harness, like Claude Code or Codex.

With this tool, you can write app code directly to your machine and check that it is valid Retool code. You can use the CLI independently, or pair it with a local development agent. Retool recommends using the CLI in combination with Source Control to manage contributors and app versions. For more information about how the Retool CLI works, refer to the concepts section.

note

Because code is written and validated locally, Retool CLI commands do not incur AI credit spend.

Prerequisites

Before you install the Retool CLI, you need:

  • Edit permissions to create and build apps.
  • pnpm as a package manager.
  • A terminal or agentic development environment that has access to a bash tool.

Install the Retool CLI

The steps for installing the Retool CLI vary based on your preferred development environment.

note

Retool recommends pairing the CLI with the use of an agent harness. Retool provides a skill file that teaches the agent how to shape a Retool app.

Use the following instructions to install the Retool CLI on an Anthropic tool.

Claude Code

In a Claude Code session, complete the following steps:

  1. Install the CLI launcher: pnpm i -g @tryretool/cli.
  2. Authenticate with your Retool instance: retool auth login --host <example.retool.com>.
  3. Install the skill that teaches your coding agent how to shape a Retool app: retool skill install.

Refer to the Claude documentation for more information about installing plugins.

Claude Cowork

To install the Retool CLI for use in Claude Cowork, complete the following steps:

  1. Navigate to the latest release of the tryretool/agent-plugins repository. Click retool-claude-plugin.zip to download a zip file of the plugin.
  2. Navigate to Claude in the desktop app or browser.
  3. In the sidebar, click Customize, then Plugins.
  4. Click Add, and select Upload plugin from the dropdown.
  5. Upload the zip file that you downloaded in the first step.
  6. Open a new chat, and ask Claude to help you authenticate and set up the Retool CLI.
    Help me set up the Retool CLI plugin. Connect to <example.retool.com>.

Refer to the Claude documentation for more information about installing plugins.

The Retool CLI inherits the same permissions as the authenticated user. For example, if you do not have Edit permissions for an app, you cannot edit that app using the Retool CLI.

Build apps

Use the following recommended flow to create Retool apps.

  1. Start building a React app:
    • retool init creates a new app and scaffolds it locally. It needs an empty directory that is not already inside a git repository. Pass --force to override either check.
    • retool clone pulls an existing app to your local machine.
  2. Install dependencies from the root of the local app: pnpm install. Both init and clone print this as their next step, and validation fails without it.
  3. Validate Retool code.
    • retool start begins a validation loop that checks your code as you (or an agent) write it.
    • retool check performs a one-time check on the validity of your code.
  4. Send the app back to Retool with retool push, which starts a preview build. Add --wait to block until the build finishes and print the preview URL, or fetch it later with retool preview --wait.
  5. Publish your app with retool publish, which enforces permissions and requires function approvals.

Working on branches

If the app's branch is updated on the server, such as when someone edits it in Retool or an agent thread pushes to it, run retool pull to bring your local app back in sync before you keep working.

To move your local work onto a different branch of the same app, such as one someone else created in the app builder, run retool checkout <branch>. The CLI refuses to switch if doing so would overwrite uncommitted local files, or if your local target branch holds commits the server doesn't have.