Skip to main content
Watchfire
Commands
Main content

watchfire workflow

watchfire workflow shows or changes how a project's sessions branch, where they work and how they finish — finish action, base ref, branch template, remotes, worktree location and parallel lanes.

Show or change how a project's sessions branch, where they work and how they finish.

Usage

watchfire workflow [flags]

Without flags, it prints the current settings. With flags, it changes exactly the settings named and leaves the rest alone.

watchfire workflow --finish pr --base upstream/main
watchfire workflow --push-remote fork --pr-base elastic/kibana
watchfire workflow --setup "yarn kbn bootstrap" --max-parallel 3

The same settings are in the Workflow section of project settings in the GUI.

Flags

Flagproject.yaml keyDescription
--finish <action>finish_actionWhat to do with finished work: ask, pr, push, merge, keep_branch or keep_worktree. Empty means the legacy auto-merge settings.
--pr-draftpr_draftOpen pull requests as drafts.
--base <ref>base_refRef new branches start from, for example upstream/main. It is fetched first. Empty means the current HEAD.
--branch-template <template>branch_templateBranch name template. Placeholders: {number}, {slug}, {issue}, {id}. Default: watchfire/{number}-{slug}.
--push-remote <remote>push_remoteRemote branches are pushed to. Default: origin.
--pr-base <owner/name>pr_base_repoRepository pull requests target. Default: the push remote's repository.
--pr-base-branch <branch>pr_base_branchBranch pull requests target. Default: derived from --base, else the default branch.
--worktree-root <dir>worktree_rootDirectory worktrees are created under. Default: <project>/.watchfire/worktrees.
--setup <command>setup_commandCommand run once in each new worktree, before the agent starts.
--max-parallel <n>max_parallelSessions watchfire run all uses by default. 0 or 1 means one at a time.
--resetClear every workflow setting, returning the project to its v10 behavior.

Finish actions

ActionWhat happens
askKeep the branch and worktree and wait for watchfire session finish.
prCommit, push, open a pull request.
pushCommit and push the branch.
mergeMerge into the branch checked out in the project.
keep_branchCommit, remove the worktree, keep the branch.
keep_worktreeCommit and leave everything in place.

discard is not a project default. It is only applied when you choose it for a specific session.

With no workflow setting at all, a project behaves exactly as in v10: finished tasks follow auto_merge and auto_delete_branch.

Example: contributing through a fork

watchfire workflow \
  --finish pr \
  --base upstream/main \
  --push-remote fork \
  --pr-base elastic/kibana \
  --branch-template "fix/{issue}-{slug}"

New branches start from upstream/main, are pushed to your fork remote, and finish as pull requests against elastic/kibana. watchfire init --work-repo applies a similar preset when you first set a project up.

On this page