UNPKG

@salesforce/plugin-apex

Version:
1,259 lines (1,258 loc) 54.4 kB
{ "commands": { "apex:run": { "aliases": [ "force:apex:execute" ], "args": {}, "deprecateAliases": true, "description": "If you don’t run this command from within a Salesforce DX project, you must specify the —-target-org flag.\n\nTo execute your code interactively, run this command with no flags. At the prompt, enter all your Apex code; press CTRL-D when you're finished. Your code is then executed in a single execute anonymous request.\nFor more information, see \"Anonymous Blocks\" in the Apex Developer Guide.", "examples": [ "Execute the Apex code that's in the ~/test.apex file in the org with the specified username:\n<%= config.bin %> <%= command.id %> --target-org testusername@salesforce.org --file ~/test.apex", "Similar to previous example, but execute the code in your default org:\n<%= config.bin %> <%= command.id %> --file ~/test.apex", "Run the command with no flags to start interactive mode; the code will execute in your default org when you exit. At the prompt, start type Apex code and press the Enter key after each line. Press CTRL+D when finished.\n<%= config.bin %> <%= command.id %>" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "file": { "aliases": [ "apexcodefile" ], "char": "f", "deprecateAliases": true, "name": "file", "summary": "Path to a local file that contains Apex code.", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "apex:run", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "strict": true, "summary": "Execute anonymous Apex code entered on the command line or from a local file.", "enableJsonFlag": true, "isESM": true, "relativePath": [ "lib", "commands", "apex", "run.js" ], "aliasPermutations": [ "force:apex:execute", "apex:force:execute", "apex:execute:force", "force:execute:apex", "execute:force:apex", "execute:apex:force" ], "permutations": [ "apex:run", "run:apex" ] }, "apex:list:log": { "aliases": [ "force:apex:log:list" ], "args": {}, "deprecateAliases": true, "description": "Run this command in a project to list the IDs and general information for all debug logs in your default org.\n\nTo fetch a specific log from your org, obtain the ID from this command's output, then run the “<%= config.bin %> apex log get” command.", "examples": [ "List the IDs and information about the debug logs in your default org:\n<%= config.bin %> <%= command.id %>", "Similar to previous example, but use the org with the specified username:\n<%= config.bin %> <%= command.id %> --target-org me@my.org" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "apex:list:log", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "strict": true, "summary": "Display a list of IDs and general information about debug logs.", "enableJsonFlag": true, "isESM": true, "relativePath": [ "lib", "commands", "apex", "list", "log.js" ], "aliasPermutations": [ "force:apex:log:list", "apex:force:log:list", "apex:log:force:list", "apex:log:list:force", "force:log:apex:list", "log:force:apex:list", "log:apex:force:list", "log:apex:list:force", "force:log:list:apex", "log:force:list:apex", "log:list:force:apex", "log:list:apex:force", "force:apex:list:log", "apex:force:list:log", "apex:list:force:log", "apex:list:log:force", "force:list:apex:log", "list:force:apex:log", "list:apex:force:log", "list:apex:log:force", "force:list:log:apex", "list:force:log:apex", "list:log:force:apex", "list:log:apex:force" ], "permutations": [ "apex:list:log", "list:apex:log", "list:log:apex", "apex:log:list", "log:apex:list", "log:list:apex" ] }, "apex:get:log": { "aliases": [ "force:apex:log:get" ], "args": {}, "deprecateAliases": true, "description": "To get the IDs for your debug logs, run \"<%= config.bin %> apex log list\". Executing this command without flags returns the most recent log.", "examples": [ "Fetch the log in your default org using an ID:\n<%= config.bin %> <%= command.id %> --log-id <log id>", "Fetch the log in the org with the specified username using an ID:\n<%= config.bin %> <%= command.id %> --log-id <log id> --target-org me@my.org", "Fetch the two most recent logs in your default org:\n<%= config.bin %> <%= command.id %> --number 2", "Similar to previous example, but save the two log files in the specified directory:\n<%= config.bin %> <%= command.id %> --output-dir /Users/sfdxUser/logs --number 2" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "log-id": { "aliases": [ "logid" ], "char": "i", "deprecateAliases": true, "name": "log-id", "summary": "ID of the specific log to display.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "number": { "char": "n", "name": "number", "summary": "Number of the most recent logs to display.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "output-dir": { "aliases": [ "outputdir", "output-directory" ], "char": "d", "deprecateAliases": true, "description": "The location can be an absolute path or relative to the current working directory. The default is the current directory.", "name": "output-dir", "summary": "Directory for saving the log files.", "hasDynamicHelp": false, "multiple": false, "type": "option" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "apex:get:log", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "strict": true, "summary": "Fetch the specified log or given number of most recent logs from the org.", "enableJsonFlag": true, "isESM": true, "relativePath": [ "lib", "commands", "apex", "get", "log.js" ], "aliasPermutations": [ "force:apex:log:get", "apex:force:log:get", "apex:log:force:get", "apex:log:get:force", "force:log:apex:get", "log:force:apex:get", "log:apex:force:get", "log:apex:get:force", "force:log:get:apex", "log:force:get:apex", "log:get:force:apex", "log:get:apex:force", "force:apex:get:log", "apex:force:get:log", "apex:get:force:log", "apex:get:log:force", "force:get:apex:log", "get:force:apex:log", "get:apex:force:log", "get:apex:log:force", "force:get:log:apex", "get:force:log:apex", "get:log:force:apex", "get:log:apex:force" ], "permutations": [ "apex:get:log", "get:apex:log", "get:log:apex", "apex:log:get", "log:apex:get", "log:get:apex" ] }, "apex:get:test": { "aliases": [ "force:apex:test:report" ], "args": {}, "deprecateAliases": true, "description": "Provide a test run ID to display test results for an enqueued or completed asynchronous test run. The test run ID is displayed after running the \"<%= config.bin %> apex test run\" command.\n\nTo see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for classes in your org. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.", "examples": [ "Display test results for your default org using a test run ID:\n<%= config.bin %> <%= command.id %> --test-run-id <test run id>", "Similar to previous example, but output the result in JUnit format:\n<%= config.bin %> <%= command.id %> --test-run-id <test run id> --result-format junit", "Also retrieve code coverage results and output in JSON format:\n<%= config.bin %> <%= command.id %> --test-run-id <test run id> --code-coverage --json", "Specify a directory in which to save the test results from the org with the specified username (rather than your default org):\n<%= config.bin %> <%= command.id %> --test-run-id <test run id> --code-coverage --output-dir <path to outputdir> --target-org me@myorg'" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "test-run-id": { "aliases": [ "testrunid" ], "char": "i", "deprecateAliases": true, "name": "test-run-id", "required": true, "summary": "ID of the test run.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "code-coverage": { "aliases": [ "codecoverage" ], "char": "c", "deprecateAliases": true, "name": "code-coverage", "summary": "Retrieve code coverage results.", "allowNo": false, "type": "boolean" }, "detailed-coverage": { "dependsOn": [ "code-coverage" ], "name": "detailed-coverage", "summary": "Display detailed code coverage per test.", "allowNo": false, "type": "boolean" }, "output-dir": { "aliases": [ "outputdir", "output-directory" ], "char": "d", "deprecateAliases": true, "name": "output-dir", "summary": "Directory in which to store test result files.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "result-format": { "aliases": [ "resultformat" ], "char": "r", "deprecateAliases": true, "name": "result-format", "summary": "Format of the test results.", "default": "human", "hasDynamicHelp": false, "multiple": false, "options": [ "human", "tap", "junit", "json" ], "type": "option" }, "concise": { "name": "concise", "summary": "Display only failed test results; works with human-readable output only.", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "apex:get:test", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "strict": true, "summary": "Display test results for a specific asynchronous test run.", "enableJsonFlag": true, "isESM": true, "relativePath": [ "lib", "commands", "apex", "get", "test.js" ], "aliasPermutations": [ "force:apex:test:report", "apex:force:test:report", "apex:test:force:report", "apex:test:report:force", "force:test:apex:report", "test:force:apex:report", "test:apex:force:report", "test:apex:report:force", "force:test:report:apex", "test:force:report:apex", "test:report:force:apex", "test:report:apex:force", "force:apex:report:test", "apex:force:report:test", "apex:report:force:test", "apex:report:test:force", "force:report:apex:test", "report:force:apex:test", "report:apex:force:test", "report:apex:test:force", "force:report:test:apex", "report:force:test:apex", "report:test:force:apex", "report:test:apex:force" ], "permutations": [ "apex:get:test", "get:apex:test", "get:test:apex", "apex:test:get", "test:apex:get", "test:get:apex" ] }, "apex:run:test": { "aliases": [ "force:apex:test:run" ], "args": {}, "deprecateAliases": true, "description": "Specify which tests to run by using the --class-names, --suite-names, or --tests flags. Alternatively, use the --test-level flag to run all the tests in your org, local tests, or specified tests.\n\nTo see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for classes in your org. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.\n\nBy default, Apex tests run asynchronously and immediately return a test run ID. You can use the --wait flag to specify the number of minutes to wait; if the tests finish in that timeframe, the command displays the results. If the tests haven't finished by the end of the wait time, the command displays a test run ID. Use the \"<%= config.bin %> apex get test --test-run-id\" command to get the results.\n\nTo run both Apex and Flow tests together, run the \"sf logic run test\" CLI command, which has similar flags as this command, but expands the --tests flag to also include Flow tests.\n\nYou must have the \"View All Data\" system permission to use this command. The permission is disabled by default and can be enabled only by a system administrator.\n\nNOTE: The testRunCoverage value (JSON and JUnit result formats) is a percentage of the covered lines and total lines from all the Apex classes evaluated by the tests in this run.", "examples": [ "Run all Apex tests and suites in your default org:\n<%= config.bin %> <%= command.id %>", "Run the specified Apex test classes in your default org and display results in human-readable form:\n<%= config.bin %> <%= command.id %> --class-names MyClassTest --class-names MyOtherClassTest --result-format human", "Run the specified Apex test suites in your default org and include code coverage results and additional details:\n<%= config.bin %> <%= command.id %> --suite-names MySuite --suite-names MyOtherSuite --code-coverage --detailed-coverage", "Run the specified Apex tests in your default org and display results in human-readable output:\n<%= config.bin %> <%= command.id %> --tests MyClassTest.testCoolFeature --tests MyClassTest.testAwesomeFeature --tests AnotherClassTest --tests namespace.TheirClassTest.testThis --result-format human", "Run all tests in the org with the specified username with the specified test level; save the output to the specified directory:\n<%= config.bin %> <%= command.id %> --test-level RunLocalTests --output-dir <path to outputdir> --target-org me@my.org", "Run all tests in the org asynchronously:\n<%= config.bin %> <%= command.id %> --target-org myscratch", "Run all tests synchronously; the command waits to display the test results until all tests finish:\n<%= config.bin %> <%= command.id %> --synchronous", "Run specific tests using the --test-level flag:\n<%= config.bin %> <%= command.id %> --test-level RunLocalTests", "Run Apex tests on all the methods in the specified class; output results in Test Anything Protocol (TAP) format and request code coverage results:\n<%= config.bin %> <%= command.id %> --class-names TestA --class-names TestB --result-format tap --code-coverage", "Run Apex tests on methods specified using the standard Class.method notation; if you specify a test class without a method, the command runs all methods in the class:\n<%= config.bin %> <%= command.id %> --tests TestA.excitingMethod --tests TestA.boringMethod --tests TestB", "Run Apex tests on methods specified using the standard Class.method notation with a namespace:\n<%= config.bin %> <%= command.id %> --tests ns.TestA.excitingMethod --tests ns.TestA.boringMethod --tests ns.TestB" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "code-coverage": { "aliases": [ "codecoverage" ], "char": "c", "deprecateAliases": true, "name": "code-coverage", "summary": "Retrieve code coverage results.", "allowNo": false, "type": "boolean" }, "output-dir": { "aliases": [ "outputdir", "output-directory" ], "char": "d", "deprecateAliases": true, "name": "output-dir", "summary": "Directory in which to store test run files.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "test-level": { "aliases": [ "testlevel" ], "char": "l", "deprecateAliases": true, "description": "Here's what the levels mean:\n\n- RunSpecifiedTests — Only the tests that you specify in the runTests option are run. Code coverage requirements differ from the default coverage requirements when using this test level. The executed tests must cover each class and trigger in the deployment package for a minimum of 75% code coverage. This coverage is computed for each class and triggers individually, and is different than the overall coverage percentage.\n- RunLocalTests — All local tests in your org, including tests that originate from no-namespaced unlocked packages, are run. The tests that originate from installed managed packages and namespaced unlocked packages aren't run. This test level is the default for production deployments that include Apex classes or triggers.\n- RunAllTestsInOrg — All tests are run. The tests include all tests in your org.", "name": "test-level", "summary": "Level of tests to run; default is RunLocalTests.", "hasDynamicHelp": false, "multiple": false, "options": [ "RunLocalTests", "RunAllTestsInOrg", "RunSpecifiedTests" ], "type": "option" }, "class-names": { "aliases": [ "classnames" ], "char": "n", "deprecateAliases": true, "description": "If you select --class-names, you can't specify --suite-names or --tests.\nFor multiple classes, repeat the flag for each.\n--class-names Class1 --class-names Class2", "exclusive": [ "suite-names", "tests" ], "name": "class-names", "summary": "Apex test class names to run; default is all classes.", "delimiter": ",", "hasDynamicHelp": false, "multiple": true, "type": "option" }, "result-format": { "aliases": [ "resultformat" ], "char": "r", "deprecateAliases": true, "name": "result-format", "summary": "Format of the test results.", "default": "human", "hasDynamicHelp": false, "multiple": false, "options": [ "human", "tap", "junit", "json" ], "type": "option" }, "suite-names": { "aliases": [ "suitenames" ], "char": "s", "deprecateAliases": true, "description": "If you select --suite-names, you can't specify --class-names or --tests.\nFor multiple suites, repeat the flag for each.\n--suite-names Suite1 --suite-names Suite2", "exclusive": [ "class-names", "tests" ], "name": "suite-names", "summary": "Apex test suite names to run.", "delimiter": ",", "hasDynamicHelp": false, "multiple": true, "type": "option" }, "tests": { "char": "t", "description": "If you specify --tests, you can't specify --class-names or --suite-names\nFor multiple tests, repeat the flag for each.\n--tests Test1 --tests Test2", "exclusive": [ "class-names", "suite-names" ], "name": "tests", "summary": "Apex test class names or IDs and, if applicable, test methods to run; default is all tests.", "delimiter": ",", "hasDynamicHelp": false, "multiple": true, "type": "option" }, "poll-interval": { "char": "i", "name": "poll-interval", "summary": "Number of seconds to wait between retries.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "wait": { "char": "w", "name": "wait", "summary": "Sets the streaming client socket timeout in minutes; specify a longer wait time if timeouts occur frequently.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "synchronous": { "char": "y", "name": "synchronous", "summary": "Runs test methods from a single Apex class synchronously; if not specified, tests are run asynchronously.", "allowNo": false, "type": "boolean" }, "detailed-coverage": { "aliases": [ "detailedcoverage" ], "char": "v", "dependsOn": [ "code-coverage" ], "deprecateAliases": true, "name": "detailed-coverage", "summary": "Display detailed code coverage per test.", "allowNo": false, "type": "boolean" }, "concise": { "name": "concise", "summary": "Display only failed test results; works with human-readable output only.", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "apex:run:test", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "strict": true, "summary": "Invoke Apex tests in an org.", "enableJsonFlag": true, "isESM": true, "relativePath": [ "lib", "commands", "apex", "run", "test.js" ], "aliasPermutations": [ "force:apex:test:run", "apex:force:test:run", "apex:test:force:run", "apex:test:run:force", "force:test:apex:run", "test:force:apex:run", "test:apex:force:run", "test:apex:run:force", "force:test:run:apex", "test:force:run:apex", "test:run:force:apex", "test:run:apex:force", "force:apex:run:test", "apex:force:run:test", "apex:run:force:test", "apex:run:test:force", "force:run:apex:test", "run:force:apex:test", "run:apex:force:test", "run:apex:test:force", "force:run:test:apex", "run:force:test:apex", "run:test:force:apex", "run:test:apex:force" ], "permutations": [ "apex:run:test", "run:apex:test", "run:test:apex", "apex:test:run", "test:apex:run", "test:run:apex" ] }, "apex:tail:log": { "aliases": [ "force:apex:log:tail" ], "args": {}, "deprecateAliases": true, "description": "You can also pipe the logs to a file.", "examples": [ "Activate debug logging:\n<%= config.bin %> <%= command.id %>", "Specify a debug level:\n<%= config.bin %> <%= command.id %> --debug-level MyDebugLevel", "Skip the trace flag setup and apply default colors:\n<%= config.bin %> <%= command.id %> --color --skip-trace-flag" ], "flags": { "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "color": { "char": "c", "name": "color", "summary": "Apply default colors to noteworthy log lines.", "allowNo": false, "type": "boolean" }, "debug-level": { "aliases": [ "debuglevel" ], "char": "d", "deprecateAliases": true, "exclusive": [ "skip-trace-flag" ], "name": "debug-level", "summary": "Debug level to set on the DEVELOPER_LOG trace flag for your user.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "skip-trace-flag": { "aliases": [ "skiptraceflag" ], "char": "s", "deprecateAliases": true, "name": "skip-trace-flag", "summary": "Skip trace flag setup. Assumes that a trace flag and debug level are fully set up.", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "apex:tail:log", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "strict": true, "summary": "Activate debug logging and display logs in the terminal.", "enableJsonFlag": false, "isESM": true, "relativePath": [ "lib", "commands", "apex", "tail", "log.js" ], "aliasPermutations": [ "force:apex:log:tail", "apex:force:log:tail", "apex:log:force:tail", "apex:log:tail:force", "force:log:apex:tail", "log:force:apex:tail", "log:apex:force:tail", "log:apex:tail:force", "force:log:tail:apex", "log:force:tail:apex", "log:tail:force:apex", "log:tail:apex:force", "force:apex:tail:log", "apex:force:tail:log", "apex:tail:force:log", "apex:tail:log:force", "force:tail:apex:log", "tail:force:apex:log", "tail:apex:force:log", "tail:apex:log:force", "force:tail:log:apex", "tail:force:log:apex", "tail:log:force:apex", "tail:log:apex:force" ], "permutations": [ "apex:tail:log", "tail:apex:log", "tail:log:apex", "apex:log:tail", "log:apex:tail", "log:tail:apex" ] }, "logic:get:test": { "aliases": [], "args": {}, "description": "When you run 'sf logic run test' to test Apex classes and Flows asynchronously, it returns a test run ID. Use that ID with this command to see the results.\n\nTo see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for classes in your org. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.", "examples": [ "Get the results for a specific test run ID in the default human-readable format; uses your default org:\n<%= config.bin %> <%= command.id %> --test-run-id <test run id>", "Get the results for a specific test run ID, format them as JUnit, and save them to the \"test-results/junit\" directory; uses the org with alias \"my-scratch\":\n<%= config.bin %> <%= command.id %> --test-run-id <test run id> --result-format junit --target-org my-scratch" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "test-run-id": { "aliases": [ "testrunid" ], "char": "i", "deprecateAliases": true, "name": "test-run-id", "required": true, "summary": "ID of the test run.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "code-coverage": { "aliases": [ "codecoverage" ], "char": "c", "deprecateAliases": true, "name": "code-coverage", "summary": "Retrieve code coverage results.", "allowNo": false, "type": "boolean" }, "detailed-coverage": { "dependsOn": [ "code-coverage" ], "name": "detailed-coverage", "summary": "Display detailed code coverage per test.", "allowNo": false, "type": "boolean" }, "output-dir": { "aliases": [ "outputdir", "output-directory" ], "char": "d", "deprecateAliases": true, "name": "output-dir", "summary": "Directory in which to store test result files.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "result-format": { "aliases": [ "resultformat" ], "char": "r", "deprecateAliases": true, "name": "result-format", "summary": "Format of the test results.", "default": "human", "hasDynamicHelp": false, "multiple": false, "options": [ "human", "tap", "junit", "json" ], "type": "option" }, "concise": { "name": "concise", "summary": "Display only failed test results; works with human-readable output only.", "allowNo": false, "type": "boolean" } }, "hasDynamicHelp": true, "hiddenAliases": [], "id": "logic:get:test", "pluginAlias": "@salesforce/plugin-apex", "pluginName": "@salesforce/plugin-apex", "pluginType": "core", "state": "beta", "strict": true, "summary": "Get the results of a test run.", "enableJsonFlag": true, "isESM": true, "relativePath": [ "lib", "commands", "logic", "get", "test.js" ], "aliasPermutations": [], "permutations": [ "logic:get:test", "get:logic:test", "get:test:logic", "logic:test:get", "test:logic:get", "test:get:logic" ] }, "logic:run:test": { "aliases": [], "args": {}, "description": "This command provides a single and unified way to run tests for multiple Salesforce features, such as Apex classes and Flows. Running the tests together with a single command ensures seamless interoperability between the features.\n\nBy default, the command executes asynchronously and returns a test run ID. Then use the \"sf logic get test\" command to retrieve the results. If you want to wait for the test run to complete and see the results in the command output, use the --synchronous flag.\n\nTo run specific tests, use the --tests flag and pass it the names of Apex and Flow tests. For Apex, simply specify the name of the Apex test class. For Flows, use the format \"FlowTesting.<name-of-flow-test>\". To find the name of all the flow tests in your org, run this command and specify the Flow category, such as \"sf logic run test --synchronous --test-category Flow --test-level RunAllTestsInOrg\". The command displays a table of all the flow tests it ran; see the \"TEST NAME\" column for the full name of all available flow tests in your org.\n\nYou can also run specific test methods, although if you run the tests synchronously, the methods must belong to a single Apex class or Flow test. To run all tests of a certain category, use --test-category and --test-level together. If neither of these flags is specified, all local tests for all categories are run by default. You can also use the --class-names and --suite-names flags to run Apex test classes or suites.\n\nTo see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for the tested classes or flows. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.\n\nYou must have the \"View All Data\" org system permission to use this command. The permission is disabled by default and can be enabled only by a system administrator.", "examples": [ "Run a mix of specific Apex and Flow tests asynchronously in your default org:\n<%= config.bin %> <%= command.id %> --tests MyApexClassTest,FlowTesting.Modify_Account_Desc.Modify_Account_Desc_TestAccountDescription", "Run all local Apex and Flow tests and wait for the results to complete; run the tests in the org with alias \"my-scratch\":\n<%= config.bin %> <%= command.id %> --test-level RunLocalTests --test-category Apex --test-category Flow --synchronous --target-org my-scratch", "Run two methods in an Apex test class and an Apex test suite:\n<%= config.bin %> <%= command.id %> --class-names MyApexClassTest.methodA --class-names MyApexClassTest.methodB --suite-names MySuite", "Run all local tests for all categories (the default behavior), save the JUnit results to the \"test-results\" directory, and include code coverage results:\n<%= config.bin %> <%= command.id %> --result-format junit --output-dir test-results --synchronous --code-coverage" ], "flags": { "json": { "description": "Format output as json.", "helpGroup": "GLOBAL", "name": "json", "allowNo": false, "type": "boolean" }, "flags-dir": { "helpGroup": "GLOBAL", "name": "flags-dir", "summary": "Import flag values from a directory.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "target-org": { "aliases": [ "targetusername", "u" ], "char": "o", "deprecateAliases": true, "name": "target-org", "noCacheDefault": true, "required": true, "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.", "hasDynamicHelp": true, "multiple": false, "type": "option" }, "api-version": { "aliases": [ "apiversion" ], "deprecateAliases": true, "description": "Override the api version used for api requests made by this command", "name": "api-version", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "loglevel": { "deprecated": { "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable." }, "hidden": true, "name": "loglevel", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "code-coverage": { "aliases": [ "codecoverage" ], "char": "c", "deprecateAliases": true, "name": "code-coverage", "summary": "Retrieve code coverage results.", "allowNo": false, "type": "boolean" }, "output-dir": { "aliases": [ "outputdir", "output-directory" ], "char": "d", "deprecateAliases": true, "name": "output-dir", "summary": "Directory in which to store test run files.", "hasDynamicHelp": false, "multiple": false, "type": "option" }, "test-level": { "aliases": [ "testlevel" ], "char": "l", "deprecateAliases": true, "description": "Here's what the levels mean:\n\n- RunSpecifiedTests — Only the tests that you specify in the runTests option are run. Code coverage requirements differ from the default coverage requirements when using this test level. The executed tests must cover each class and trigger in the deployment package for a minimum of 75% code coverage. This coverage is computed for each class and triggers individually, and is different than the overall coverage percentage.\n- RunLocalTests — All local tests in your org, including tests that originate from no-namespaced unlocked packages, are run. The tests that originate from installed managed packages and namespaced unlocked packages aren't run. This test level is the default for production deployments that include Apex classes or triggers.\n- RunAllTestsInOrg — All tests are run. The tests include all tests in your org.", "name": "test-level", "summary": "Level of tests to run; default is RunLocalTests.", "hasDynamicHelp": false, "multiple": false, "options": [ "RunLocalTests", "RunAllTestsInOrg", "RunSpecifiedTests" ], "type": "option" }, "class-names": { "aliases": [ "classnames" ], "char": "n", "deprecateAliases": true, "description": "If you select --class-names, you can't specify --suite-names or --tests.\nFor multiple classes, repeat the flag for each.\n--class-names Class1 --class-names Class2",