PromptL for VS Code
Language support for PromptL - a templating language for LLM prompts.
Features
- Syntax Highlighting - Full syntax support including YAML frontmatter, message tags, mustache expressions, and control flow
- Real-time Diagnostics - Catch syntax errors, undefined variables, and invalid references as you type
- Go to Definition - Cmd+Click on
<prompt path="..."> to navigate to referenced files
- Hover Information - See details about referenced prompt files
- Auto-closing - Automatic bracket and tag completion
Installation
Install from the VS Code Marketplace or search for "PromptL" in VS Code extensions.
Configuration
Settings
| Setting |
Default |
Description |
promptl.diagnostics.enable |
true |
Enable real-time diagnostics |
promptl.diagnostics.validateReferences |
true |
Validate that <prompt path="..."> references exist |
Example Settings
{
"promptl.diagnostics.enable": true,
"promptl.diagnostics.validateReferences": true
}
Syntax Overview
PromptL files (.promptl) support:
<system>
You are a helpful assistant.
</system>
<user>
Hello!
</user>
Variables and Expressions
<user>
Hello, {{ name }}!
Your score is {{ score * 100 }}%.
</user>
Control Flow
{{ if showInstructions }}
<system>
Follow these instructions...
</system>
{{ endif }}
{{ for item in items }}
- {{ item.name }}
{{ endfor }}
YAML Frontmatter
---
model: gpt-4
temperature: 0.7
---
<system>Your prompt here</system>
Prompt References
<prompt path="./shared/persona.promptl" />
Development
See the main repository for development instructions.
License
MIT