Skip to content

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

@estruyf

Description

@estruyf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    In BETAThe current task is available for testing in the BETA version.ReleasedThe task has been releasedenhancementNew feature or requestv10.7.0Project: v10.7.0

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions