Introduction Thunder Client CLI
In 2021 we launched Thunder Client extension for VSCode which was a game changer, as we were the first to launch a GUI based API Client inside VSCode. Today we are launching Thunder Client CLI which will have many new innovative features for API Testing.
Key Features
- Simple & Easy to Use CLI tool
- Seamless Integration with Thunder Client Extension
- Run Requests/Collections and View Test results
- Syntax Highlighting and VSCode Themes
- Open Request/Collection UI from the terminal
- Enhances CURL commands
- CI/CD Integration
Installation
- Please update extension to latest version
- Install CLI -
npm i -g @thunderclient/cli
Note: If you are using Thunder Client settings
in extension, make sure they are workspace
scope for CLI to access them.
Run Requests
The CLI and Extension are integrated seamlessly, so you can access requests data from terminal without any additional configuration.
- To execute requests run
tc 'requestNameOrId'
, the request can be executed using id, name or partial name
As you can see in above image, executing request is very easy from CLI. The output is formatted beautifully with Status, Response with Syntax highlighting & VSCode theme, and Test results.
To Run the same request from UI requires multiple steps as below
- Open Sidebar
- Click Collections Tab
- Open collection User and folder Account
- Then open Welcome request
- Now execute the request
VSCode Themes In CLI
- We are bringing VSCode themes to the terminal for the first time.
Run Collection
Collection Runner will execute all the requests in collection and display output in a beautiful format similar to extension UI.
tc --col 'colNameOrId'
will run requests in collection from CLItc --fol 'colNameOrId'
will run requests in folder from CLI
Enhances Curl Commands
In the above we have seen how to run requests and collections easily from CLI. Thunder Client CLI also has integration with CURL commands, so you can use it to create requests from CLI.
Run Curl command by prefixing tc
and see the magic. By using Thunder Client CLI you will get following benefits over normal curl.
- Formatted Output
- Syntax Highlighting & VSCode Themes
- Request will be saved to your Activity Tab
Full Documentation
- Please read the blog post for complete documentation about CLI.
- https://medium.com/p/d91eb5c71d8e