create-twenty-app 0.5.2 → 0.6.0

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
@@ -35,45 +35,86 @@ cd my-twenty-app
35
35
  corepack enable
36
36
  yarn install
37
37
 
38
- # Get help
39
- yarn run help
38
+ # Get help and list all available commands
39
+ yarn twenty help
40
40
 
41
41
  # Authenticate using your API key (you'll be prompted)
42
- yarn auth:login
42
+ yarn twenty auth:login
43
43
 
44
44
  # Add a new entity to your application (guided)
45
- yarn entity:add
46
-
47
- # Generate a typed Twenty client and workspace entity types
48
- yarn app:generate
45
+ yarn twenty entity:add
49
46
 
50
47
  # Start dev mode: watches, builds, and syncs local changes to your workspace
51
- yarn app:dev
48
+ # (also auto-generates a typed API client in node_modules/twenty-sdk/generated)
49
+ yarn twenty app:dev
52
50
 
53
51
  # Watch your application's function logs
54
- yarn function:logs
52
+ yarn twenty function:logs
55
53
 
56
54
  # Execute a function with a JSON payload
57
- yarn function:execute -n my-function -p '{"key": "value"}'
55
+ yarn twenty function:execute -n my-function -p '{"key": "value"}'
56
+
57
+ # Execute the post-install function
58
+ yarn twenty function:execute --postInstall
58
59
 
59
60
  # Uninstall the application from the current workspace
60
- yarn app:uninstall
61
+ yarn twenty app:uninstall
62
+ ```
63
+
64
+ ## Scaffolding modes
65
+
66
+ Control which example files are included when creating a new app:
67
+
68
+ | Flag | Behavior |
69
+ |------|----------|
70
+ | `-e, --exhaustive` | **(default)** Creates all example files without prompting |
71
+ | `-m, --minimal` | Creates only core files (`application-config.ts` and `default-role.ts`) |
72
+ | `-i, --interactive` | Prompts you to select which examples to include |
73
+
74
+ ```bash
75
+ # Default: all examples included
76
+ npx create-twenty-app@latest my-app
77
+
78
+ # Minimal: only core files
79
+ npx create-twenty-app@latest my-app -m
80
+
81
+ # Interactive: choose which examples to include
82
+ npx create-twenty-app@latest my-app -i
61
83
  ```
62
84
 
85
+ In interactive mode, you can pick from:
86
+ - **Example object** — a custom CRM object definition (`objects/example-object.ts`)
87
+ - **Example field** — a custom field on the example object (`fields/example-field.ts`)
88
+ - **Example logic function** — a server-side handler with HTTP trigger (`logic-functions/hello-world.ts`)
89
+ - **Example front component** — a React UI component (`front-components/hello-world.tsx`)
90
+ - **Example view** — a saved view for the example object (`views/example-view.ts`)
91
+ - **Example navigation menu item** — a sidebar link (`navigation-menu-items/example-navigation-menu-item.ts`)
92
+ - **Example skill** — an AI agent skill definition (`skills/example-skill.ts`)
93
+
63
94
  ## 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
70
- - Prewired scripts that wrap the `twenty` CLI from twenty-sdk
95
+
96
+ **Core files (always created):**
97
+ - `application-config.ts` Application metadata configuration
98
+ - `roles/default-role.ts` Default role for logic functions
99
+ - `logic-functions/post-install.ts` — Post-install logic function (runs after app installation)
100
+ - TypeScript configuration, ESLint, package.json, .gitignore
101
+ - A prewired `twenty` script that delegates to the `twenty` CLI from twenty-sdk
102
+
103
+ **Example files (controlled by scaffolding mode):**
104
+ - `objects/example-object.ts` — Example custom object with a text field
105
+ - `fields/example-field.ts` — Example standalone field extending the example object
106
+ - `logic-functions/hello-world.ts` — Example logic function with HTTP trigger
107
+ - `front-components/hello-world.tsx` — Example front component
108
+ - `views/example-view.ts` — Example saved view for the example object
109
+ - `navigation-menu-items/example-navigation-menu-item.ts` — Example sidebar navigation link
110
+ - `skills/example-skill.ts` — Example AI agent skill definition
71
111
 
72
112
  ## Next steps
73
- - Use `yarn auth:login` to authenticate with your Twenty workspace.
74
- - Explore the generated project and add your first entity with `yarn entity:add` (logic functions, front components, objects, roles).
75
- - Use `yarn app:dev` while you iterate it watches, builds, and syncs changes to your workspace in real time.
76
- - Keep your types up‑to‑date using `yarn app:generate`.
113
+ - Run `yarn twenty help` to see all available commands.
114
+ - Use `yarn twenty auth:login` to authenticate with your Twenty workspace.
115
+ - 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).
116
+ - Use `yarn twenty app:dev` while you iterate — it watches, builds, and syncs changes to your workspace in real time.
117
+ - Types are auto‑generated by `yarn twenty app:dev` and stored in `node_modules/twenty-sdk/generated`.
77
118
 
78
119
 
79
120
  ## Publish your application
@@ -101,8 +142,8 @@ git push
101
142
  Our team reviews contributions for quality, security, and reusability before merging.
102
143
 
103
144
  ## Troubleshooting
104
- - Auth prompts not appearing: run `yarn auth:login` again and verify the API key permissions.
105
- - Types not generated: ensure `yarn app:generate` runs without errors, then restart `yarn app:dev`.
145
+ - Auth prompts not appearing: run `yarn twenty auth:login` again and verify the API key permissions.
146
+ - Types not generated: ensure `yarn twenty app:dev` is running it autogenerates the typed client.
106
147
 
107
148
  ## Contributing
108
149
  - See our [GitHub](https://github.com/twentyhq/twenty)