Enhancement: Expand the Script execution feature. #262

Closed
opened 2026-10-05 02:36:22 +02:00 by adam · 7 comments
Owner

Is your feature request related to a problem? Please describe.
We have a bunch of Python scripts that we use for bulk creation and processing of many files in our docs project. We can open a terminal and run them from the command line, but it would be nice to have a button on the dashboard for triggering the script to run and define a UI (like we have for snippets) to enter values to be passed as arguments into the script execution command.

Describe the solution you'd like
Expand the 'Scripts' feature to define a command line execution string with placeholders and UI to enter them. Then show a button on the dashboard to trigger that UI and subsequent execution. This would expand the tool to allow for the execution of any script from any language and not limited to javascript/node scripts.

Describe alternatives you've considered
Opening the terminal and entering the script and arguments manually. With some reference to the command documentation to make sure you get the arguments right.

**Is your feature request related to a problem? Please describe.** We have a bunch of Python scripts that we use for bulk creation and processing of many files in our docs project. We can open a terminal and run them from the command line, but it would be nice to have a button on the dashboard for triggering the script to run and define a UI (like we have for snippets) to enter values to be passed as arguments into the script execution command. **Describe the solution you'd like** Expand the 'Scripts' feature to define a command line execution string with placeholders and UI to enter them. Then show a button on the dashboard to trigger that UI and subsequent execution. This would expand the tool to allow for the execution of any script from any language and not limited to javascript/node scripts. **Describe alternatives you've considered** Opening the terminal and entering the script and arguments manually. With some reference to the command documentation to make sure you get the arguments right. <!-- github-sync-id:1226929766 -->
adam closed this issue 2026-10-05 02:36:22 +02:00
Author
Owner

Thanks @bwklein, it makes sense to allow more types of scripts/languages. I will do some experimentation with Python.

Thanks @bwklein, it makes sense to allow more types of scripts/languages. I will do some experimentation with Python. <!-- github-comment-id:1119406855 -->
Author
Owner

@estruyf I could see bash scripts as useful too since you could use them to execute other scripts in different languages as well.

@estruyf I could see bash scripts as useful too since you could use them to execute other scripts in different languages as well. <!-- github-comment-id:1120040276 -->
Author
Owner

Hi @zivbk1 have been working on the ability to run other types of scripts.

{
  "frontMatter.custom.scripts": [
    {
      "title": "Node script 1",
      "script": "./scripts/node-test.js",
      "command": "~/.nvm/versions/node/v16.11.1/bin/node"
    },
    {
      "title": "Node script 2",
      "script": "./scripts/node-test.js",
      "command": "node"
    },
    {
      "title": "Bash script",
      "script": "./scripts/bash-test.sh",
      "command": "bash"
    },
    {
      "title": "Python script",
      "script": "./scripts/python-test.py",
      "command": "python3"
    }
  ]
}

nodeBin property will be deprecated in favor of the new command property.

Hi @zivbk1 have been working on the ability to run other types of scripts. ```json { "frontMatter.custom.scripts": [ { "title": "Node script 1", "script": "./scripts/node-test.js", "command": "~/.nvm/versions/node/v16.11.1/bin/node" }, { "title": "Node script 2", "script": "./scripts/node-test.js", "command": "node" }, { "title": "Bash script", "script": "./scripts/bash-test.sh", "command": "bash" }, { "title": "Python script", "script": "./scripts/python-test.py", "command": "python3" } ] } ``` `nodeBin` property will be deprecated in favor of the new `command` property. <!-- github-comment-id:1122474170 -->
Author
Owner

Very clean and easy to use.
Would it be possible to add a UI like snippets, to pass arguments into variable placeholders within the 'script' string?

"script": "./scripts/python-test.py -v [[version]]",

Very clean and easy to use. Would it be possible to add a UI like snippets, to pass arguments into variable placeholders within the 'script' string? `"script": "./scripts/python-test.py -v [[version]]",` <!-- github-comment-id:1122508684 -->
Author
Owner

If there would be a UI, would you run more general scripts from it? Or do you also want to use it for content and media scripts?

If there would be a UI, would you run more general scripts from it? Or do you also want to use it for content and media scripts? <!-- github-comment-id:1124697860 -->
Author
Owner

I could see a use for user input whenever a script is run. Maybe every script doesn't need input, but the option could be very useful. For variables in a script that could change from run to run, UI would be better that editing the script code.

I could see a use for user input whenever a script is run. Maybe every script doesn't need input, but the option could be very useful. For variables in a script that could change from run to run, UI would be better that editing the script code. <!-- github-comment-id:1125049598 -->
Author
Owner

It will be released in v7.3.0. I will create another issue to implement the script dashboard.

It will be released in v7.3.0. I will create another issue to implement the script dashboard. <!-- github-comment-id:1137098079 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#262