create-twenty-app 0.6.0-alpha → 0.6.1

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.
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  Create Twenty App is the official scaffolding CLI for building apps on top of [Twenty CRM](https://twenty.com). It sets up a ready‑to‑run project that works seamlessly with the [twenty-sdk](https://www.npmjs.com/package/twenty-sdk).
16
16
 
17
17
  - Zero‑config project bootstrap
18
- - Preconfigured scripts for auth, dev mode (watch & sync), generate, uninstall, and function management
18
+ - Preconfigured scripts for auth, dev mode (watch & sync), uninstall, and function management
19
19
  - Strong TypeScript support and typed client generation
20
20
 
21
21
  ## Documentation
@@ -31,10 +31,6 @@ See Twenty application documentation https://docs.twenty.com/developers/extend/c
31
31
  npx create-twenty-app@latest my-twenty-app
32
32
  cd my-twenty-app
33
33
 
34
- # If you don't use yarn@4
35
- corepack enable
36
- yarn install
37
-
38
34
  # Get help and list all available commands
39
35
  yarn twenty help
40
36
 
@@ -44,10 +40,8 @@ yarn twenty auth:login
44
40
  # Add a new entity to your application (guided)
45
41
  yarn twenty entity:add
46
42
 
47
- # Generate a typed Twenty client and workspace entity types
48
- yarn twenty app:generate
49
-
50
43
  # Start dev mode: watches, builds, and syncs local changes to your workspace
44
+ # (also auto-generates typed API clients — CoreApiClient and MetadataApiClient — in node_modules/twenty-sdk/generated)
51
45
  yarn twenty app:dev
52
46
 
53
47
  # Watch your application's function logs
@@ -56,25 +50,67 @@ yarn twenty function:logs
56
50
  # Execute a function with a JSON payload
57
51
  yarn twenty function:execute -n my-function -p '{"key": "value"}'
58
52
 
53
+ # Execute the post-install function
54
+ yarn twenty function:execute --postInstall
55
+
59
56
  # Uninstall the application from the current workspace
60
57
  yarn twenty app:uninstall
61
58
  ```
62
59
 
60
+ ## Scaffolding modes
61
+
62
+ Control which example files are included when creating a new app:
63
+
64
+ | Flag | Behavior |
65
+ |------|----------|
66
+ | `-e, --exhaustive` | **(default)** Creates all example files without prompting |
67
+ | `-m, --minimal` | Creates only core files (`application-config.ts` and `default-role.ts`) |
68
+ | `-i, --interactive` | Prompts you to select which examples to include |
69
+
70
+ ```bash
71
+ # Default: all examples included
72
+ npx create-twenty-app@latest my-app
73
+
74
+ # Minimal: only core files
75
+ npx create-twenty-app@latest my-app -m
76
+
77
+ # Interactive: choose which examples to include
78
+ npx create-twenty-app@latest my-app -i
79
+ ```
80
+
81
+ In interactive mode, you can pick from:
82
+ - **Example object** — a custom CRM object definition (`objects/example-object.ts`)
83
+ - **Example field** — a custom field on the example object (`fields/example-field.ts`)
84
+ - **Example logic function** — a server-side handler with HTTP trigger (`logic-functions/hello-world.ts`)
85
+ - **Example front component** — a React UI component (`front-components/hello-world.tsx`)
86
+ - **Example view** — a saved view for the example object (`views/example-view.ts`)
87
+ - **Example navigation menu item** — a sidebar link (`navigation-menu-items/example-navigation-menu-item.ts`)
88
+ - **Example skill** — an AI agent skill definition (`skills/example-skill.ts`)
89
+
63
90
  ## What gets scaffolded
64
- - A minimal app structure ready for Twenty with example files:
65
- - `application-config.ts` - Application metadata configuration
66
- - `roles/default-role.ts` - Default role for logic functions
67
- - `logic-functions/hello-world.ts` - Example logic function with HTTP trigger
68
- - `front-components/hello-world.tsx` - Example front component
69
- - TypeScript configuration
91
+
92
+ **Core files (always created):**
93
+ - `application-config.ts` Application metadata configuration
94
+ - `roles/default-role.ts` Default role for logic functions
95
+ - `logic-functions/post-install.ts` — Post-install logic function (runs after app installation)
96
+ - TypeScript configuration, ESLint, package.json, .gitignore
70
97
  - A prewired `twenty` script that delegates to the `twenty` CLI from twenty-sdk
71
98
 
99
+ **Example files (controlled by scaffolding mode):**
100
+ - `objects/example-object.ts` — Example custom object with a text field
101
+ - `fields/example-field.ts` — Example standalone field extending the example object
102
+ - `logic-functions/hello-world.ts` — Example logic function with HTTP trigger
103
+ - `front-components/hello-world.tsx` — Example front component
104
+ - `views/example-view.ts` — Example saved view for the example object
105
+ - `navigation-menu-items/example-navigation-menu-item.ts` — Example sidebar navigation link
106
+ - `skills/example-skill.ts` — Example AI agent skill definition
107
+
72
108
  ## Next steps
73
109
  - Run `yarn twenty help` to see all available commands.
74
110
  - Use `yarn twenty auth:login` to authenticate with your Twenty workspace.
75
- - Explore the generated project and add your first entity with `yarn twenty entity:add` (logic functions, front components, objects, roles).
111
+ - Explore the generated project and add your first entity with `yarn twenty entity:add` (logic functions, front components, objects, roles, views, navigation menu items, skills).
76
112
  - Use `yarn twenty app:dev` while you iterate — it watches, builds, and syncs changes to your workspace in real time.
77
- - Keep your types upto‑date using `yarn twenty app:generate`.
113
+ - Two typed API clients are autogenerated by `yarn twenty app:dev` and stored in `node_modules/twenty-sdk/generated`: `CoreApiClient` (for workspace data via `/graphql`) and `MetadataApiClient` (for workspace configuration and file uploads via `/metadata`).
78
114
 
79
115
 
80
116
  ## Publish your application
@@ -103,7 +139,7 @@ Our team reviews contributions for quality, security, and reusability before mer
103
139
 
104
140
  ## Troubleshooting
105
141
  - Auth prompts not appearing: run `yarn twenty auth:login` again and verify the API key permissions.
106
- - Types not generated: ensure `yarn twenty app:generate` runs without errors, then restart `yarn twenty app:dev`.
142
+ - Types not generated: ensure `yarn twenty app:dev` is running it autogenerates the typed client.
107
143
 
108
144
  ## Contributing
109
145
  - See our [GitHub](https://github.com/twentyhq/twenty)