Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Last active March 9, 2026 09:13
Show Gist options
  • Select an option

  • Save msrivastav13/97a102a58c6fb1aee1fe45ac42990e82 to your computer and use it in GitHub Desktop.

Select an option

Save msrivastav13/97a102a58c6fb1aee1fe45ac42990e82 to your computer and use it in GitHub Desktop.
Run Salesforce CLI scanner on current file
{
"version": "2.0.0",
"tasks": [
{
"label": "SFDX: Run Security Scan on Current File",
"type": "shell",
"command": "sfdx",
"args": [
"scanner:run",
"-t",
"${relativeFile}",
"-c",
"Security"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
}
]
}
@rsindall

rsindall commented Oct 30, 2020

Copy link
Copy Markdown

Hey Mohith,

Thanks for the example task file, how do we set it up to be globally available?

@msrivastav13

Copy link
Copy Markdown
Author

Hello,

Can you explain me what do you mean by globally here? Do you mean for all project workspace?

Or to scan all the files?

@rsindall

Copy link
Copy Markdown

Hi Mohith

Apologies, I wasn't very clear.

I meant, how can I set up the task so that it is always available in all projects?

@msrivastav13

Copy link
Copy Markdown
Author

Hi Robert,

Unfortunately project scaffold command of sfdx at this point does not let you to add your own scaffold templates.

You can build a salesforce cli plugin if you need this in every project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment