Skip to content

Vibe coding a plugin? 😎 Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

PluginFiles

File dialogs, which need the "files.dialog" permission, and the plugin’s data folder.

context.registerCommand({
id: "export",
title: "Export CSV",
async run() {
const file = await context.files.save({ name: "faces.csv", filters: [{ name: "CSV", extensions: ["csv"] }] });
if (file) {
file.writeText("kind,count\nface,12\n");
}
},
});

readonly data: PluginDataFiles

open(options?): Promise<PluginFile | null>

Asks the user for a file to open, and resolves with it, or null when they cancel. The dialog shows after the plugin’s code for this frame; a command that awaits it finishes, and continues once the user answers. When another model opens first, the promise rejects with a ReferenceError, and the code that runs for it can’t reach the model open now.

FileDialogOptions

Promise<PluginFile | null>


save(options?): Promise<PluginFile | null>

Asks the user where to save, like open; the plugin may then write that file.

FileDialogOptions

Promise<PluginFile | null>