Run tasks directly with language-independent project tools
This commit is contained in:
+5
-8
@@ -65,9 +65,9 @@ func (a App) flags(command string) (*flag.FlagSet, *options) {
|
||||
f.StringVar(&o.name, "pipeline", "", "Exact registered pipeline name or ID")
|
||||
f.StringVar(&o.prompt, "prompt", "", "Task prompt; omitted opens a multiline composer")
|
||||
f.StringVar(&o.workspace, "workspace", "", "Run directory (default: current directory)")
|
||||
f.BoolVar(&o.yes, "yes", false, "Start supplied name/prompt without interactive confirmation")
|
||||
f.BoolVar(&o.allow, "allow-tools", false, "Explicitly approve declared shell/edit tools with --yes")
|
||||
f.StringVar(&o.paths, "write-paths", "", "Comma-separated exact existing project-local Go files")
|
||||
f.BoolVar(&o.yes, "yes", false, "Compatibility flag; supplied name/prompt already start immediately")
|
||||
f.BoolVar(&o.allow, "allow-tools", false, "Compatibility flag; stage-declared tools are enabled automatically")
|
||||
f.StringVar(&o.paths, "write-paths", "", "Optional narrower edit scope; default is all files in the run directory")
|
||||
f.StringVar(&o.key, "request-key", "", "Idempotency key (default: generated unique key)")
|
||||
f.IntVar(&o.version, "version", 0, "Version to run (default: latest)")
|
||||
f.BoolVar(&o.wait, "wait", false, "In JSON mode, wait for a terminal run state")
|
||||
@@ -614,9 +614,6 @@ func (a App) run(ctx context.Context, pos []string, o *options, call callFunc, r
|
||||
if o.yes && (o.name == "" || strings.TrimSpace(o.prompt) == "") {
|
||||
return fmt.Errorf("--yes requires a pipeline and nonempty prompt")
|
||||
}
|
||||
if o.yes && len(paths) > 0 && !o.allow {
|
||||
return fmt.Errorf("--write-paths with --yes requires --allow-tools")
|
||||
}
|
||||
if !o.json {
|
||||
if o.name != "" {
|
||||
p, err := resolve(o.name)
|
||||
@@ -631,8 +628,8 @@ func (a App) run(ctx context.Context, pos []string, o *options, call callFunc, r
|
||||
_, err := tea.NewProgram(tui.NewRun(ctx, o.url, tui.RunOptions{Pipeline: o.name, Prompt: o.prompt, Workspace: workspace, Yes: o.yes, AllowTools: o.allow, WritePaths: paths}), tea.WithContext(ctx), tea.WithAltScreen()).Run()
|
||||
return err
|
||||
}
|
||||
if !o.yes {
|
||||
return fmt.Errorf("noninteractive run requires --yes (tool approval remains separate)")
|
||||
if o.name == "" || strings.TrimSpace(o.prompt) == "" {
|
||||
return fmt.Errorf("run --json requires a pipeline and nonempty prompt")
|
||||
}
|
||||
p, err := resolve(o.name)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user