Enhancement: Ability to prompt from the a custom script #699

Closed
opened 2026-10-05 03:00:54 +02:00 by adam · 0 comments
Owner

You can already ask questions via the extensibility model (https://www.npmjs.com/package/@frontmatter/extensibility), but it would be helpful to prompt GitHub Copilot.

Example usage:

import { ContentScript } from "@frontmatter/extensibility";

const contentScriptArgs = ContentScript.getArguments();
if (contentScriptArgs) {
  const {
    frontMatter: { title, description, slug },
    promptResponse
} = contentScriptArgs;

if (!promptResponse) {
  ContentScript.promptCopilot(`Create me a good post for sharing this on the BlueSky social media platform. To generate the post, please use the following information:

Title: """${title}"""
Description: """${description}"""

The output should be plain text and should not include any markdown or HTML tags. You are free to add hashtags.

IMPORTANT: Please make sure to keep the post under 265 characters.`);
  return;
}

// Do the rest
You can already ask questions via the extensibility model (https://www.npmjs.com/package/@frontmatter/extensibility), but it would be helpful to prompt GitHub Copilot. Example usage: ```js import { ContentScript } from "@frontmatter/extensibility"; const contentScriptArgs = ContentScript.getArguments(); if (contentScriptArgs) { const { frontMatter: { title, description, slug }, promptResponse } = contentScriptArgs; if (!promptResponse) { ContentScript.promptCopilot(`Create me a good post for sharing this on the BlueSky social media platform. To generate the post, please use the following information: Title: """${title}""" Description: """${description}""" The output should be plain text and should not include any markdown or HTML tags. You are free to add hashtags. IMPORTANT: Please make sure to keep the post under 265 characters.`); return; } // Do the rest ``` <!-- github-sync-id:2654798793 -->
adam closed this issue 2026-10-05 03:00:54 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#699