CLI Tool
Flakiness.io project maintains an official flakiness CLI tool to work with Flakiness Reports.
Installation
Section titled “Installation”Flakiness CLI tool can be installed on any platform:
Install the flakiness CLI using the installation script:
curl -LsSf https://cli.flakiness.io/install.sh | shInstall the flakiness CLI using PowerShell:
pwsh -c "irm https://cli.flakiness.io/install.ps1 | iex"Install the flakiness CLI using NPM:
npm i -g flakinessViewing Reports
Section titled “Viewing Reports”To view locally saved Flakiness report, run:
flakiness showThe command will:
- Start a local server serving the report
- Automatically open the report in your default browser
- Display the URL where the report is accessible
Press Ctrl+C to stop the server.
Example:
flakiness showflakiness show ./fkrun-123Linking
Section titled “Linking”Local Git checkout can be linked to a Flakiness.io project. In this case, local reports will be shown together with the cloud analytics from Flakiness.io.
To link local project checkout to Flakiness.io project:
- Navigate to the root of your project checkout on the file system
- Run the
linkcommand with the URL of the flakiness.io project. For example:Terminal window flakiness link https://flakiness.io/flakiness/pytest-flakiness
Upload Reports
Section titled “Upload Reports”Upload a Flakiness report to the flakiness.io service:
flakiness upload <relative-paths...>Options:
<relative-paths...>- Paths to the Flakiness report files (typicallyreport.json)-t, --access-token <token>- A read-write flakiness.io access token (can also be set viaFLAKINESS_ACCESS_TOKENenvironment variable)-e, --endpoint <url>- An endpoint where the service is deployed (can also be set viaFLAKINESS_ENDPOINTenvironment variable, defaults tohttps://flakiness.io)
The access token is typically auto-detected from your login session and project link, so you usually don’t need to provide it manually.
Example:
flakiness upload ./flakiness-report/report.jsonDownload Reports
Section titled “Download Reports”Download Flakiness reports from the flakiness.io service:
flakiness downloadOptions:
--run-id <runId>- Download a specific run by its ID--since <date>- Download all runs uploaded since the specified date-j, --parallel <number>- Number of parallel downloads (default: 1)
Examples:
# Download a specific runflakiness download --run-id 123
# Download all runs since a dateflakiness download --since 2024-01-01
# Download with parallel processingflakiness download --since 2024-01-01 --parallel 4Downloaded reports are saved to fkrun-<runId>/ directories, each containing:
report.json- The Flakiness report fileattachments/- Directory with all attachments (if any)
Command Reference
Section titled “Command Reference”The full list of commands and options is available via the command’s help option:
flakiness --help