A command menu item is the bridge between the user and a front component. It registers the component in Twenty’s command menu (Cmd+K) and, optionally, as a pinned quick-action button in the top-right corner of the page.Documentation Index
Fetch the complete documentation index at: https://docs.twenty.com/llms.txt
Use this file to discover all available pages before exploring further.
src/command-menu-items/open-dashboard.command-menu-item.ts
Configuration fields
| Field | Required | Description |
|---|---|---|
universalIdentifier | Yes | Stable unique ID for the command |
label | Yes | Full label shown in the command menu (Cmd+K) |
frontComponentUniversalIdentifier | Yes | The universalIdentifier of the front component this command opens |
shortLabel | No | Shorter label displayed on the pinned quick-action button |
icon | No | Icon name displayed next to the label (e.g. 'IconBolt', 'IconSend') |
isPinned | No | When true, shows the command as a quick-action button in the top-right corner of the page |
availabilityType | No | Controls where the command appears: 'GLOBAL' (always available), 'RECORD_SELECTION' (only when records are selected), or 'FALLBACK' (shown when no other commands match) |
availabilityObjectUniversalIdentifier | No | Restrict the command to pages of a specific object type (e.g. only on Company records) |
conditionalAvailabilityExpression | No | A boolean expression that dynamically controls visibility (see below) |
Headless commands
A command menu item paired with a headless front component is the idiomatic way to ship a one-click action — run code, navigate, or confirm and execute. The Front Components page covers the SDK Command components (Command, CommandLink, CommandModal, CommandOpenSidePanelPage) that handle the action-and-unmount pattern.
A typical flow:
src/front-components/run-action.tsx
src/command-menu-items/run-action.command-menu-item.ts
Conditional availability expressions
TheconditionalAvailabilityExpression field lets you control when a command is visible based on the current page context. Import typed variables and operators from twenty-sdk to build expressions:
src/command-menu-items/bulk-update.command-menu-item.ts
Context variables
These represent the current state of the page:| Variable | Type | Description |
|---|---|---|
pageType | string | Current page type (e.g. 'RecordIndexPage', 'RecordShowPage') |
isInSidePanel | boolean | Whether the component is rendered in a side panel |
numberOfSelectedRecords | number | Number of currently selected records |
isSelectAll | boolean | Whether “select all” is active |
selectedRecords | array | The selected record objects |
favoriteRecordIds | array | IDs of favorited records |
objectPermissions | object | Permissions for the current object type |
targetObjectReadPermissions | object | Read permissions for the target object |
targetObjectWritePermissions | object | Write permissions for the target object |
featureFlags | object | Active feature flags |
objectMetadataItem | object | Metadata of the current object type |
hasAnySoftDeleteFilterOnView | boolean | Whether the current view has a soft-delete filter |
Operators
Combine variables into boolean expressions:| Operator | Description |
|---|---|
isDefined(value) | true if the value is not null/undefined |
isNonEmptyString(value) | true if the value is a non-empty string |
includes(array, value) | true if the array contains the value |
includesEvery(array, prop, value) | true if every item’s property includes the value |
every(array, prop) | true if the property is truthy on every item |
everyDefined(array, prop) | true if the property is defined on every item |
everyEquals(array, prop, value) | true if the property equals the value on every item |
some(array, prop) | true if the property is truthy on at least one item |
someDefined(array, prop) | true if the property is defined on at least one item |
someEquals(array, prop, value) | true if the property equals the value on at least one item |
someNonEmptyString(array, prop) | true if the property is a non-empty string on at least one item |
none(array, prop) | true if the property is falsy on every item |
noneDefined(array, prop) | true if the property is undefined on every item |
noneEquals(array, prop, value) | true if the property does not equal the value on any item |