---
schema_version: "1"
id: 28eaed6006e09f56e4441278a0b95f4cfd036103a53e404a1be472ed614c98df
title: Keep Up with the Latest Salesforce CLI Enhancements
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/260-0-0/rn_tools_cli_enhancements.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_tools_cli_enhancements.htm&release=260&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 9e4367d2fd32e96cde88ce90b3a4735766e9cd89423d49fde17ce105fcd55d37
description: Stay up to date with recent Salesforce CLI enhancements.
products:
  - Cross Cloud Packages Solutions
release: "260"
---
# Keep Up with the Latest Salesforce CLI Enhancements

Stay up to date with recent Salesforce CLI enhancements.

**Where:** These changes apply to Salesforce CLI version 2.104.6 and later.

**How:** Read the [Salesforce CLI weekly release notes](https://github.com/forcedotcom/cli/blob/main/releasenotes/README.md#salesforce-cli-release-notes) for detailed information about all the new and changed features and issue fixes in recent releases.

## Improve Deploy Performance by Running Only Relevant Apex Tests

Run only relevant Apex tests when you deploy metadata to your org. Use the new `RunRelevantTests` value of the `--test-level` flag of the `project deploy start|validate` commands. You can also use the same flag with the `project delete source` command.

Salesforce automatically identifies the relevant tests based on an analysis of the deployment payload and the payload dependencies.

This example deploys source files in the `force-app` package directory to the org with the alias `my-scratch` and runs only relevant Apex tests:

```
sf project deploy start --source-dir force-app --test-level RunRelevantTests --target-org my-scratch
```

## Run Apex and Flow Tests with a Single CLI Command (Beta)

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-salesforce_release_notes-260-0-0-production-enus/ba62a63b-6cd1-440e-8d24-e867afab0363/images/icon_note.png)

Note This feature is a beta service that is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/agreements/) or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the [Product Terms Directory](https://ptd.salesforce.com/). Use of this pilot or beta service is at the Customer's sole discretion.

Ensure interoperability between Apex classes and flows by running their tests in a single and unified way with these new CLI commands:

- `logic run test`: Run tests for Apex and Flows in an org.
- `logic get test`: Get the results of an async test run, or if it timed out.

Many flags of these new commands mimic the flags for the existing `apex run|get test` and `flow run|get test` commands, such as `--tests`, `--test-level`, `--code-coverage`, `--class-names`, and `--output-dir`. But the new `logic run test` command expands the `--tests` flag so that you can specify both Apex and flow tests and adds a `--test-category` flag to narrow the type of tests you want to run.

By default, the logic run test command runs asynchronously and returns a test run ID. Then use the `logic get test` command to retrieve the results.

This example runs all local Apex and flow tests in the org with the alias `my-scratch` asynchronously:

```
sf logic run test --test-level RunLocalTests --test-category Apex --test-category Flow --target-org my-scratch
```

The command returns a test run ID that you pass to the `logic get test` command to get the test results:

```
sf logic get test --test-run-id <test-run-id>
```

## Retrieve Package Metadata for a Specified Package Version

You can retrieve package metadata for only second-generation managed package versions or unlocked packages.

This example shows how to retrieve package metadata for a converted subscriber package version ID (starts with 04t) into `my-directory` in your Salesforce DX project directory:

```
sf package version retrieve --package 04tXXX --output-dir my-directory --target-dev-hub devhub@example.com
```

## Customize the Timeout When Attempting to Log Into an Org

If you try to authorize an org with the `org login web` CLI command, and it runs into an issue, the CLI command now times out after 2 minutes, rather than hanging indefinitely. Customize the number of milliseconds that the command waits to time out with the new `SF_WEB_OAUTH_SERVER_TIMEOUT` environment variable. The default value is `120000` (2 minutes).

This example sets the timeout to 3 minutes:

```
export SF_WEB_OAUTH_SERVER_TIMEOUT=180000
```

## Customize the Apex Test Polling Interval

Specify the number of seconds to poll the org to check for the test status when you run `apex test run` with the new `--poll-interval` flag. Previously the poll interval was hard-coded to 1 second. This example shows how to set the poll interval to 5 seconds:

```
sf apex run test --class-names MyClassTest --result-format human --poll-interval 5 --target-org my-org
```

#### See Also

- [Deploy Apex Components Faster by Running Only Relevant Tests (Beta)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_run_relevant_tests.htm&release=260&type=5 "To reduce Apex component deployment time, use the new RunRelevantTests test level to run only the tests relevant to your code changes. This feature automatically determines which tests to run based on an analysis of the deployment payload and the payload dependencies. For fine-grained control, you can annotate test classes so that they either run regardless of the deployment payload, or run when specified components are new or modified. This targeted approach boosts the speed and reliability of your deployment while maintaining code quality and coverage requirements.")
- [_Salesforce CLI Command Reference_: project Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm)
- [_Salesforce CLI Command Reference_: logic Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_logic_commands_unified.htm)
- [_Salesforce CLI Command Reference_: apex Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_apex_commands_unified.htm)
- [_Salesforce CLI Command Reference_: package Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm)
- [_Salesforce CLI Setup Guide_: Environment Variables](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_env_variables.htm)