twenty-sdk 0.2.3 → 0.3.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +125 -39
  2. package/dist/ObjectRecordGroupByDateGranularity-CtpRADP1-Bft-VMSh.mjs +3151 -0
  3. package/dist/ObjectRecordGroupByDateGranularity-CtpRADP1-Duv5iOeZ.js +20 -0
  4. package/dist/application/define-app.d.ts +18 -0
  5. package/dist/application/functions/define-function.d.ts +28 -0
  6. package/dist/application/functions/function-config.d.ts +2 -0
  7. package/dist/application/functions/triggers/cron-payload-type.d.ts +1 -1
  8. package/dist/application/index.d.ts +5 -1
  9. package/dist/application/objects/define-object.d.ts +35 -0
  10. package/dist/application/roles/define-role.d.ts +26 -0
  11. package/dist/cli/commands/app-add.command.d.ts +2 -1
  12. package/dist/cli/utils/config-loader.d.ts +43 -0
  13. package/dist/cli/utils/display-entity-summary.d.ts +2 -0
  14. package/dist/cli/utils/display-errors.d.ts +2 -0
  15. package/dist/cli/utils/display-warnings.d.ts +2 -0
  16. package/dist/cli/utils/get-new-object-file-content.d.ts +9 -0
  17. package/dist/cli/utils/get-role-base-file.d.ts +4 -0
  18. package/dist/cli/utils/load-manifest.d.ts +37 -6
  19. package/dist/cli/utils/validate-manifest.d.ts +22 -0
  20. package/dist/cli.cjs +133 -79
  21. package/dist/cli.mjs +3318 -3163
  22. package/dist/index.cjs +2 -21
  23. package/dist/index.mjs +237 -3283
  24. package/dist/vendor/twenty-shared/ObjectRecordGroupByDateGranularity-BwpmSE4s.js +1 -0
  25. package/dist/vendor/twenty-shared/{FieldMetadataDefaultValue-CJU0Y2Fi.mjs → ObjectRecordGroupByDateGranularity-CtpRADP1.mjs} +219 -217
  26. package/dist/vendor/twenty-shared/RatingValues-B_wgYyso.js +1 -0
  27. package/dist/vendor/twenty-shared/{RatingValues-4GPp8aN_.mjs → RatingValues-DNSj7xKA.mjs} +63 -5
  28. package/dist/vendor/twenty-shared/application/fieldManifestType.d.ts +1 -0
  29. package/dist/vendor/twenty-shared/application/fieldManifestType.d.ts.map +1 -1
  30. package/dist/vendor/twenty-shared/application/index.d.ts +1 -1
  31. package/dist/vendor/twenty-shared/application/index.d.ts.map +1 -1
  32. package/dist/vendor/twenty-shared/application/objectManifestType.d.ts +1 -1
  33. package/dist/vendor/twenty-shared/application/objectManifestType.d.ts.map +1 -1
  34. package/dist/vendor/twenty-shared/application/roleManifestType.d.ts +0 -1
  35. package/dist/vendor/twenty-shared/application/roleManifestType.d.ts.map +1 -1
  36. package/dist/vendor/twenty-shared/application/serverlessFunctionManifestType.d.ts +12 -1
  37. package/dist/vendor/twenty-shared/application/serverlessFunctionManifestType.d.ts.map +1 -1
  38. package/dist/vendor/twenty-shared/constants/GroupByDateGranularityThatRequireTimeZone.d.ts +4 -0
  39. package/dist/vendor/twenty-shared/constants/GroupByDateGranularityThatRequireTimeZone.d.ts.map +1 -0
  40. package/dist/vendor/twenty-shared/constants/ViewGroupVisibleOptionsMax.d.ts +2 -0
  41. package/dist/vendor/twenty-shared/constants/ViewGroupVisibleOptionsMax.d.ts.map +1 -0
  42. package/dist/vendor/twenty-shared/constants/index.d.ts +2 -0
  43. package/dist/vendor/twenty-shared/constants/index.d.ts.map +1 -1
  44. package/dist/vendor/twenty-shared/constants.cjs +1 -1
  45. package/dist/vendor/twenty-shared/constants.mjs +34 -33
  46. package/dist/vendor/twenty-shared/index.cjs +1 -1
  47. package/dist/vendor/twenty-shared/index.d.ts +0 -1
  48. package/dist/vendor/twenty-shared/index.d.ts.map +1 -1
  49. package/dist/vendor/twenty-shared/index.mjs +2 -5
  50. package/dist/vendor/twenty-shared/isValidCountryCode-DKpNbkXA.mjs +8533 -0
  51. package/dist/vendor/twenty-shared/isValidCountryCode-DgPRUhSL.js +4 -0
  52. package/dist/vendor/twenty-shared/metadata/MetadataValidationError.d.ts +2 -2
  53. package/dist/vendor/twenty-shared/metadata/MetadataValidationError.d.ts.map +1 -1
  54. package/dist/vendor/twenty-shared/metadata/all-metadata-name.constant.d.ts +4 -0
  55. package/dist/vendor/twenty-shared/metadata/all-metadata-name.constant.d.ts.map +1 -1
  56. package/dist/vendor/twenty-shared/metadata.cjs +1 -1
  57. package/dist/vendor/twenty-shared/metadata.mjs +12 -8
  58. package/dist/vendor/twenty-shared/types/ArraySortDirection.d.ts +2 -0
  59. package/dist/vendor/twenty-shared/types/ArraySortDirection.d.ts.map +1 -0
  60. package/dist/vendor/twenty-shared/types/CrudOperationType.d.ts +8 -0
  61. package/dist/vendor/twenty-shared/types/CrudOperationType.d.ts.map +1 -0
  62. package/dist/vendor/twenty-shared/types/ExtractPropertiesThatEndsWithIds.d.ts +4 -0
  63. package/dist/vendor/twenty-shared/types/ExtractPropertiesThatEndsWithIds.d.ts.map +1 -0
  64. package/dist/vendor/twenty-shared/types/RecordFilterValueDependencies.d.ts +1 -0
  65. package/dist/vendor/twenty-shared/types/RecordFilterValueDependencies.d.ts.map +1 -1
  66. package/dist/vendor/twenty-shared/types/SettingsPath.d.ts +3 -1
  67. package/dist/vendor/twenty-shared/types/SettingsPath.d.ts.map +1 -1
  68. package/dist/vendor/twenty-shared/types/ViewFilterOperand.d.ts +1 -1
  69. package/dist/vendor/twenty-shared/types/ViewFilterOperand.d.ts.map +1 -1
  70. package/dist/vendor/twenty-shared/types/index.d.ts +3 -0
  71. package/dist/vendor/twenty-shared/types/index.d.ts.map +1 -1
  72. package/dist/vendor/twenty-shared/types.cjs +1 -1
  73. package/dist/vendor/twenty-shared/types.mjs +60 -59
  74. package/dist/vendor/twenty-shared/utils/array/{upsertIntoArrayOfObjectComparingId.d.ts → upsertIntoArrayOfObjectsComparingId.d.ts} +1 -1
  75. package/dist/vendor/twenty-shared/utils/array/upsertIntoArrayOfObjectsComparingId.d.ts.map +1 -0
  76. package/dist/vendor/twenty-shared/utils/array/upsertPropertiesOfItemIntoArrayOfObjectsComparingId.d.ts +6 -0
  77. package/dist/vendor/twenty-shared/utils/array/upsertPropertiesOfItemIntoArrayOfObjectsComparingId.d.ts.map +1 -0
  78. package/dist/vendor/twenty-shared/utils/date/isPlainDateAfter.d.ts +4 -0
  79. package/dist/vendor/twenty-shared/utils/date/isPlainDateAfter.d.ts.map +1 -0
  80. package/dist/vendor/twenty-shared/utils/date/isPlainDateBefore.d.ts +4 -0
  81. package/dist/vendor/twenty-shared/utils/date/isPlainDateBefore.d.ts.map +1 -0
  82. package/dist/vendor/twenty-shared/utils/date/isPlainDateBeforeOrEqual.d.ts +4 -0
  83. package/dist/vendor/twenty-shared/utils/date/isPlainDateBeforeOrEqual.d.ts.map +1 -0
  84. package/dist/vendor/twenty-shared/utils/date/isPlainDateInSameMonth.d.ts +4 -0
  85. package/dist/vendor/twenty-shared/utils/date/isPlainDateInSameMonth.d.ts.map +1 -0
  86. package/dist/vendor/twenty-shared/utils/date/isPlainDateInWeekend.d.ts +4 -0
  87. package/dist/vendor/twenty-shared/utils/date/isPlainDateInWeekend.d.ts.map +1 -0
  88. package/dist/vendor/twenty-shared/utils/date/isSamePlainDate.d.ts +4 -0
  89. package/dist/vendor/twenty-shared/utils/date/isSamePlainDate.d.ts.map +1 -0
  90. package/dist/vendor/twenty-shared/utils/date/parseToPlainDateOrThrow.d.ts +4 -0
  91. package/dist/vendor/twenty-shared/utils/date/parseToPlainDateOrThrow.d.ts.map +1 -0
  92. package/dist/vendor/twenty-shared/utils/date/sortPlainDate.d.ts +5 -0
  93. package/dist/vendor/twenty-shared/utils/date/sortPlainDate.d.ts.map +1 -0
  94. package/dist/vendor/twenty-shared/utils/date/turnJSDateToPlainDate.d.ts +4 -0
  95. package/dist/vendor/twenty-shared/utils/date/turnJSDateToPlainDate.d.ts.map +1 -0
  96. package/dist/vendor/twenty-shared/utils/date/turnPlainDateIntoUserTimeZoneInstantString.d.ts +4 -0
  97. package/dist/vendor/twenty-shared/utils/date/turnPlainDateIntoUserTimeZoneInstantString.d.ts.map +1 -0
  98. package/dist/vendor/twenty-shared/utils/date/turnPlainDateToShiftedDateInSystemTimeZone.d.ts +4 -0
  99. package/dist/vendor/twenty-shared/utils/date/turnPlainDateToShiftedDateInSystemTimeZone.d.ts.map +1 -0
  100. package/dist/vendor/twenty-shared/utils/fieldMetadata/index.d.ts +3 -0
  101. package/dist/vendor/twenty-shared/utils/fieldMetadata/index.d.ts.map +1 -1
  102. package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataNumericKind.d.ts +4 -0
  103. package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataNumericKind.d.ts.map +1 -0
  104. package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataSelectKind.d.ts +4 -0
  105. package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataSelectKind.d.ts.map +1 -0
  106. package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataTextKind.d.ts +4 -0
  107. package/dist/vendor/twenty-shared/utils/fieldMetadata/isFieldMetadataTextKind.d.ts.map +1 -0
  108. package/dist/vendor/twenty-shared/utils/filter/dates/types/DateTimePeriod.d.ts +4 -0
  109. package/dist/vendor/twenty-shared/utils/filter/dates/types/DateTimePeriod.d.ts.map +1 -0
  110. package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToDateTime.d.ts +1 -0
  111. package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToDateTime.d.ts.map +1 -1
  112. package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToZonedDateTime.d.ts +5 -0
  113. package/dist/vendor/twenty-shared/utils/filter/dates/utils/addUnitToZonedDateTime.d.ts.map +1 -0
  114. package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertCalendarStartDayNonIsoNumberToFirstDayOfTheWeek.d.ts +5 -0
  115. package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertCalendarStartDayNonIsoNumberToFirstDayOfTheWeek.d.ts.map +1 -0
  116. package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertFirstDayOfTheWeekToCalendarStartDayNumber.d.ts +5 -0
  117. package/dist/vendor/twenty-shared/utils/filter/dates/utils/convertFirstDayOfTheWeekToCalendarStartDayNumber.d.ts.map +1 -0
  118. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getFirstDayOfTheWeekAsISONumber.d.ts +4 -0
  119. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getFirstDayOfTheWeekAsISONumber.d.ts.map +1 -0
  120. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getNextPeriodStart.d.ts +8 -0
  121. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getNextPeriodStart.d.ts.map +1 -0
  122. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPeriodStart.d.ts +7 -0
  123. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPeriodStart.d.ts.map +1 -0
  124. package/dist/vendor/twenty-shared/utils/filter/dates/utils/relativeDateFilterStringifiedSchema.d.ts.map +1 -1
  125. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveDateTimeFilter.d.ts +1 -1
  126. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveDateTimeFilter.d.ts.map +1 -1
  127. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateFilter.d.ts +2 -1
  128. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateFilter.d.ts.map +1 -1
  129. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateFilterStringified.d.ts.map +1 -1
  130. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilter.d.ts +4 -3
  131. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilter.d.ts.map +1 -1
  132. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilterStringified.d.ts +5 -3
  133. package/dist/vendor/twenty-shared/utils/filter/dates/utils/resolveRelativeDateTimeFilterStringified.d.ts.map +1 -1
  134. package/dist/vendor/twenty-shared/utils/filter/dates/utils/subUnitFromZonedDateTime.d.ts +5 -0
  135. package/dist/vendor/twenty-shared/utils/filter/dates/utils/subUnitFromZonedDateTime.d.ts.map +1 -0
  136. package/dist/vendor/twenty-shared/utils/filter/turnRecordFilterIntoGqlOperationFilter.d.ts +1 -1
  137. package/dist/vendor/twenty-shared/utils/filter/turnRecordFilterIntoGqlOperationFilter.d.ts.map +1 -1
  138. package/dist/vendor/twenty-shared/utils/index.d.ts +24 -7
  139. package/dist/vendor/twenty-shared/utils/index.d.ts.map +1 -1
  140. package/dist/vendor/twenty-shared/utils/url/lowercaseUrlOriginAndRemoveTrailingSlash.d.ts.map +1 -1
  141. package/dist/vendor/twenty-shared/utils.cjs +2 -3
  142. package/dist/vendor/twenty-shared/utils.mjs +774 -2484
  143. package/dist/vendor/twenty-shared/workflow/constants/IfElseBranchPositionOffsets.d.ts +11 -0
  144. package/dist/vendor/twenty-shared/workflow/constants/IfElseBranchPositionOffsets.d.ts.map +1 -0
  145. package/dist/vendor/twenty-shared/workflow/index.d.ts +6 -0
  146. package/dist/vendor/twenty-shared/workflow/index.d.ts.map +1 -1
  147. package/dist/vendor/twenty-shared/workflow/schemas/filter-action-settings-schema.d.ts +2 -5
  148. package/dist/vendor/twenty-shared/workflow/schemas/filter-action-settings-schema.d.ts.map +1 -1
  149. package/dist/vendor/twenty-shared/workflow/schemas/http-request-action-schema.d.ts +1 -1
  150. package/dist/vendor/twenty-shared/workflow/schemas/http-request-action-settings-schema.d.ts +1 -1
  151. package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-schema.d.ts +49 -0
  152. package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-schema.d.ts.map +1 -0
  153. package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-settings-schema.d.ts +43 -0
  154. package/dist/vendor/twenty-shared/workflow/schemas/if-else-action-settings-schema.d.ts.map +1 -0
  155. package/dist/vendor/twenty-shared/workflow/schemas/step-filter-group-schema.d.ts +10 -0
  156. package/dist/vendor/twenty-shared/workflow/schemas/step-filter-group-schema.d.ts.map +1 -0
  157. package/dist/vendor/twenty-shared/workflow/schemas/step-filter-schema.d.ts +16 -0
  158. package/dist/vendor/twenty-shared/workflow/schemas/step-filter-schema.d.ts.map +1 -0
  159. package/dist/vendor/twenty-shared/workflow/schemas/workflow-action-schema.d.ts +46 -1
  160. package/dist/vendor/twenty-shared/workflow/schemas/workflow-action-schema.d.ts.map +1 -1
  161. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-schema.d.ts +46 -1
  162. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-schema.d.ts.map +1 -1
  163. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-state-schema.d.ts +46 -1
  164. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-state-schema.d.ts.map +1 -1
  165. package/dist/vendor/twenty-shared/workflow/types/StepIfElseBranch.d.ts +6 -0
  166. package/dist/vendor/twenty-shared/workflow/types/StepIfElseBranch.d.ts.map +1 -0
  167. package/dist/vendor/twenty-shared/workflow.cjs +3 -3
  168. package/dist/vendor/twenty-shared/workflow.mjs +199 -174
  169. package/package.json +3 -1
  170. package/dist/_commonjsHelpers-DKOUU3wS.js +0 -1
  171. package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
  172. package/dist/cli/utils/get-object-decorated-class.d.ts +0 -4
  173. package/dist/vendor/twenty-shared/FieldMetadataDefaultValue-CmL_eyqR.js +0 -1
  174. package/dist/vendor/twenty-shared/LabelIdentifierFieldMetadataTypes-BaWEb4k0.js +0 -1
  175. package/dist/vendor/twenty-shared/LabelIdentifierFieldMetadataTypes-BzzhC1dx.mjs +0 -55
  176. package/dist/vendor/twenty-shared/RatingValues-CBa057Mi.js +0 -1
  177. package/dist/vendor/twenty-shared/isValidCountryCode-DNOavXY6.js +0 -4
  178. package/dist/vendor/twenty-shared/isValidCountryCode-QjE8dukS.mjs +0 -6850
  179. package/dist/vendor/twenty-shared/utils/array/upsertIntoArrayOfObjectComparingId.d.ts.map +0 -1
  180. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getDateFromPlainDate.d.ts +0 -2
  181. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getDateFromPlainDate.d.ts.map +0 -1
  182. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getEndUnitOfDateTime.d.ts +0 -6
  183. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getEndUnitOfDateTime.d.ts.map +0 -1
  184. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPlainDateFromDate.d.ts +0 -2
  185. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getPlainDateFromDate.d.ts.map +0 -1
  186. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getStartUnitOfDateTime.d.ts +0 -6
  187. package/dist/vendor/twenty-shared/utils/filter/dates/utils/getStartUnitOfDateTime.d.ts.map +0 -1
  188. package/dist/vendor/twenty-shared/utils/filter/dates/utils/shiftPointInTimeFromTimezoneDifferenceInMinutesWithSystemTimezone.d.ts +0 -2
  189. package/dist/vendor/twenty-shared/utils/filter/dates/utils/shiftPointInTimeFromTimezoneDifferenceInMinutesWithSystemTimezone.d.ts.map +0 -1
  190. package/dist/vendor/twenty-shared/utils/filter/utils/computeTimezoneDifferenceInMinutes.d.ts +0 -2
  191. package/dist/vendor/twenty-shared/utils/filter/utils/computeTimezoneDifferenceInMinutes.d.ts.map +0 -1
