Promptic VS Code Extension
A VS Code extension for managing your projects and prompts directly within the editor.
Features
- Project Management: Add and manage multiple projects by their project key (GUID)
- Prompt Viewing: Browse all prompts within your projects in a tree view
- Prompt Editing: Edit prompts directly in VS Code with full editor features
- Search: Search through prompts by name or content
- Auto-sync: Changes are automatically saved to your backend API
- Persistent Storage: Projects are remembered between VS Code sessions
Getting Started
- Open the Promptic sidebar: Look for "Promptic Projects" in the Explorer panel
- Add your first project: Click the "+" button and enter your project key (GUID)
- Browse prompts: Expand your project to see all available prompts
- Edit prompts: Click on any prompt to open it in the editor
- Save changes: Use Ctrl+S (Cmd+S on Mac) to save changes back to the API
Requirements
- Your backend API should be running on
http://localhost:5001
(or configure via environment variable)
- API endpoints:
GET /api/projectPrompts/{projectKey}
- Fetch project and prompts
PUT /api/updatePrompt
- Update prompt content
Configuration
You can configure the API base URL using environment variables:
- Create a
.env
file in the extension's root directory
- Add the following configuration:
BASE_URL=http://localhost:5001/api
- Restart VS Code for the changes to take effect
If no environment variable is set, the extension defaults to http://localhost:5001/api
.
Commands
- Add Project: Add a new project by project key (GUID)
- Delete Project: Remove a project from VS Code (doesn't delete from backend)
- Refresh: Reload all projects and prompts from the API
- Search Prompts: Filter prompts by name or content
Usage
Adding a Project
- Click the "+" button in the Promptic sidebar
- Enter your project key (e.g.,
de61ee85-0f03-4abf-8496-63e561b0a0bc
)
- The extension will fetch all prompts for that project
Editing Prompts
- Click on any prompt in the tree view
- The prompt will open in a new editor tab
- Make your changes
- Press Ctrl+S to save (changes are sent to the API immediately)
Searching
- Click the search icon in the sidebar
- Enter your search term
- The tree view will filter to show only matching prompts
- Clear the search by searching for an empty string
The extension expects your API to return project data in this format:
{
"projectId": "04360914-72ea-460d-aea1-71df66dc685a",
"projectName": "My Project",
"projectKey": "de61ee85-0f03-4abf-8496-63e561b0a0bc",
"prompts": [
{
"id": "327fb2c7-f4ec-4541-9572-9e295b5a5ac4",
"name": "reasoning_explanation",
"content": "You are a clear-thinking assistant",
"variables": "callInfo",
"createdAt": 1749554879221,
"updatedAt": 1750426590818
}
]
}
Development
To run the extension in development mode:
- Clone this repository
- Run
npm install
- Press F5 to open a new VS Code window with the extension loaded
- Test the extension with your API
License
This extension is provided as-is for managing your Promptic projects and prompts.