Skip to main content

▶️ Run

The run command executes requests stored in your Fetch Client data directory. Depending on the options you use, you can run:

  • A single request
  • Every request in a folder
  • Every request in a collection
  • Every request in every collection
  • A raw cURL command

While it runs, Fetch Client CLI automatically:

  • Resolves variables
  • Runs any configured Pre-Requests
  • Sends the HTTP request
  • Runs Tests
  • Shows the result
  • Generates reports (optional)

💻 Syntax

fc-cli run [options]

⚙️ Options

OptionWhat it does
--reqRun a request
--folRun a folder
--colRun a collection
--curlRun a raw cURL command
--nameFind the resource by name
--idFind the resource by ID
--allRun every collection/folder
--var-idOverride the Variable Set by id
--var-nameOverride the Variable Set by name
--exportExport the run results
--export-pathFolder where reports get saved
Simplified syntax

The CLI supports a simplified syntax where names or IDs can be passed directly after --req, --fol, --col, and --var.

For example:

fc-cli run --req "Get Users"
fc-cli run --col "Regression Tests"
fc-cli run --var "QA Variables"

The legacy options (--name and --id) are still fully supported for backward compatibility.

📖 Run Commands

ActionPreferred commandLegacy command
Run a request by namefc-cli run --req "Get Users"fc-cli run --req --name "Get Users"
Run a request by IDfc-cli run --req <request-id>fc-cli run --req --id <request-id>
Run a folder by namefc-cli run --fol "Authentication"fc-cli run --fol --name "Authentication"
Run a folder by IDfc-cli run --fol <folder-id>fc-cli run --fol --id <folder-id>
Run a collection by namefc-cli run --col "Regression Tests"fc-cli run --col --name "Regression Tests"
Run a collection by IDfc-cli run --col <collection-id>fc-cli run --col --id <collection-id>
Run every collectionfc-cli run --col --allSame
Run an exported collectionfc-cli run --file collection.jsonSame
Run a folder from an exported collectionfc-cli run --file collection.json --fol "Authentication"fc-cli run --file collection.json --fol --name "Authentication"
Run a folder by ID from an exported collectionfc-cli run --file collection.json --fol <folder-id>fc-cli run --file collection.json --fol --id <folder-id>
Run a request from an exported collectionfc-cli run --file collection.json --req "Login"fc-cli run --file collection.json --req --name "Login"
Run a request by ID from an exported collectionfc-cli run --file collection.json --req <request-id>fc-cli run --file collection.json --req --id <request-id>
Override variables for an exported collectionfc-cli run --file collection.json --var-file variables.jsonSame
Run a raw cURL commandfc-cli run --curl "curl https://api.example.com/users"Same
Override Variable Set by namefc-cli run --req "Login" --var "QA Variables"fc-cli run --req --name "Login" --var-name "QA Variables"
Override Variable Set by IDfc-cli run --req "Login" --var <variable-set-id>fc-cli run --req --name "Login" --var-id <variable-set-id>
Export an HTML reportfc-cli run --col "Regression Tests" --export htmlfc-cli run --col --name "Regression Tests" --export html
Export a JSON reportfc-cli run --col "Regression Tests" --export jsonfc-cli run --col --name "Regression Tests" --export json
Export an XML reportfc-cli run --col --all --export xmlSame
Export to a custom folderfc-cli run --col --all --export json --export-path "./reports"Same

📨 Run a Request

Run a single request by name or ID.

ActionPreferredLegacy (still supported)
Run by namefc-cli run --req "Get Users"fc-cli run --req --name "Get Users"
Run by IDfc-cli run --req <request-id>fc-cli run --req --id <request-id>

fc-cli run request

📂 Run a Folder

Run every request in a folder.

ActionPreferredLegacy (still supported)
Run by namefc-cli run --fol "Authentication"fc-cli run --fol --name "Authentication"
Run by IDfc-cli run --fol <folder-id>fc-cli run --fol --id <folder-id>

fc-cli run folder

Requests run sequentially, in the same order they appear in the Fetch Client extension.


📚 Run a Collection

Run every request in a collection.

ActionPreferredLegacy (still supported)
Run by namefc-cli run --col "Regression Tests"fc-cli run --col --name "Regression Tests"
Run by IDfc-cli run --col <collection-id>fc-cli run --col --id <collection-id>

fc-cli run collection

🚀 Run All Collections

Run every request across every collection.

fc-cli run --col --all

📦 Run an Exported Collection

Fetch Client CLI can execute an exported collection JSON file directly.

This mode does not require the Fetch Client database or the VS Code extension. Simply share the exported collection and run it anywhere the CLI is installed.

Database-free execution

Running an exported collection is completely self-contained.

  • ✅ No Fetch Client database required
  • ✅ No VS Code extension required
  • ✅ Perfect for CI/CD pipelines
  • ✅ Easy to share with teammates
  • ✅ Great for running APIs on build agents or remote machines

