Skip to content

Command Line Interface

The QType CLI lets you run applications, validate specifications, serve web interfaces, and generating resources.

Installation

The QType CLI is installed with the qtype package. Run commands with:

qtype [command] [options]

Global Options

--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
    Set the logging level (default: INFO)

Commands

run

Execute a QType application locally.

qtype run [options] spec

Arguments

  • spec - Path to the QType YAML spec file

Options

  • -f FLOW, --flow FLOW - The name of the flow to run. If not specified, runs the first flow found
  • -i INPUT, --input INPUT - JSON blob of input values for the flow (default: {})
  • -I INPUT_FILE, --input-file INPUT_FILE - Path to a file (e.g., CSV, JSON, Parquet) with input data for batch processing
  • -o OUTPUT, --output OUTPUT - Path to save output data. If input is a DataFrame, output will be saved as parquet. If single result, saved as JSON
  • --progress - Show progress bars during flow execution

Examples

Run a simple application:

qtype run app.qtype.yaml

Run with inline JSON inputs:

qtype run app.qtype.yaml -i '{"question": "What is AI?"}'

Run a specific flow:

qtype run app.qtype.yaml --flow process_data

Batch process data from a file:

qtype run app.qtype.yaml --input-file inputs.csv --output results.parquet

See Also


validate

Validate a QType YAML spec against the schema and semantic rules.

qtype validate [options] spec

Arguments

  • spec - Path to the QType YAML spec file

Options

  • -p, --print - Print the spec after validation (default: False)

Examples

Validate a specification:

qtype validate app.qtype.yaml

Validate and print the parsed spec:

qtype validate app.qtype.yaml --print

See Also


serve

Serve a web experience for a QType application with an interactive UI.

qtype serve [options] spec

Arguments

  • spec - Path to the QType YAML spec file

Options

  • -p PORT, --port PORT - Port to run the server on (default: 8080)
  • -H HOST, --host HOST - Host to bind the server to (default: 0.0.0.0)
  • --reload - Enable auto-reload on code changes (default: False)

Examples

Serve an application:

qtype serve app.qtype.yaml

Serve on a specific port:

qtype serve app.qtype.yaml --port 3000

Serve with auto-reload for development:

qtype serve app.qtype.yaml --reload

See Also


mcp

Start the QType Model Context Protocol (MCP) server for AI agent integration.

qtype mcp [options]

Options

  • -t TRANSPORT, --transport TRANSPORT - Transport protocol to use: stdio, sse, or streamable-http (default: stdio)
  • --host HOST - Host to bind to for HTTP/SSE transports (default: 0.0.0.0)
  • -p PORT, --port PORT - Port to bind to for HTTP/SSE transports (default: 8000)

Examples

Start MCP server with stdio transport (default, for local AI agents):

qtype mcp

Start with Server-Sent Events transport:

qtype mcp --transport sse --port 8000

Start with streamable HTTP transport on a specific host and port:

qtype mcp --transport streamable-http --host 127.0.0.1 --port 3000

Description

The MCP server exposes QType functionality to AI agents and assistants through the Model Context Protocol. It provides tools for:

  • Converting API specifications to QType tools
  • Converting Python modules to QType tools
  • Validating QType YAML specifications
  • Visualizing QType architectures
  • Accessing QType documentation and component schemas

The stdio transport is ideal for local AI agent integration, while SSE and streamable-http transports are suitable for network-based integrations.


visualize

Generate a visual diagram of your QType application architecture.

qtype visualize [options] spec

Arguments

  • spec - Path to the QType YAML file

Options

  • -o OUTPUT, --output OUTPUT - If provided, write the mermaid diagram to this file
  • -nd, --no-display - If set, don't display the diagram in a browser (default: False)

Examples

Visualize and open in browser:

qtype visualize app.qtype.yaml

Save to file without displaying:

qtype visualize app.qtype.yaml --output diagram.mmd --no-display

Generate and save diagram:

qtype visualize app.qtype.yaml --output architecture.mmd

See Also


convert

Create QType tool definitions from external sources.

qtype convert {module,api} [options]

Subcommands

convert module

Convert a Python module to QType tools format.

qtype convert module [options] module_path

Arguments:

  • module_path - Path to the Python module to convert

Options:

  • -o OUTPUT, --output OUTPUT - Output file path. If not specified, prints to stdout

Examples:

Convert a Python module:

qtype convert module myapp.utils --output tools.qtype.yaml

Print to stdout:

qtype convert module myapp.utils

See Also:

convert api

Convert an OpenAPI/Swagger specification to QType format.

qtype convert api [options] api_spec

Arguments:

  • api_spec - Path to the API specification file (supports local files or URLs)

Options:

  • -o OUTPUT, --output OUTPUT - Output file path. If not specified, prints to stdout

Examples:

Convert an OpenAPI spec:

qtype convert api spec.oas.yaml --output api_tools.qtype.yaml

Convert from a URL:

qtype convert api https://petstore3.swagger.io/api/v3/openapi.json --output petstore.qtype.yaml

See Also:


generate

Generate QType project resources (primarily for internal development).

qtype generate {commons,schema,dsl-docs,semantic-model} [options]

This command is primarily used for QType development and maintenance.

Subcommands

  • commons - Generates the commons library tools from tools.py
  • schema - Generates the JSON schema for the QType DSL from model.py
  • dsl-docs - Generates markdown documentation for the QType DSL classes from model.py
  • semantic-model - Generates the semantic model from QType DSL (See Contributing)

Exit Codes

  • 0 - Success
  • 1 - Error (validation failure, runtime error, etc.)