Elffuss BraidHub

kikocis/continue public

main · 707 BRawPermalink
1import { fileURLToPath } from "node:url";
2import path from "path";
3
4import { SlashCommand } from "../../../index.js";
5import { shareSession } from "../../../util/historyUtils.js";
6
7const ShareSlashCommand: SlashCommand = {
8 name: "share",
9 description: "Export the current chat session to markdown",
10 run: async function* ({ ide, history, params }) {
11 const fileUrl = await shareSession(ide, history, params?.outputDir);
12 const filePath = fileURLToPath(fileUrl);
13 // output path is the parent directory of the filePath
14 const outPath = path.dirname(filePath);
15 yield `The session transcript has been saved to a markdown file at \`${outPath}\`.`;
16 },
17};
18
19export default ShareSlashCommand;