Apidog CLI Options
Basic Apidog CLI syntax
apidog run --access-token <value> [options]
apidog run --access-token $APIDOG_ACCESS_TOKEN -t 637132 -e 358171 -d 3497013 -r html,cli --database-connection ./database-connections.json
apidog run <collection> [options]
apidog run examples/sample.apidog-cli.json -r cli,html
Options
Option | Description |
---|---|
--access-token <accessToken> | Set authentication token for online execution |
-t, --test-scenario <testScenarioId> | Specify test scenario ID to run |
-f, --test-scenario-folder <folderId> | Specify test scenario directory ID to run |
-r, --reporters [reporters] | Specify test report types (default: ["cli"]) |
--out-dir <outDir> | Output directory for test reports (default: "./apidog-reports") |
--out-file <outFile> | Output filename for test reports |
--out-json-failures-separated <outJsonFailuresSeparated> | Export failures as separate JSON file |
-e, --environment | Specify runtime environment |
-n, --iteration-count <n> | Set number of iterations |
-d, --iteration-data <path> | Set data for case iterations (JSON or CSV) |
--variables <path> | Environment/global variables using from files in the specified path, instead of use initial values of environment/global variables. |
--global-var <value> | Set global variables (key=value format) |
--env-var <value> | Set environment variables (key=value format) |
--external-program-path <path> | Specify file path for external programs |
--database-connection <path> | Specify file path for database configuration |
--ignore-redirects | Prevent automatic redirects |
--silent | Prevent console output |
--color <value> | Enable/disable colored console output |
--delay-request [n] | Specify delay between requests (ms) |
--timeout-request [n] | Specify request timeout (ms) |
--timeout-script [n] | Specify script execution timeout (ms) |
-k, --insecure | Disable SSL verification |
--ssl-client-cert-list <path> | Specify client certificate config path |
--ssl-client-cert <path> | Specify client certificate path (PEM) |
--ssl-client-key <path> | Specify client certificate private key path |
--ssl-client-passphrase <passphrase> | Specify client certificate passphrase |
--ssl-extra-ca-certs <path> | Specify additional trusted CA certificates |
-b, --bigint | Enable bigint compatibility |
--upload-report [value] | Upload test report overview to cloud |
--preferred-http-version <preferredHttpVersion> | Set preferred HTTP protocol version |
--verbose | Display detailed request and response information |
--lang <language> | Set CLI language (en) |
-h, --help | Display help information |
Uploading files in CLI
Copy the required file to the machine running the CLI beforehand.
Copy the file path on the CLI machine.
In the Apidog test scenario, locate the step details for the file upload request and click the "Batch Edit" button.
Replace the file field parameter value with the file path on the CLI machine(e.g., 
/opt/apidog/runner/yourfilename.jpg
).Using database operations in CLI
For test scenarios that include database operations, you'll see a prompt in the command line generation interface: "Download the database configuration file."
Download this file and place it in the directory where you plan to run the Apidog CLI.
The automatically generated command line will include the
--database-connection
option. You can use this command line as is to run your tests.Uploading local CLI test reports to the cloud
--upload-report
parameter at the end of your CLI command. Here's how to do it:Add the
--upload-report
parameter to your CLI command:apidog run --access-token $APIDOG_ACCESS_TOKEN -t 637132 -e 358171 -d 3497013 -r html,cli --upload-report
This command will run your tests and automatically upload the test report to the cloud after completion.
To view the uploaded report:Go to the "Test Reports" section in your Apidog dashboard. Look for the "Team Reports" column.
Note: For reports uploaded via CLI, the "Tester" field will be displayed as empty.
Using external scripts/programs in CLI
--external-program-path ./scripts
./scripts
directory. If no hierarchy is specified, the default is the current CLI execution directory.1.
To avoid confusion in managing local scripts, it's recommended to:
2.
Alternatively, you can:
SSL
Client certificate
Using single SSL client certificate
--ssl-client-cert
Specify the path of the public SSL client certificate.
--ssl-client-key
Specify the path of the private SSL client certificate (optional).
--ssl-client-passphrase
Specify SSL client passphrase (optional).
Using SSL client certificates configuration file (supports multiple certificates)
--ssl-client-cert-list
Specify the path of the JSON file of the SSL client certificate list. For example:
ssl-client-cert-list.json
--ssl-client-cert
, --ssl-client-key
, and --ssl-client-passphrase
options. These options will be used as fallback options if there is no match for the URL in the list.HTTP/2
--preferred-http-version
parameter.1.
2.
3.
1.
--preferred-http-version="https=HTTP/2,http=HTTP/2-with-prior-knowledge"
2.
--preferred-http-version="HTTP/1"
3.
--preferred-http-version="HTTP/2"
FAQ
Invalid character in header content["Authorization"]
?Modified atΒ 2025-03-06 02:48:48