CLI Command & Reference
The Gherkio Command Line Interface (CLI) is the central orchestration tool for validating project settings, starting testing suites, generating reports, and exporting cURL workflows.
🏃 Execution Rules & File Resolution
When executing gherkio run <target>, Gherkio resolves the target pathway under the following rules:
- Directories: If
<target>is a folder, Gherkio recursively scans all child files ending in.yamlor.ymlunder the folder, executing them sequentially or concurrently. - Single Files: If
<target>points directly to a YAML file, Gherkio executes only that single file. - Workspace Discovery: Gherkio looks for a
.gherkio/config.yamlfile in the current working directory, then bubbles up parent directories until one is found. If no.gherkioworkspace folder is detected, Gherkio errors and prompts you to rungherkio init.
🚦 Exit Status Codes
Gherkio follows standard POSIX process exit boundaries to ensure perfect compatibility with CI/CD platforms (GitHub Actions, GitLab CI, Jenkins):
0: Success. All executed test scenarios passed, validation checks returned no warnings, or conversions completed successfully.1: Failure / Error. At least one step failed validation, an API returned a status/body mismatch, a syntax error was detected in your YAML files, or a microservice connection timed out.
🖥️ Print Output Modes
Modify how Gherkio logs information to terminal windows during execution using stdout flags:
- Default (Clean): Prints structured step checks, colorized status ticks (
✔/❌), and execution durations per step. - Verbose (
--verbose/-v): Outputs the exact request URL, method, serialized payload body, headers, along with the full response body/headers from the target host. Dynamic credentials and keys are automatically masked. - Quiet (
--quiet/-q): Suppresses standard output entirely, returning only the final summary block and process exit status code.
📚 Commands Map
| Command | Link | Description |
|---|---|---|
gherkio | gherkio | Root command showing general usage and flags. |
gherkio init | gherkio init | Scaffolds a new Gherkio workspace .gherkio/. |
gherkio run | gherkio run | Executes declarative test scenarios locally or in CI. |
gherkio convert | gherkio convert | Translates raw cURL statements ⇄ Gherkio YAML step formats. |
gherkio validate | gherkio validate | Performs static analysis checking on syntax, credentials, and schemas. |
gherkio schema | gherkio schema | Auto-generates Draft-07 JSON Schema for editor auto-completions. |
gherkio mcp | gherkio mcp | Launches stdio Model Context Protocol (MCP) JSON-RPC communication. |