AI Chat and AI Review use sidebars registered by the plugin. To show or hide them programmatically, use the core ToggleSidebar command (listed in the Miscellaneous Core Commands table), not a command defined by the tinymceai plugin. Pass the sidebar identifier as the third argument:
-
'tinymceai-chat'— AI Chat -
'tinymceai-review'— AI Review
// Open the AI Chat sidebar
tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-chat');
// Close the current sidebar (pass the same ID again to toggle off)
tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-chat');
// Open the AI Review sidebar
tinymce.activeEditor.execCommand('ToggleSidebar', false, 'tinymceai-review');|
Note
|
These commands work regardless of tinymceai_sidebar_type ('static' or 'floating'). The ToggleSidebar event and queryCommandValue('ToggleSidebar') also behave the same for both sidebar types.
|
The tinymceai plugin registers the following editor commands. They mirror the Quick Actions and related UI: each invocation returns immediately while the plugin performs any network and UI work asynchronously.
| Command | Third argument | Description |
|---|---|---|
|
Runs the Improve writing quick action. |
|
|
Runs the Continue writing quick action. |
|
|
Runs the Fix grammar quick action. |
|
|
Runs Make shorter. |
|
|
Runs Make longer. |
|
|
Runs More casual tone. |
|
|
Runs More direct tone. |
|
|
Runs More friendly tone. |
|
|
Runs More confident tone. |
|
|
Runs More professional tone. |
|
|
|
Runs Translate with the given language label (same string family as |
|
|
Runs a custom quick action with the given prompt and model (same behavior as |
|
Opens Chat with the built-in Explain prompt. |
|
|
Opens Chat with the built-in Summarize prompt. |
|
|
Opens Chat with the built-in Highlight key points prompt. |
|
|
|
Opens the Chat sidebar if needed, then sends |
|
Note
|
Command names use the |
tinymce.activeEditor.execCommand('TinyMCEAIQuickActionTranslate', false, 'swedish');
tinymce.activeEditor.execCommand('TinyMCEAIQuickActionCustom', false, {
prompt: 'Uppercase text',
model: 'gpt-4.1'
});tinymce.activeEditor.execCommand('TinyMCEAIChatPrompt', false, {
prompt: 'Explain the current selection in Klingon',
displayedPrompt: 'Explain'
});