Skip to content

DEX CLI commands

Use Cloudflare CLI (cf) cf zero-trust dex commands to manage DEX tests and rules, run remote captures and speed tests, and query fleet and test data from the command line. To get started, install cf and sign in with cf auth login, or set CLOUDFLARE_API_TOKEN to an API token with Cloudflare DEX Read permission (or Cloudflare DEX Write to make changes).

zero-trust dex tests

Create and manage synthetic tests that run from devices in your fleet. tests update replaces the whole test, so pass the test's current name, data, interval, and enabled values along with your changes. If you omit --target-policies, the test keeps its existing rules.

zero-trust dex tests create

Create a DEX test.

cf zero-trust dex tests create [options]
  • --data-hoststring required

    The desired endpoint to test.

  • --data-kind"http" | "traceroute" required

    The type of test.

  • --data-method"GET"

    The HTTP request method type.

  • --descriptionstring

    Additional details about the test.

  • --enabledboolean required

    Determines whether or not the test is active.

  • --intervalstring required

    How often the test will run.

  • --namestring required

    The name of the DEX test. Must be unique.

  • --target-policiesstring

    DEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"id": string, "default"?: boolean, "name"?: string}]. ? marks optional keys.

  • --targetedboolean

    The targeted field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dex tests delete

Delete a Device DEX test. Returns the remaining device dex tests for the account.

cf zero-trust dex tests delete <dex-test-id>
  • <DEX-TEST-ID>string required

    Unique identifier for a DEX test.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dex tests get

Fetch a single DEX test.

cf zero-trust dex tests get <dex-test-id>
  • <DEX-TEST-ID>string required

    Unique identifier for a DEX test.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex tests list

Fetch all DEX tests.

cf zero-trust dex tests list [options]
  • --pagenumber

    Page number of paginated results.

  • --per-pagenumber

    Number of results per page.

  • --test-namestring

    Filter by test name.

  • --kind"http" | "traceroute"

    Filter by test type.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex tests network-path get

Get a breakdown of metrics by hop for individual traceroute test runs.

cf zero-trust dex tests network-path get <test-id> [options]
  • <TEST-ID>string required

    Unique identifier for a specific test.

  • --device-idstring required

    Device to filter traceroute result runs to.

  • --fromstring required

    Start time for aggregate metrics in ISO ms.

  • --tostring required

    End time for aggregate metrics in ISO ms.

  • --interval"minute" | "hour" required

    Time interval for aggregate time slots.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex tests update

Update a DEX test.

cf zero-trust dex tests update <dex-test-id> [options]
  • <DEX-TEST-ID>string required

    Unique identifier for a DEX test.

  • --data-hoststring required

    The desired endpoint to test.

  • --data-kind"http" | "traceroute" required

    The type of test.

  • --data-method"GET"

    The HTTP request method type.

  • --descriptionstring

    Additional details about the test.

  • --enabledboolean required

    Determines whether or not the test is active.

  • --intervalstring required

    How often the test will run.

  • --namestring required

    The name of the DEX test. Must be unique.

  • --target-policiesstring

    DEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"id": string, "default"?: boolean, "name"?: string}]. ? marks optional keys.

  • --targetedboolean

    The targeted field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dex rules

Create and manage DEX rules that scope tests to groups of users and devices. rules get returns targeted_tests, the tests that use the rule.

zero-trust dex rules create

Create a DEX Rule.

cf zero-trust dex rules create [options]
  • --descriptionstring

    The description field

  • --matchstring required

    The wirefilter expression to match.

  • --namestring required

    The name of the Rule.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dex rules delete

Delete a DEX Rule.

cf zero-trust dex rules delete <rule-id>
  • <RULE-ID>string required

    Unique identifier of the rule.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dex rules get

Get details for a DEX Rule.

cf zero-trust dex rules get <rule-id>
  • <RULE-ID>string required

    Unique identifier of the rule.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex rules list

List DEX Rules.

cf zero-trust dex rules list [options]
  • --pagenumber required

    Page number of paginated results.

  • --per-pagenumber required

    Number of results per page.

  • --sort-order"ASC" | "DESC"

    Sort direction for sort_by property.

  • --sort-by"name" | "created_at" | "updated_at"

    Which property to sort results by.

  • --namestring

    Filter results by rule name.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex rules update

Update a DEX Rule.

cf zero-trust dex rules update <rule-id> [options]
  • <RULE-ID>string required

    Unique identifier of the rule.

  • --descriptionstring

    The description field

  • --matchstring

    The wirefilter expression to match.

  • --namestring

    The name of the Rule.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dex commands

Run remote captures and speed tests on devices, and check their status and quota.

zero-trust dex commands create

Initiate commands for up to 10 devices per account.

