Skip to main content

PostQode CLI

A powerful command-line tool for running API test suites and converting API collection formats. Automate your API testing workflow with comprehensive reporting and format conversion capabilities.

🚀 Installation

Install globally via npm:

npm install -g @postqode/cli

Verify installation:

postqode -V

📖 Usage

Global Options

OptionDescription
-V, --versionOutput the CLI version
-v, --verboseEnable verbose output for debugging
-h, --helpDisplay help information

Commands

Execute Test Suites

Run API test suites with comprehensive reporting options:

postqode execute [options]

Options:

OptionDescriptionDefault
-s, --suite <file>Test suite file path (e.g. _meta.suite.yaml)Required
-w, --workspace <dir>Workspace directoryCurrent project directory
-c, --config <name>Run configuration name (profile for environment/settings)Default
--report-formats <formats>Report formats to generate (html, junit, overview)html
--report-dir <dir>Directory to save reportsCurrent directory

Examples:

# Run a test suite with default HTML report
postqode execute -s testSuites/MySuite/_meta.suite.yaml

# Run with multiple report formats
postqode execute -s testSuites/MySuite/_meta.suite.yaml --report-formats html junit

# Run with custom workspace and report directory
postqode execute -s testSuites/MySuite/_meta.suite.yaml -w /projects/myWorkspace --report-dir reports

Convert API Collections

Convert between OpenAPI, Postman Collections, and Postqode test formats:

postqode convert [options]

Options:

OptionDescriptionExample
-i, --input <file>Input file or URL (OpenAPI, Postman)openapi.yaml
-o, --output <file>Output filecollection.json

Examples:

# Convert OpenAPI to Postman Collection
postqode convert -i openapi.yaml -o collection.json

# Convert Postman Collection to Postqode Test Suite
postqode convert -i collection.json -o testSuites/MySuite/_meta.suite.yaml

🏗️ Example Workflow

  1. Convert OpenAPI to Test Suite:

    postqode convert -i openapi.yaml -o testSuites/MySuite/_meta.suite.yaml
  2. Execute test suite with reports:

    postqode execute -s testSuites/MySuite/_meta.suite.yaml --report-formats html junit
  3. Check generated reports in the /reports directory

🎯 Best Practices

  • ✅ Always use workspace (-w) to organize test suites
  • ✅ Use run configurations (-c) for different environments (e.g. Dev, QA, Prod)
  • ✅ Store test suites under testSuites/ with _meta.suite.yaml as entry points
  • ✅ Automate CLI execution inside CI/CD pipelines (e.g. Jenkins, GitHub Actions)

🔧 Troubleshooting

IssueSolution
Command not foundEnsure @postqode/cli is installed globally
Permission issuesUse sudo npm install -g @postqode/cli (Linux/macOS)
Invalid suite fileVerify _meta.suite.yaml structure

Next Steps