package/README.md CHANGED
@@ -30,66 +30,152 @@ npm install twenty-sdk
30
30
  yarn add twenty-sdk
31
31
  ```
32
32
 
33
- ## Getting started
34
- You can either scaffold a new app or add the SDK to an existing one.
33
+ ## Usage
35
34
 
36
- - Start new (recommended):
37
- ```bash
38
- npx create-twenty-app@latest my-twenty-app
39
- cd my-twenty-app
40
- ```
41
- - Existing project: install the SDK as shown above, then use the CLI below.
35
+ ```
36
+ Usage: twenty [options] [command]
37
+
38
+ CLI for Twenty application development
39
+
40
+ Options:
41
+ --workspace <name> Use a specific workspace configuration (default: "default")
42
+ -V, --version output the version number
43
+ -h, --help display help for command
44
+
45
+ Commands:
46
+ auth Authentication commands
47
+ app Application development commands
48
+ help [command] display help for command
49
+ ```
50
+
51
+ ## Global Options
52
+
53
+ - `--workspace <name>`: Use a specific workspace configuration profile. Defaults to `default`. See Configuration for details.
54
+
55
+ ## Commands
56
+
57
+ ### Auth
58
+
59
+ Authenticate the CLI against your Twenty workspace.
60
+
61
+ - `twenty auth login` — Authenticate with Twenty.
62
+ - Options:
63
+ - `--api-key <key>`: API key for authentication.
64
+ - `--api-url <url>`: Twenty API URL (defaults to your current profile's value or `http://localhost:3000`).
65
+ - Behavior: Prompts for any missing values, persists them to the active workspace profile, and validates the credentials.
66
+
67
+ - `twenty auth logout` — Remove authentication credentials for the active workspace profile.
68
+
69
+ - `twenty auth status` — Print the current authentication status (API URL, masked API key, validity).
70
+
71
+ Examples:
42
72
 