cf zero-trust dex commands create [options]
  • --commandsstring required

    List of device-level commands to execute. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"device_id": string, "type": "pcap" | "speed-test" | "warp-diag", "user_email": string, "args"?: {...}, "registration_id"?: string}]. ? marks optional keys.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dex commands eligible-devices list

List devices with WARP client support for remote captures which have been connected in the last 1 hour.

cf zero-trust dex commands eligible-devices list [options]
  • --pagenumber required

    Page number of paginated results.

  • --per-pagenumber required

    Number of results per page.

  • --searchstring

    Filter devices by name or email.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex commands list

Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters

cf zero-trust dex commands list [options]
  • --pagenumber required

    Page number of paginated results.

  • --per-pagenumber required

    Number of results per page.

  • --fromstring

    Start time for the query in ISO (RFC3339 - ISO 8601) format.

  • --tostring

    End time for the query in ISO (RFC3339 - ISO 8601) format.

  • --device-idstring

    Unique identifier for a device.

  • --user-emailstring

    Email tied to the device.

  • --command-type"pcap" | "speed-test" | "warp-diag"

    Optionally filter executed commands by command type.

  • --status"PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"

    Optionally filter executed commands by status.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex commands quota get

Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset

cf zero-trust dex commands quota get
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex commands results get

Downloads artifacts for an executed command. Bulk downloads are not supported

cf zero-trust dex commands results get <filename> [options]
  • <FILENAME>string required

    The name of the file to be downloaded, including the .zip extension.

  • --command-idstring required

    Unique identifier for command.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --textboolean default: false

    Decode the response body as UTF-8 text instead of writing raw bytes

zero-trust dex test-results

Get detailed results, percentiles, and network paths for individual tests.

zero-trust dex test-results http get

Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days.

cf zero-trust dex test-results http get <test-id> [options]
  • <TEST-ID>string required

    Unique identifier for a specific test.

  • --device-idstring

    Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

  • --fromstring required

    Start time for aggregate metrics in ISO ms.

  • --tostring required

    End time for aggregate metrics in ISO ms.

  • --interval"minute" | "hour" required

    Time interval for aggregate time slots.

  • --colostring

    Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex test-results http percentiles get

Get percentiles for an http test for a given time period between 1 hour and 7 days.

cf zero-trust dex test-results http percentiles get <test-id> [options]
  • <TEST-ID>string required

    Unique identifier for a specific test.

  • --device-idstring

    Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

  • --fromstring required

    Start time for the query in ISO (RFC3339 - ISO 8601) format.

  • --tostring required

    End time for the query in ISO (RFC3339 - ISO 8601) format.

  • --colostring

    Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex test-results traceroute get

Get test details and aggregate performance metrics for a traceroute test for a given time period between 1 hour and 7 days.

cf zero-trust dex test-results traceroute get <test-id> [options]
  • <TEST-ID>string required

    Unique identifier for a specific test.

  • --device-idstring

    Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

  • --fromstring required

    Start time for aggregate metrics in ISO ms.

  • --tostring required

    End time for aggregate metrics in ISO ms.

  • --interval"minute" | "hour" required

    Time interval for aggregate time slots.

  • --colostring

    Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex test-results traceroute network-path get

Get a breakdown of hops and performance metrics for a specific traceroute test run

cf zero-trust dex test-results traceroute network-path get <test-result-id>
  • <TEST-RESULT-ID>string required

    Unique identifier for a specific traceroute test.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex test-results traceroute percentiles get

Get percentiles for a traceroute test for a given time period between 1 hour and 7 days.

cf zero-trust dex test-results traceroute percentiles get <test-id> [options]
  • <TEST-ID>string required

    Unique identifier for a specific test.

  • --device-idstring

    Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

  • --fromstring required

    Start time for the query in ISO (RFC3339 - ISO 8601) format.

  • --tostring required

    End time for the query in ISO (RFC3339 - ISO 8601) format.

  • --colostring

    Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex overview

Get availability and response time summaries across all tests.

zero-trust dex overview tests list

List DEX tests with overview metrics.

cf zero-trust dex overview tests list [options]
  • --colostring

    Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.

  • --test-namestring

    Optionally filter results by test name.

  • --device-idstring

    Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

  • --registration-idstring

    Optionally filter results to a specific device registration. Must be used in combination with a single deviceId.

  • --pagenumber

    Page number of paginated results

  • --per-pagenumber

    Number of items per page

  • --kind"http" | "traceroute"

    Filter by test type.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex overview tests unique-devices get

Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days.

cf zero-trust dex overview tests unique-devices get [options]
  • --test-namestring

    Optionally filter results by test name.

  • --device-idstring

    Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex devices

