k6 inspect
Inspect a script or archive and output its configuration as JSON.Synopsis
Description
Thek6 inspect command analyzes a k6 test script or archive and outputs its configuration in JSON format. This is useful for:
- Understanding what options are configured in a script
- Debugging configuration issues
- Validating test configuration before execution
- Calculating execution requirements
Arguments
Path to the script file or archive to inspect
Examples
Flags
Include calculations of execution requirements for the test. This adds:
totalDuration- The total expected duration of the testmaxVUs- The maximum number of VUs that will be used
Runtime Options
The following runtime option flags are also available:Add/override environment variable with
VAR=valuePass the real system environment variables to the runtime
JavaScript compatibility mode:
extended or baseOverride test type:
js or archiveOutput Format
Standard Output
The standard output contains the test’slib.Options structure:
Extended Output (with —execution-requirements)
With the--execution-requirements flag, additional fields are included:
Use Cases
Pre-flight Validation
Validate your test configuration before running:Configuration Debugging
Check how options from different sources are merged:Capacity Planning
Calculate resource requirements:Exit Codes
0- Inspection successful- Non-zero - Error occurred (invalid script, parsing error, etc.)
See Also
- k6 run - Run a test
- k6 archive - Create an archive
- Configuration file format