Collection

fc-cli run --file collection.json

Folder

ActionPreferredLegacy (still supported)
Run by namefc-cli run --file collection.json --fol "Authentication"fc-cli run --file collection.json --fol --name "Authentication"
Run by IDfc-cli run --file collection.json --fol <folder-id>fc-cli run --file collection.json --fol --id <folder-id>

Request

ActionPreferredLegacy (still supported)
Run by namefc-cli run --file collection.json --req "Login"fc-cli run --file collection.json --req --name "Login"
Run by IDfc-cli run --file collection.json --req <request-id>fc-cli run --file collection.json --req --id <request-id>

Override Variables

Replace the embedded variables using another exported Variable Set.

ActionCommand
Override collection variablesfc-cli run --file collection.json --var-file variables.json
Override folder variablesfc-cli run --file collection.json --fol "Authentication" --var-file variables.json
Override request variablesfc-cli run --file collection.json --req "Login" --var-file variables.json
info

When using --file, the CLI loads everything from the exported files.

Database-based options such as --var, --var-id, and --var-name are not supported. Use --var-file instead.


🌐 Run a Raw cURL Command

Run a raw cURL command without importing it into Fetch Client first.

fc-cli run --curl "curl https://api.example.com/users"

🔄 Override the Variable Set

By default, requests use the Variable Set linked to the collection. You can temporarily override it when running a request, folder, or collection.

Request

ActionPreferredLegacy (still supported)
Variable Set by namefc-cli run --req "Login" --var "QA Variables"fc-cli run --req --name "Login" --var-name "QA Variables"
Variable Set by IDfc-cli run --req "Login" --var <variable-set-id>fc-cli run --req --name "Login" --var-id <variable-set-id>

Folder

ActionPreferredLegacy (still supported)
Variable Set by namefc-cli run --fol "Authentication" --var "QA Variables"fc-cli run --fol --name "Authentication" --var-name "QA Variables"
Variable Set by IDfc-cli run --fol "Authentication" --var <variable-set-id>fc-cli run --fol --name "Authentication" --var-id <variable-set-id>

Collection

ActionPreferredLegacy (still supported)
Variable Set by namefc-cli run --col "Regression Tests" --var "QA Variables"fc-cli run --col --name "Regression Tests" --var-name "QA Variables"
Variable Set by IDfc-cli run --col "Regression Tests" --var <variable-set-id>fc-cli run --col --name "Regression Tests" --var-id <variable-set-id>
Variable Set Priority

If a collection already has a linked Variable Set, that linked Variable Set always takes precedence.

In this case, --var, --var-id, and --var-name are ignored, and the CLI displays an informational message.


🔗 Pre-Requests

If a request has one or more Pre-Requests configured, Fetch Client CLI executes them automatically before the main request.

Common use cases include:

  • Authenticating users
  • Generating access tokens
  • Preparing test data
  • Executing dependent requests

No additional command-line options are required.

fc-cli pre-requests


✅ Tests

After each request completes, Fetch Client CLI automatically executes any configured Tests and displays the results.

fc-cli tests


📊 Export Reports

Use the --export option to generate a report after execution completes.

Supported formats

  • HTML
  • JSON
  • CSV
  • XML
  • NUnit

Export Examples

ActionPreferredLegacy (still supported)
Export a request reportfc-cli run --req "Login" --export htmlfc-cli run --req --name "Login" --export html
Export a collection reportfc-cli run --col "Regression Tests" --export jsonfc-cli run --col --name "Regression Tests" --export json
Export all collectionsfc-cli run --col --all --export xmlSame
Export an exported collectionfc-cli run --file collection.json --export htmlSame
Export a folder from an exported collectionfc-cli run --file collection.json --fol "Authentication" --export jsonfc-cli run --file collection.json --fol --name "Authentication" --export json
Export a request from an exported collectionfc-cli run --file collection.json --req "Login" --export xmlfc-cli run --file collection.json --req --name "Login" --export xml

📁 Export to a Custom Folder

Use --export-path to specify where reports are saved.

ActionCommand
Export all collectionsfc-cli run --col --all --export json --export-path "./reports"
Export an exported collectionfc-cli run --file collection.json --export html --export-path "./reports"
info

--export-path must point to an existing directory.

If omitted, reports are saved to the fetch-client-exports folder located alongside your Fetch Client data directory.


🔄 Backward Compatibility

The simplified syntax is recommended for all new commands and scripts.

For compatibility with existing automation and CI/CD pipelines, the legacy options continue to be fully supported.

PreferredLegacy
--req "Login"--req --name "Login"
--req <request-id>--req --id <request-id>
--fol "Authentication"--fol --name "Authentication"
--fol <folder-id>--fol --id <folder-id>
--col "Regression Tests"--col --name "Regression Tests"
--col <collection-id>--col --id <collection-id>
--var "QA Variables"--var-name "QA Variables"
--var <variable-set-id>--var-id <variable-set-id>