Get fleet status and device monitoring data for your fleet or for individual devices.

zero-trust dex devices aggregates live get

Get details for live (up to 60 minutes) devices using WARP.

cf zero-trust dex devices aggregates live get [options]
  • --since-minutesnumber required

    Number of minutes before current time.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex devices aggregates over-time get

Get aggregate details for devices using WARP, up to 7 days.

cf zero-trust dex devices aggregates over-time get [options]
  • --tostring required

    End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.

  • --fromstring required

    Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.

  • --colostring

    Cloudflare colo airport code.

  • --device-idstring

    Device-specific ID, given as UUID.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex devices get

Get the latest status of a device given device_id from the device_state table.

cf zero-trust dex devices get <device-id> [options]
  • <DEVICE-ID>string required

    Device-specific ID, given as UUID.

  • --since-minutesnumber required

    Number of minutes before current time.

  • --time-nowstring

    Current time in ISO format.

  • --colostring

    List of data centers to filter results.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex devices list

List details of devices using WARP.

cf zero-trust dex devices list [options]
  • --tostring required

    End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.

  • --fromstring required

    Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.

  • --pagenumber required

    Page number of paginated results.

  • --per-pagenumber required

    Number of results per page.

  • --sort-by"colo" | "device_id" | "mode" | "platform" | "status" | "timestamp" | "version"

    Dimension to sort results by.

  • --colostring

    Cloudflare colo airport code.

  • --device-idstring

    Device-specific ID, given as UUID.

  • --device-modestring

    The mode under which the WARP client is run.

  • --statusstring

    Network status.

  • --platformstring

    Operating system.

  • --warp-versionstring

    WARP client version.

  • --source"last_seen" | "hourly" | "raw"

    Source:

    • hourly - device details aggregated hourly, up to 7 days prior
    • last_seen - device details, up to 60 minutes prior. Time windows exceeding 60 minutes will be rejected from June 1st, 2026. Please use 'hourly' or 'raw' instead for longer time ranges.
    • raw - device details, up to 7 days prior
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex devices over-time get

Get time-bucketed status metrics for a specific device.

cf zero-trust dex devices over-time get <device-id> [options]
  • <DEVICE-ID>string required

    Device-specific ID, given as UUID.

  • --fromstring required

    Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.

  • --tostring required

    End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.

  • --interval"minute" | "hour" required

    Time interval for aggregate time slots.

  • --colostring

    List of data centers to filter results.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex isps

List the ISPs a device has connected through, for IP visibility.

zero-trust dex isps list

List ISP information observed for a specific device during traceroute tests.

cf zero-trust dex isps list [options]
  • --device-idstring required

    Device-specific ID, given as UUID.

  • --pagenumber

    Page number of paginated results. Mutually exclusive with cursor.

  • --per-pagenumber required

    Number of items per page

  • --cursorstring

    Cursor for cursor-based pagination. Mutually exclusive with page.

  • --sort-by"time_start"

    The field to sort results by.

  • --sort-order"ASC" | "DESC"

    The order to sort results.

  • --fromstring

    Start time for the query in ISO 8601 format.

  • --tostring

    End time for the query in ISO 8601 format.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex warp-change-events

List Cloudflare One Client configuration changes and on/off toggle events by device.

zero-trust dex warp-change-events list

List WARP configuration and enablement toggle change events by device.

cf zero-trust dex warp-change-events list [options]
  • --pagenumber required

    Page number of paginated results.

  • --per-pagenumber required

    Number of results per page.

  • --fromstring required

    Start time for the query in ISO (RFC3339 - ISO 8601) format.

  • --tostring required

    End time for the query in ISO (RFC3339 - ISO 8601) format.

  • --type"config" | "toggle"

    Filter events by type 'config' or 'toggle'.

  • --toggle"on" | "off"

    Filter events by type toggle value. Applicable to type='toggle' events only.

  • --config-namestring

    Filter events by WARP configuration name changed from or to. Applicable to type='config' events only.

  • --account-namestring

    Filter events by account name.

  • --sort-order"ASC" | "DESC"

    Sort response by event timestamp.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dex colos

List Cloudflare data centers, sorted by how many of your devices connected to each during a time period. Data centers without traffic are listed after them alphabetically.

zero-trust dex colos list

List Cloudflare colos that account's devices were connected to during a time period, sorted by usage starting from the most used colo. Colos without traffic are also returned and sorted alphabetically.

cf zero-trust dex colos list [options]
  • --fromstring required

    Start time for connection period in ISO (RFC3339 - ISO 8601) format.

  • --tostring required

    End time for connection period in ISO (RFC3339 - ISO 8601) format.

  • --sort-by"fleet-status-usage" | "application-tests-usage"

    Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

Was this helpful?