Once you have automated something in Obsidian you will likely want to save the code so that you can do it every time you use obsidian. Plugin repl reads from a startup file repl.md at startup to let you do this.
To use this: Open a note called repl in obsidian and paste you code there. My code exists of custom commands defined with newCommand.
A common failing you can get is a startup file that doesn’t run so it can be good to execute the entire file in plugin repl everytime you make a change.
You can also source other files from your repl file if it starts getting too larger.