@@ -125,15 +125,30 @@ def init(pipeline_step_path):
125125 default = False ,
126126 help = 'Keep the Docker image after the pipeline step finishes.' ,
127127)
128- def local_run (pipeline_step_path , mode , keep_image ):
128+ @click .option (
129+ '--step-args' ,
130+ default = None ,
131+ help = 'Arguments to pass to pipeline_step.py (e.g., "--param_a hello --param_b world").' ,
132+ )
133+ def local_run (pipeline_step_path , mode , keep_image , step_args ):
129134 """Run a pipeline step locally in a Docker container.
130135
136+ \b
131137 PIPELINE_STEP_PATH: Path to the pipeline step directory (containing config.yaml,
132138 requirements.txt, and 1/pipeline_step.py). Defaults to current directory.
133139
140+ \b
141+ Pass arguments to the step script via --step-args:
142+ clarifai pipelinestep local-run ./my-step --step-args "--param_a hello --param_b world"
143+
134144 This reuses the same Docker build infrastructure as ``clarifai model serve
135145 --mode container`` but executes pipeline_step.py once and exits.
136146 """
147+ # Parse step-args string into a list
148+ if step_args :
149+ import shlex
150+
151+ step_args = shlex .split (step_args )
137152 from clarifai .runners .pipeline_steps .pipeline_run_locally import PipelineStepRunLocally
138153
139154 manager = PipelineStepRunLocally (pipeline_step_path )
@@ -157,6 +172,7 @@ def local_run(pipeline_step_path, mode, keep_image):
157172 manager .run_pipeline_step_container (
158173 image_name = image_name ,
159174 container_name = container_name ,
175+ step_args = list (step_args ) if step_args else None ,
160176 )
161177 finally :
162178 if manager .container_exists (container_name ):
0 commit comments