## Add API client generation to SDK dev mode and refactor orchestrator into step-based pipeline ### Why The SDK dev mode lacked typed API client generation, forcing developers to work without auto-generated GraphQL types when building applications. Additionally, the orchestrator was a monolithic class that mixed watcher management, token handling, and sync logic — making it difficult to extend with new steps like client generation. ### How - **Refactored the orchestrator** into a step-based pipeline with dedicated classes: `CheckServer`, `EnsureValidTokens`, `ResolveApplication`, `BuildManifest`, `UploadFiles`, `GenerateApiClient`, `SyncApplication`, and `StartWatchers`. Each step has typed input/output/status, managed by a new `OrchestratorState` class. - **Added `GenerateApiClientOrchestratorStep`** that detects object/field schema changes and regenerates a typed GraphQL client (via `@genql/cli`) into `node_modules/twenty-sdk/generated` for seamless imports. - **Replaced `checkApplicationExist`** with `findOneApplication` on both server resolver and SDK API service, returning the entity data instead of a boolean. - **Added application token pair mutations** (`generateApplicationToken`, `renewApplicationToken`) to the API service, with the server now returning `ApplicationTokenPairDTO` containing both access and refresh tokens. - **Restructured the dev UI** into `dev/ui/components/` with dedicated panel, section, and event log components. - **Simplified `AppDevCommand`** from ~180 lines of watcher management down to ~40 lines that delegate entirely to the orchestrator.
Hello world
A minimal hello-world application built with an alpha version of the twenty-cli.
⚠️ Since this project uses an early alpha release, expect breaking changes and evolving features.
This example will gradually gain complexity and capabilities as the twenty-cli matures with future updates.
Requirements
- twenty-cli
npm install -g twenty-cli - an
apiKey. Go to/settings/api-webhooksto generate one
Install to your Twenty workspace
cp .env.example .env
- replace
<SET_YOUR_TWENTY_API_KEY>and<SET_YOUR_TWENTY_API_URL>accordingly
twenty auth login
twenty app sync
What it does
- creates a new object
postCardwith anamefield - creates a serverless function
create-new-post-card - two triggers on
create-new-post-card:- one route trigger on
GET/post-card/create?recipient=RecipientName - one databaseEvent trigger on
people.createdevents
- one route trigger on
Development
Run dev mode and see application updates on your workspace instantly
twenty app dev