Skip to main content
The twenty CLI connects to Upshift workspaces from your terminal. Use it to inspect metadata, read records, send API requests, and create, sync and debug apps. It needs Node.js 24.5 or later.

Running the CLI

Run any command through npx, without installing anything:
Or install it once globally and call twenty directly:
Inside an app project, use npx twenty@latest, not npx twenty. Apps depend on twenty-sdk, which still ships an older twenty binary, and npx twenty runs that local binary instead of this CLI.
The examples below use twenty. Prefix them with npx twenty@latest if you did not install it globally. Run twenty commands for the full command list and twenty <command> --help for the options of one command. Every command that talks to a workspace accepts --remote <name> to target a saved connection other than the default one, and --json for structured output.

Connecting to a workspace

Sign in with your browser. --use makes this connection the default one:
Use your workspace’s address, or the server’s address for a local setup: http://localhost:2020 for the local Docker server, http://localhost:3000 for a source checkout. You can copy the exact command from Settings > Developers > CLI. Browser sign-in needs Upshift 2.42 or later. Keep several connections by naming them:
In CI or scripts, pipe an API key instead of signing in with the browser:
You can also set TWENTY_API_URL and TWENTY_API_KEY for a single run without saving anything. Saved connections live in ~/.twenty/config.json.

Exploring your data

Object names are exact API names, singular or plural (company or companies). Raw API writes run without a confirmation step, and your permissions in the workspace still apply.

Building an app

  • app init writes a new project from the template. It does not install dependencies or contact a workspace.
  • app apply --create builds the app, registers it in the workspace, installs it and syncs its metadata.
  • app dev watches your source and syncs every successful build.
Other app commands: Definitions missing from your source are deleted from the workspace by default. Pass --no-delete to keep them. Deleting objects or fields also deletes their data, so it requires confirmation. See Syncing & recovery for details.

Executing functions

Run a deployed logic function without triggering it through a route, a cron or a database event. Sync your local changes with app apply or app dev first.
Executing functions requires a browser sign-in. API keys cannot execute them.

Watching function logs

Stream the output of your app’s logic functions as executions finish:
It only shows new executions, not past ones.

Uninstalling an app

This runs the app’s uninstall hook and deletes everything it owns, including its objects, fields and their data. The app stays registered, so twenty app apply can install it again.

Diagnosing problems

doctor checks your Node version, which twenty binary is on your PATH, your saved connections and the app SDK, then reports what to fix.

Full reference

The command reference covers every flag, permission, output format and exit code.