Skip to content

CLI

The Condor CLI is a powerful tool for testing APIs and automating workflows. This reference provides a detailed overview of the available commands and their options.

Command: condor

The main condor command provides access to all subcommands and flags.

Usage

Terminal window
condor [flags]
condor [command]

Flags

  • -h, --help: Display help information for Condor.
  • -v, --version: Show the current version of Condor.

Available Commands

  • completion: Generate autocompletion scripts for various shells.
  • convert: Convert collections from other formats (e.g., OpenAPI, Swagger) to Condor format.
  • format: Format your Condor files.
  • run: Run your tests.
  • repl: Start a basic expression REPL for Condor.
  • help: Display help information about any command.

Command: condor run

The condor run command is used to execute tests from a specified file or directory.

Usage

Terminal window
condor run [path] [flags]

Flags

  • -f, --format string: Output format. Options include:

    • pretty (default): User-friendly output with clear visuals.
    • debug: Detailed debug information.
    • json: Outputs results in JSON format for integrations.
    • events: Streams events in a structured format.

    Example:

    Terminal window
    condor run tests/ --format json
  • -l, --level string: Log verbosity level. Options include:

    • debug: Most detailed output for troubleshooting.
    • info: General information about the test run.
    • warn (default): Warnings and above.
    • error: Errors only.

    Example:

    Terminal window
    condor run tests/ --level debug

Command: condor repl

The condor repl command starts a basic interactive read-eval-print loop for evaluating expressions and testing Condor functions. This does not yet support evaluating test blocks, request blocks, or anything other than standard expressions.

Usage

Terminal window
condor repl [flags]

Flags

  • -h, --help: Display help information for the repl command.

Global Flags

  • -f, --format string: Output format (default: pretty).
  • -l, --level string: Log verbosity level (default: warn).

Examples:

Condor REPL Console
$ condor repl
condor> list::length(["a", "b", "c"])
3
condor> type::number("123.45")
123.45
condor> quit
Condor REPL Pipe
$ echo 'list::length(["a", "b", "c"])' | condor repl
3

Command: condor completion

The condor completion command generates autocompletion scripts for various shells.

Usage

Terminal window
condor completion [command]

Available Subcommands

  • bash: Generate an autocompletion script for Bash.
  • fish: Generate an autocompletion script for Fish.
  • powershell: Generate an autocompletion script for PowerShell.
  • zsh: Generate an autocompletion script for Zsh.

Flags

  • -h, --help: Display help information for the completion command.

Example:

Terminal window
condor completion bash > ~/.bash_completion
source ~/.bash_completion

Command: condor convert

The condor convert command converts collections from other formats (e.g., OpenAPI, Swagger) to Condor format.

Usage

Terminal window
condor convert source [destination dir:./collection/resources] [flags]

Flags

  • -h, --help: Display help information for the convert command.

Global Flags

  • -f, --format string: Output format (default: pretty).
  • -l, --level string: Log verbosity level (default: warn).

Example:

Terminal window
condor convert openapi.yaml ./collection/resources

Command: condor format

The condor format command formats Condor files to ensure consistency and readability.

Usage

Terminal window
condor format [path] [flags]

Flags

  • -c, --check: Check only, don’t write formatted files.
  • -h, --help: Display help information for the format command.

Global Flags

  • -f, --format string: Output format (default: pretty).
  • -l, --level string: Log verbosity level (default: warn).

Example:

Terminal window
condor format ./collection/tests --check

For more information about using the Condor CLI, refer to other sections of this documentation or the Writing Tests guide.