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:
Global Options¶
Commands¶
run¶
Execute a QType application locally.
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:
Run with inline JSON inputs:
Run a specific flow:
Batch process data from a file:
See Also¶
- How To: Pass Inputs On The CLI
- How To: Load Multiple Inputs from Files
- Tutorial: Your First QType Application
validate¶
Validate a QType YAML spec against the schema and semantic rules.
Arguments¶
spec- Path to the QType YAML spec file
Options¶
-p, --print- Print the spec after validation (default: False)
Examples¶
Validate a specification:
Validate and print the parsed spec:
See Also¶
serve¶
Serve a web experience for a QType application with an interactive UI.
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:
Serve on a specific port:
Serve with auto-reload for development:
See Also¶
- How To: Serve Flows as APIs
- How To: Serve Flows as UI
- How To: Use Conversational Interfaces
- How To: Serve Applications with Auto-Reload
- Tutorial: Building a Stateful Chatbot
mcp¶
Start the QType Model Context Protocol (MCP) server for AI agent integration.
Options¶
-t TRANSPORT, --transport TRANSPORT- Transport protocol to use:stdio,sse, orstreamable-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):
Start with Server-Sent Events transport:
Start with streamable HTTP transport on a specific host and port:
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.
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:
Save to file without displaying:
Generate and save diagram:
See Also¶
convert¶
Create QType tool definitions from external sources.
Subcommands¶
convert module¶
Convert a Python module to QType tools format.
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:
Print to stdout:
See Also:
convert api¶
Convert an OpenAPI/Swagger specification to QType format.
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:
Convert from a URL:
See Also:
generate¶
Generate QType project resources (primarily for internal development).
This command is primarily used for QType development and maintenance.
Subcommands¶
commons- Generates the commons library tools fromtools.pyschema- Generates the JSON schema for the QType DSL frommodel.pydsl-docs- Generates markdown documentation for the QType DSL classes frommodel.pysemantic-model- Generates the semantic model from QType DSL (See Contributing)
Exit Codes¶
- 0 - Success
- 1 - Error (validation failure, runtime error, etc.)