@@ -28,12 +28,35 @@ const defaultTaskAPIPort = 8120
2828
2929var taskCmd = & cobra.Command {
3030 Use : "tasks" ,
31- Short : "Task commands " ,
31+ Short : "Manage tasks " ,
3232}
3333
3434var taskDevCmd = & cobra.Command {
35- Use : "dev" ,
36- Short : "Start a task in development mode" ,
35+ Use : "dev -- <command to start a workflow service>" ,
36+ Short : "Start a workflow service in development mode" ,
37+ Long : `Start a workflow service in development mode for local testing.
38+
39+ This command runs your workflow service locally on port 8120, allowing you to list and run
40+ tasks without deploying to Render. Task runs and their logs are stored in memory, so you
41+ can query them after tasks complete.
42+
43+ The command will spawn a new subprocess with your specified command whenever it needs to
44+ run a task or list the defined tasks.
45+
46+ To interact with the local task server:
47+ • Use the --local flag with other task commands (e.g., 'render tasks list --local')
48+ • Or set RENDER_USE_LOCAL_DEV=true when using the workflow client SDK
49+
50+ To use a different port:
51+ • Specify --port when starting the dev server
52+ • Then use --port with other task commands, or set RENDER_LOCAL_DEV_URL in the SDK
53+
54+ Examples:
55+ render ea tasks dev -- "go run main.go"
56+ render ea tasks dev --port 9000 -- "npm start"
57+ render ea tasks list --local
58+ render ea taskruns start my-task --local --input='["arg1"]'
59+ ` ,
3760 RunE : func (cmd * cobra.Command , args []string ) error {
3861
3962 ctx := cmd .Context ()
@@ -81,11 +104,33 @@ var taskDevCmd = &cobra.Command{
81104 Args : cobra .MinimumNArgs (1 ),
82105}
83106
84- func NewTaskRunCmd (deps flows.WorkflowDeps ) * cobra.Command {
107+ func NewTaskRunStartCmd (deps flows.WorkflowDeps ) * cobra.Command {
85108 cmd := & cobra.Command {
86- Use : "run [taskID]" ,
87- Short : "Run a new task" ,
88- Args : cobra .MaximumNArgs (1 ),
109+ Use : "start [taskID] --input=<json>" ,
110+ Short : "Start a task run with the provided input" ,
111+ Long : `Start a task with the provided input.
112+
113+ You can specify the task by:
114+ • Task ID (e.g., tsk-1234)
115+ • Workflow slug and task name (e.g., my-workflow/my-task)
116+
117+ Input Format:
118+ The input should be a JSON array where each element is an argument to the task.
119+ For example, if your task takes two arguments, provide: ["arg1", "arg2"]
120+
121+ You can provide input via:
122+ • --input with inline JSON
123+ • --input-file with a path to a JSON file
124+
125+ In interactive mode, you will be prompted to select the task and provide the input.
126+
127+ Examples:
128+ render ea taskruns start tsk-1234 --input='["arg1", "arg2"]'
129+ render ea taskruns start my-workflow/my-task --input='[42, "hello"]'
130+ render ea taskruns start my-task --input-file=input.json
131+ render ea taskruns start my-task --local --input='["test"]'
132+ ` ,
133+ Args : cobra .MaximumNArgs (1 ),
89134 RunE : func (cmd * cobra.Command , args []string ) error {
90135 deps , local , err := getLocalDeps (cmd , deps )
91136 if err != nil {
@@ -124,7 +169,10 @@ func NewTaskRunCmd(deps flows.WorkflowDeps) *cobra.Command {
124169 },
125170 }
126171
127- cmd .Flags ().String ("input" , "" , "JSON input to pass to the task" )
172+ cmd .Flags ().String (
173+ "input" , "" ,
174+ "JSON array input to pass to the task (e.g., '[\" arg1\" , \" arg2\" ]')" ,
175+ )
128176 cmd .Flags ().String ("input-file" , "" , "File containing JSON input to pass to the task" )
129177 cmd .MarkFlagFilename ("input-file" )
130178
0 commit comments