sfdx force:apex:execute

Executes anonymous Apex code

Options

NameDescription
--jsonFormat output as json
--loglevel <loglevel>Logging level for this command invocation
-u, --targetusername <targetusername>Username or alias for the target org; overrides default target org
--apiversion <apiversion>Override the api version used for api requests made by this command
-f, --apexcodefile <apexcodefile>Path to a local file that contains Apex code