43
- ## CLI quickstart
44
73
  ```bash
45
- # Authenticate using your API key (CLI will prompt for it)
74
+ # Login interactively (recommended)
46
75
  twenty auth login
47
76
 
48
- # Add a new entity to your application (guided prompts)
49
- twenty app add
77
+ # Provide values in flags
78
+ twenty auth login --api-key $TWENTY_API_KEY --api-url https://api.twenty.com
50
79
 
51
- # Generate a typed Twenty client and TypeScript definitions for your workspace entities
52
- twenty app generate
80
+ # Login interactively for a specific workspace profile
81
+ twenty auth login --workspace my-custom-workspace
82
+
83
+ # Check status
84
+ twenty auth status
85
+
86
+ # Logout current profile
87
+ twenty auth logout
88
+ ```
89
+
90
+ ### App
53
91
 
54
- # Start dev mode: automatically syncs changes to your workspace for instant testing
92
+ Application development commands.
93
+
94
+ - `twenty app sync [appPath]` — One-time sync of the application to your Twenty workspace.
95
+ - Behavior: Compute your application's manifest and send it to your workspace to sync your application
96
+
97
+ - `twenty app dev [appPath]` — Watch and sync local application changes.
98
+ - Options:
99
+ - `-d, --debounce <ms>`: Debounce delay in milliseconds (default: `1000`).
100
+ - Behavior: Performs an initial sync, then watches the directory for changes and re-syncs after debounced edits. Press Ctrl+C to stop.
101
+
102
+ - `twenty app uninstall [appPath]` — Uninstall the application from the current workspace.
103
+ - Note: `twenty app delete` exists as a hidden alias for backward compatibility.
104
+
105
+ - `twenty app add [entityType]` — Add a new entity to your application.
106
+ - Arguments:
107
+ - `entityType`: one of `function` or `object`. If omitted, an interactive prompt is shown.
108
+ - Options:
109
+ - `--path <path>`: The path where the entity file should be created (relative to the current directory).
110
+ - Behavior:
111
+ - `object`: prompts for singular/plural names and labels, then creates a new object definition file.
112
+ - `function`: prompts for a name and scaffolds a serverless function file.
113
+
114
+ - `twenty app generate [appPath]` — Generate the typed Twenty client for your application.
115
+
116
+ - `twenty app logs [appPath]` — Stream application function logs.
117
+ - Options:
118
+ - `-u, --functionUniversalIdentifier <id>`: Only show logs for a specific function universal ID.
119
+ - `-n, --functionName <name>`: Only show logs for a specific function name.
120
+
121
+ Examples:
122
+
123
+ ```bash
124
+ # Start dev mode with default debounce
55
125
  twenty app dev
56
126
 
57
- # One‑time sync of local changes
127
+ # Start dev mode with custom workspace profile
128
+ twenty app dev --workspace my-custom-workspace
129
+
130
+ # Dev mode with custom debounce
131
+ twenty app dev --debounce 1500
132
+
133
+ # One-time sync of the current directory
58
134
  twenty app sync
59
135
 
60
- # Uninstall the application from the current workspace
61
- twenty app uninstall
62
- ```
136
+ # Add a new object interactively
137
+ twenty app add
138
+
139
+ # Generate client types
140
+ twenty app generate
63
141
 
