Retool CLI
Build in your Agentic Coding Tool
This lab demonstrates the basics of Retool CLI, showing how you can create Retool Apps (Beta) applications inside your preferred Agentic Coding Tools (e.g., Claude Code, Cursor, Codex) locally. This approach allows you to leverage your existing workflow, validate what you build, and push/pull changes to Retool Server.
Lab Requirements
This lab requires that you set up a database and set up the Retool CLI.
Data Requirements
The lab uses a database defined in the lab React Compliance Dashboard. Specifically, a product listing stored in Retool Database. Please follow the instructions to install the electronic_products.csv.
CLI Setup
This lab leverages the setup instructions provided in Retool documentation.
- Create an empty directory and cd into the directory.
mkdir retool-electronic-product-via-cli
cd retool-electronic-product-via-cli
- Install the pnpm package
pnpm i -g @tryretool/cli
- Authenticate with Retool instance using:
retool auth login --host <your Retool org>
-
This will display interact with the specified Retool Server:

-
A browser will display a request to access your account. Select Authorize.

-
Install the Retool skill, inside your agentic coding tool, to inform it on how to construct a Retool app.
retool skill install

Build an application
Once your user is authenticated and authorized, you can switch back to the agentic coding tool.
- Enter the following command to initialize a project:
retool init

-
Claude Code will then scaffold an empty application.

-
Then run the following command to install the dependencies:
pnpm install
- Next, you can prompt the application we wish to create.
Create an application using Retool Database and the electronic_products table.
- Claude Code then proceeds and generates frontend/backend artifacts.
% ls -la
total 408
drwxr-xr-x 12 test staff 384 Sep 21 15:20 .
drwxr-xr-x 24 test staff 768 Sep 21 15:17 ..
drwxr-xr-x 13 test staff 416 Sep 21 15:27 .git
-rw-r--r-- 1 test staff 129 Sep 21 15:20 .npmrc
-rw-r--r-- 1 test staff 10948 Sep 21 15:20 .pnpmfile.cjs
drwxr-xr-x 5 test staff 160 Sep 21 15:28 .retool
drwxr-xr-x 6 test staff 192 Sep 21 15:25 backend
drwxr-xr-x 20 test staff 640 Sep 21 15:26 frontend
drwxr-xr-x 6 test staff 192 Sep 21 15:20 node_modules
-rw-r--r-- 1 test staff 22 Sep 21 15:20 package.json
-rw-r--r-- 1 test staff 181314 Sep 21 15:20 pnpm-lock.yaml
-rw-r--r-- 1 test staff 64 Sep 21 15:20 pnpm-workspace.yaml
Claude Code will request permission to perform a variety of activities. Review the request and then accept the request to allow it to continue.
Validate generated application
Let's validate what the agent built using the Retool CLI. This leverages the skill / Retool Server to confirm the app is compliant before you publish. The following command will check all changes as the agent makes them in your session.
retool start

Or you can do a one-time check:
retool check

Preview the application
Once you have validated the app, it is ready to preview the app by pushing to Retool. Use the following command to get a preview URL:
retool push --wait

- Copy the Preview URL and, in a new browser tab, examine the application.

Publish the application
Preview apps are not shared with other team members to view but are used by you to verify the app functionality. Once you have reviewed/confirmed the functionality, you can now publish so that other team members can access it:
retool publish --identifier electronic-products-demo

- A Live URL is now provided that you can review and share with the team.

Summary
This example demonstrates the use of the Retool CLI, authentication/authorization, the Retool skill file, and a sample invocation resulting in a preview app and the final published app. There are numerous commands that the CLI provides, including supporting protected apps, pulling in existing apps, and more. The full list is available here. Now you can pick and choose your preferred way to build Retool Apps as demonstrated in the following labs: