Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/root/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ func NewExecCmd() *cobra.Command {
cmd.PersistentFlags().StringVar(&workingDir, "working-dir", "", "Set the working directory for the session (applies to tools and relative paths)")
cmd.PersistentFlags().BoolVar(&autoApprove, "yolo", false, "Automatically approve all tool calls without prompting")
cmd.PersistentFlags().StringVar(&attachmentPath, "attach", "", "Attach an image file to the message")

cmd.PersistentFlags().BoolVar(&dryRun, "dry-run", false, "Initialize the agent without executing anything")
_ = cmd.PersistentFlags().MarkHidden("dry-run")

addGatewayFlags(cmd)

return cmd
Expand Down
6 changes: 6 additions & 0 deletions cmd/root/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var (
workingDir string
useTUI bool
remoteAddress string
dryRun bool
)

// NewRunCmd creates a new run command
Expand Down Expand Up @@ -251,6 +252,11 @@ func doRunCommand(ctx context.Context, args []string, exec bool) error {
} else {
execArgs = append(execArgs, "Follow the default instructions")
}

if dryRun {
fmt.Println("Dry run mode enabled. Agent initialized but will not execute.")
return nil
}
return runWithoutTUI(ctx, agentFilename, rt, sess, execArgs)
}

Expand Down