64
- ## Usage (SDK)
65
- ```typescript
66
- // Example: import what you need from the SDK
67
- import { /* your exports */ } from 'twenty-sdk';
142
+ # Watch all function logs
143
+ twenty app logs
144
+
145
+ # Watch logs for a specific function by name
146
+ twenty app logs -n my-function
68
147
  ```
69
148
 
70
- ## Publish your application
71
- Applications are currently stored in [`twenty/packages/twenty-apps`](https://github.com/twentyhq/twenty/tree/main/packages/twenty-apps).
149
+ ## Configuration
72
150
 
73
- You can share your application with all Twenty users:
151
+ The CLI stores configuration per user in a JSON file:
74
152
 
75
- ```bash
76
- # pull the Twenty project
77
- git clone https://github.com/twentyhq/twenty.git
78
- cd twenty
153
+ - Location: `~/.twenty/config.json`
154
+ - Structure: Profiles keyed by workspace name. The active profile is selected with `--workspace <name>`.
155
+
156
+ Example configuration file:
79
157
 
80
- # create a new branch
81
- git checkout -b feature/my-awesome-app
158
+ ```json
159
+ {
160
+ "profiles": {
161
+ "default": {
162
+ "apiUrl": "http://localhost:3000",
163
+ "apiKey": "<your-api-key>"
164
+ },
165
+ "prod": {
166
+ "apiUrl": "https://api.twenty.com",
167
+ "apiKey": "<your-api-key>"
168
+ }
169
+ }
170
+ }
82
171
  ```
83
172
 
84
- - Copy your app folder into `twenty/packages/twenty-apps`.
85
- - Commit your changes and open a pull request on https://github.com/twentyhq/twenty
173
+ Notes:
86
174
 
87
- ```bash
88
- git commit -m "Add new application"
89
- git push
90
- ```
175
+ - If a profile is missing, `apiUrl` defaults to `http://localhost:3000` until set.
176
+ - `twenty auth login` writes the `apiUrl` and `apiKey` for the default profile.
177
+ - `twenty auth login --workspace custom-workspace` writes the `apiUrl` and `apiKey` for a custom `custom-workspace` profile.
91
178
 
92
- Our team reviews contributions for quality, security, and reusability.
93
179
 
94
180
  ## Troubleshooting
95
181
  - Auth errors: run `twenty auth login` again and ensure the API key has the required permissions.