CLI
The Chorey CLI provides a simple interface to execute any defined pipeline directly from the command line, enabling quick testing and operational use. The CLI uses typer
for command definition and is executed via the chorey
command.
chorey run
Executes a specified pipeline with a provided input value.
Syntax
Arguments and Options
Component | Type | Description |
---|---|---|
<pipeline_path> |
str |
The Python import path to the pipeline object (e.g., my_module.submodule:pipeline ). |
--input , -i |
str |
The input value to feed to the pipeline's first step. This value is automatically converted to the expected input type. |
Execution and Type Conversion
- Import: The Python object specified by
<pipeline_path>
is imported and verified as a validStep
. - Type Inspection: The framework inspects the pipeline to determine the required input type for its very first step (FirstInputType).
- Input Parsing: The value provided via
--input
(which is always a string) is passed to the internalparse_cli_input
utility. This utility attempts to convert the string into the required FirstInputType. - Primitives: Simple types like
str
,int
, orbool
are handled directly. - Complex Types: For
dataclass
, Pydantic models, or complex nested types, the input string is treated as a JSON payload. (Note: If you need custom parsing logic, consider using Pydantic models for your first step's input.) - Execution: The pipeline is executed asynchronously using
asyncio.run()
. - Output: The final result of the pipeline is printed to standard output.
Input Examples
First Step Input Type | CLI Input | Notes |
---|---|---|
int |
42 |
Direct integer input. |
str |
"Hello, World!" |
Direct string input. |
bool |
0 or 1 |
Boolean input (0 for False , 1 for True ). |
dict |
'{"key": "value", "number": 123}' |
Must be valid JSON string. |
Pydantic model | '{"name": "Alice", "age": 30}' |
JSON string matching the model schema. |
Limitations
ChoreyContext
cannot be used as of now.
chorey mermaid
Generates and prints the Mermaid diagram representation of a specified pipeline.
Syntax
Arguments
Component | Type | Description |
---|---|---|
<pipeline_path> |
str |
The Python import path to the pipeline object (e.g., my_module.submodule:pipeline ). |
Execution
- Import: The Python object specified by
<pipeline_path>
is imported and verified as a validStep
. - Diagram Generation: The framework generates the Mermaid diagram representation of the pipeline using the
mermaid()
method. - Output: The Mermaid diagram is printed to standard output.