ab7c760872
Created by Github action <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21493?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: github-actions <github-actions@twenty.com>
106 lines
3.8 KiB
Plaintext
106 lines
3.8 KiB
Plaintext
---
|
||
title: CLI
|
||
description: Fonksiyonları çalıştırmak, günlükleri akış olarak izlemek, uygulama kurulumlarını yönetmek ve uzaklar arasında geçiş yapmak için yarn twenty komutları.
|
||
icon: terminal
|
||
---
|
||
|
||
`dev`, `dev:build`, `dev:add` ve `dev:typecheck` dışında, `yarn twenty` CLI, fonksiyonları çalıştırma, günlükleri görüntüleme ve uygulama kurulumlarını yönetme komutları sağlar.
|
||
|
||
## Fonksiyonları çalıştırma (`yarn twenty dev:function:exec`)
|
||
|
||
Bir mantık fonksiyonunu HTTP, cron veya veritabanı olayıyla tetiklemeden manuel olarak çalıştırın:
|
||
|
||
```bash filename="Terminal"
|
||
# Execute by function name
|
||
yarn twenty dev:function:exec -n create-new-post-card
|
||
|
||
# Execute by universalIdentifier
|
||
yarn twenty dev:function:exec -u e56d363b-0bdc-4d8a-a393-6f0d1c75bdcf
|
||
|
||
# Pass a JSON payload
|
||
yarn twenty dev:function:exec -n create-new-post-card -p '{"name": "Hello"}'
|
||
|
||
# Execute the post-install function
|
||
yarn twenty dev:function:exec --postInstall
|
||
```
|
||
|
||
## Fonksiyon günlüklerini görüntüleme (`yarn twenty dev:function:logs`)
|
||
|
||
Uygulamanızın mantık fonksiyonlarının yürütme günlüklerini akış olarak alın:
|
||
|
||
```bash filename="Terminal"
|
||
# Stream all function logs
|
||
yarn twenty dev:function:logs
|
||
|
||
# Filter by function name
|
||
yarn twenty dev:function:logs -n create-new-post-card
|
||
|
||
# Filter by universalIdentifier
|
||
yarn twenty dev:function:logs -u e56d363b-0bdc-4d8a-a393-6f0d1c75bdcf
|
||
```
|
||
|
||
<Note>
|
||
Bu, Docker konteyner günlüklerini gösteren `yarn twenty docker:logs` komutundan farklıdır. `yarn twenty dev:function:logs`, uygulamanızın fonksiyon yürütme günlüklerini Twenty sunucusundan gösterir.
|
||
</Note>
|
||
|
||
## Tiplendirilmiş istemciyi oluşturma (`yarn twenty dev:generate-client`)
|
||
|
||
Bir uygulamayı oluşturup eşitlemeden, etkin uzak sunucunun şemasından tiplendirilmiş API istemcisini (`twenty-client-sdk`) yeniden oluşturun. Bunu, Twenty örneğinizle iletişim kuran — örneğin ayrı bir depoda bulunan bir arka uç hizmeti — herhangi bir projede tiplendirilmiş bir istemci edinmek için kullanın:
|
||
|
||
```bash filename="Terminal"
|
||
# In your project (no Twenty app definition required)
|
||
yarn add twenty-sdk twenty-client-sdk
|
||
|
||
# Connect to the Twenty instance to generate the client from
|
||
yarn twenty remote:add
|
||
|
||
# Generate the typed client into node_modules/twenty-client-sdk
|
||
yarn twenty dev:generate-client
|
||
```
|
||
|
||
Ardından istemciyi kodunuza içe aktarın:
|
||
|
||
```typescript
|
||
import { CoreApiClient } from 'twenty-client-sdk/core';
|
||
```
|
||
|
||
Oluşturulan türleri yenilemek için veri modeliniz her değiştiğinde komutu yeniden çalıştırın.
|
||
|
||
<Note>
|
||
İstemci `node_modules` içinde oluşturulur, bu nedenle kodunuzla birlikte commit edilmez. Her kurulumdan sonra (örneğin bir `postinstall` betiğinde veya CI içinde) `yarn twenty dev:generate-client` komutunu çalıştırın.
|
||
</Note>
|
||
|
||
## Bir uygulamayı kaldırma (`yarn twenty app:uninstall`)
|
||
|
||
Uygulamanızı etkin çalışma alanından kaldırın:
|
||
|
||
```bash filename="Terminal"
|
||
yarn twenty app:uninstall
|
||
|
||
# Skip the confirmation prompt
|
||
yarn twenty app:uninstall --yes
|
||
```
|
||
|
||
## Uzakları yönetme
|
||
|
||
Bir **uzak**, uygulamanızın bağlandığı Twenty sunucusudur. Kurulum sırasında iskelet oluşturucu sizin için otomatik olarak bir tane oluşturur. Dilediğiniz zaman daha fazla uzak ekleyebilir veya aralarında geçiş yapabilirsiniz.
|
||
|
||
```bash filename="Terminal"
|
||
# Add a new remote (opens a browser for OAuth login)
|
||
yarn twenty remote:add
|
||
|
||
# Connect to a local Twenty server (auto-detects port 2020 or 3000)
|
||
yarn twenty remote:add --local
|
||
|
||
# Add a remote non-interactively (useful for CI)
|
||
yarn twenty remote:add --url https://your-twenty-server.com --api-key $TWENTY_API_KEY --as my-remote
|
||
|
||
# List all configured remotes
|
||
yarn twenty remote:list
|
||
|
||
# Set the active remote
|
||
yarn twenty remote:use <name>
|
||
```
|
||
|
||
Kimlik bilgileriniz `~/.twenty/config.json` içinde saklanır.
|