Using TFML files with Testfully CLI
Starting from version 1.23.0 (released on April 1st, 2026), Testfully CLI has native support for Testfully Markup Language (TFML) files, meaning you can pass your TFML files directly to Testfully CLI commands without needing to convert them to a different format.
Running a collection defined in a TFML file using Testfully CLI
One of the most common use cases for using TFML files with Testfully CLI is to run a collection of API requests defined in a TFML file. To do this, you can point your Testfully CLI command to the directory containing your TFML files, or to a specific TFML file.
Example: Running a collection defined in a TFML file
Assuming you have a collection of API requests in a directory called rick_and_morty, you can run the collection using the following command:
testfully run rick_and_mortyExample: Running a specific request defined in a TFML file
Assuming you have a request defined in a TFML file called get_character.tfml, you can run the request using the following command:
testfully run get_character.tfmlExample: Running multiple requests defined in TFML files
Assuming you have two requests defined in TFML files called get_character.tfml and get_location.tfml, you can run both requests using the following command:
testfully run get_character.tfml get_location.tfmlPassing a collection of global variables defined in a TFML file to Testfully CLI
Testfully CLI's support for TFML files goes beyond just running collections and requests. You can also define a collection of global variables in a TFML file and pass it to Testfully CLI to use those variables in your API requests. To do this, you can use the --globals flag followed by the path to your TFML file containing the global variables.
Below is an example of how to pass a collection of global variables defined in a TFML file to Testfully CLI:
testfully run --globals globals.tfml -- rick_and_mortyTo learn more about how to define global variables in a TFML file, check out the How to store metadata of globals in TFML page.
Passing environment variables defined in a TFML file to Testfully CLI
In addition to global variables, you can also define environment variables in a TFML file and pass it to Testfully CLI using the --environment flag. This allows you to manage your environment variables in a TFML file and use them in your API requests when running them with Testfully CLI.
Below is an example of how to pass environment variables defined in a TFML file to Testfully CLI:
testfully run --environment production.tfml -- rick_and_mortyPassing a workspace defined in a TFML file to Testfully CLI
Testfully CLI also supports passing a workspace defined in a TFML file for running all the collections, folders and requests defined in that workspace. To do this, you will need to pass the path to the workspace directory containing the TFML files to the testfully run command. Testfully CLI will automatically detect the TFML files in the directory and run all the collections, folders and requests defined in those files.
Below is an example of how to pass a workspace defined in a TFML file to Testfully CLI:
testfully run rick_and_morty_workspaceIn the above example, rick_and_morty_workspace is a directory containing TFML files that define collections, folders, requests, environments, globals, cookies, certificates and more. When you run the command, Testfully CLI will execute all the API requests defined in those TFML files.