Files
twenty/packages/twenty-cli/README.md
T
2a44bde848 Dynamic grql api wrapper on application sync (#15791)
# Introduction

Important note: for the moment testing this locally will require some
hack due to latest twenty-sdk not being published.
You will need to build twenty-cli and `cd packages/twenty-cli && yarn
link`
To finally sync the app in your app folder as `cd app-folder && twenty
app sync`

close https://github.com/twentyhq/core-team-issues/issues/1863

In this PR is introduced the generate sdk programmatic call to
[genql](https://genql.dev/) exposed in a `client` barrel of `twenty-sdk`
located in this package as there's high chances that will add a codegen
layer above it at some point ?

The cli calls this method after a sync application and writes a client
in a generated folder. It will make a graql introspection query on the
whole workspace. We should later improve that and only filter by current
applicationId and its dependencies ( when twenty-standard application is
introduced )

Fully typesafe ( input, output, filters etc ) auto-completed client

## Hello-world app serverless refactor

<img width="2480" height="1326" alt="image"
src="https://github.com/user-attachments/assets/b18ea372-b21d-4560-8fbc-1dc348427a95"
/>

---------

Co-authored-by: martmull <martmull@hotmail.fr>
2025-11-17 14:46:59 +01:00

87 lines
2.0 KiB
Markdown

# Why Twenty CLI?
A command-line interface to easily scaffold, develop, and publish applications that extend Twenty CRM
## Installation
```bash
npm install -g twenty-cli
```
## Requirements
- yarn >= 4.9.2
- an `apiKey`. Go to `https://twenty.com/settings/api-webhooks` to generate one
## Quick example project
```bash
# Authenticate using your apiKey (CLI will prompt for your <apiKey>)
twenty auth login
# Init a new application called hello-world
twenty app init hello-world
# Go to your app
cd hello-world
# Add a serverless function to your application
twenty app add serverlessFunction
# Add a trigger to your serverless function
twenty app add trigger
# Add axios to your application
yarn add axios
# Start dev mode: automatically syncs changes to your Twenty workspace, so you can test new functions/objects instantly.
twenty app dev
# Or use one time sync (also generates SDK automatically)
twenty app sync
# List all available commands
twenty help
```
## Application Structure
Each application in this package follows the standard application structure:
```
app-name/
├── package.json
├── README.md
├── serverlessFunctions # Custom backend logic (runs on demand)
└── ...
```
## Publish your application
Applications are currently stored in twenty/packages/twenty-apps.
You can share your application with all twenty users.
```bash
# pull twenty project
git clone https://github.com/twentyhq/twenty.git
cd twenty
# create a new branch
git checkout -b feature/my-awesome-app
```
- copy your app folder into twenty/packages/twenty-apps
- commit your changes and open a pull request on https://github.com/twentyhq/twenty
```bash
git commit -m "Add new application"
git push
```
Our team reviews contributions for quality, security, and reusability before merging.
## Contributing
- see our [Hacktoberfest 2025 notion page](https://twentycrm.notion.site/Hacktoberfest-27711d8417038037a149d4638a9cc510)
- our [Discord](https://discord.gg/cx5n4Jzs57)