๐ Fetch Client CLI
Fetch Client CLI is a command-line tool. It lets you run requests, folders, and collections from the Fetch Client VS Code extension - without opening VS Code.
It is built for developers, testers and CI/CD pipelines. Use it when you need a fast, light and scriptable way to run API requests.
You can use Fetch Client CLI to test APIs during development, run automated tests, create reports, or run load tests. It gives you the same features as the extension, right from your terminal.
โ Why use Fetch Client CLI?โ
Many development workflows need API testing outside an IDE. Fetch Client CLI lets you:
- ๐ฅ๏ธ Cross-platform (Windows, macOS, and Linux)
- โถ๏ธ Run requests, folders, collections, all collections, or exported collections
- ๐ฆ Execute exported collections without requiring the Fetch Client database
- โก Performance testing with configurable virtual users and load models
- ๐ Data-driven testing using CSV or JSON data files
- ๐งช Execute API tests and validate responses
- ๐ฆ Execute exported collections without requiring the Fetch Client database
- ๐ Automatically execute Pre-Requests
- โ๏ธ Configure and override variable sets
- ๐ Import and execute raw cURL commands
- ๐ Generate JSON, XML, HTML, CSV, and NUnit reports
- ๐ค CI/CD friendly with appropriate exit codes
- ๐ Lightweight with no additional server or services required
You don't need separate collections for your IDE and your automation. The CLI works directly with your existing Fetch Client database.
The CLI and the VS Code extension share the same database. Any change you make in one shows up in the other right away.
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
โจ Key Featuresโ
| Feature | What it does |
|---|---|
| Run Requests | Runs a single request |
| Run Folders | Runs every request inside a folder |
| Run Collections | Runs an entire collection |
| Run Exported Collections | Executes requests directly from exported collection JSON files |
| Variables | Use global, collection, and environment variables |
| Pre-Requests | Runs dependent (PreFetch) requests automatically before the main request |
| Tests | Validates API responses using test assertions |
| Performance Testing | Load test requests, folders, and collections with configurable virtual users |
| Data-Driven Testing | Execute requests repeatedly using CSV or JSON data files |
| Report Export | Export reports in JSON, CSV, HTML, XML, and NUnit formats |
| cURL Support | Execute raw cURL commands directly from the CLI |
| CI/CD Support | Works with GitHub Actions, Azure DevOps, Jenkins, GitLab CI, and more |
| Cross Platform | Runs on Windows, macOS, and Linux |
โ๏ธ How It Worksโ
The CLI reads the same database as the VS Code extension. This means you can switch between the two anytime - nothing needs to be copied or re-created.
+----------------------+
| Fetch Client |
| VS Code Extension |
+----------+-----------+
|
Shared Database Files
|
+------------------+------------------+
| |
+-----------v-----------+ +----------v-----------+
| Fetch Client CLI | | VS Code Extension |
| | | |
| Run Requests | | Create Requests |
| Run Collections | | Edit Requests |
| Run Performance Tests | | Manage Variables |
| Generate Reports | | Organize Collections |
+------------------------+ +-----------------------+
๐ A Typical Workflowโ
- Create requests in the Fetch Client VS Code extension.
- Organize them into folders and collections.
- Set up variables and environments.
- Test requests interactively.
- Run the same collection with Fetch Client CLI.
- Generate a report.
- Add the CLI to your CI/CD pipeline.
Create Request โ Configure Variables โ Link Pre-Requests โ Add Tests โ Run Using fc-cli โ Generate Report