This can be done in a few lines of code:
const currentFile = app.workspace.getActiveFile()
if (!currentFile) {
return new Notice("No active file");
}
await app.plugins.plugins.metaedit.api.createYamlProperty("alias", currentFile.basename, currentFile)
You can use Templater or QuickAdd to activate the code - depending on your preferences 