LocalGPTAction
Defines a custom AI action that can be triggered from the editor.src/interfaces.ts
Properties
Display name of the action shown in menus and command paletteExample:
"🪄 General help" or "✍️ Continue writing"The user prompt sent to the AI model. Can be empty for freeform actions.Special keywords:
{{=SELECTION=}}- Replaced with selected text{{=CONTEXT=}}- Replaced with context from linked files{{=CONTEXT_START=}}/{{=CONTEXT_END=}}- Conditional context blocks
Override temperature for this action. If not specified, uses the default creativity setting.Range: 0.0 to 1.0
0.0- Deterministic, focused1.0- Creative, varied
System prompt that defines the AI’s behavior and roleExample:
If
true, replaces the selected text with the AI output instead of appending belowUse case: Grammar correction, text transformationIf
true, adds a visual separator in action menusMetadata for community-shared actions. See CommunityActionRef.
CommunityActionRef
Metadata for actions imported from the community repository.src/interfaces.ts
Properties
Unique identifier for the community action
Language code (e.g.,
"en", "es", "fr")Display name of the community action
Content hash for version tracking and updates
ISO timestamp of last update
Description of what the action does
Action Examples
Basic Action
Simple summarization action:Replace Action
Grammar correction that replaces selected text:Freeform Action
General help action with empty prompt (user provides prompt at runtime):High Creativity Action
Creative writing with custom temperature:Community Action
Action imported from community repository:Usage in Code
Actions are executed insrc/main.ts:349: