syncweaver contribute

Contribute a patch that was created in a host repository back to the upstream source repository as a pull request. The command clones the source, applies the patch to a new branch, pushes it, and opens a PR — all without leaving the host repository directory.

Usage

Usage: syncweaver contribute [OPTIONS]

  Contribute a tracked host patch back to the source repository.

  Clones the source repository, applies the patch to a new branch, pushes it,
  and opens a pull request.  Runs from the host repository directory.

Options:
  --path TEXT               Tracked source path in the host repository, e.g.
                            code/package1. Resolved automatically from
                            lockfile when not provided.
  --repo-url TEXT           Source repository URL or OWNER/REPO shorthand.
                            Used to disambiguate when multiple sources are
                            tracked.
  --source-repository TEXT  Source repository in OWNER/REPO format. Derived
                            from lockfile repo_url when not provided.
  --patch PATH              Path to the patch file to contribute. Resolved
                            from lockfile patch entry when not provided.
  --base-ref TEXT           Base branch or ref in the source repository to
                            target. Defaults to lockfile ref when not
                            provided.
  --lockfile PATH           Path to .syncweaver-lock.json in the host
                            repository.  [default: .syncweaver-lock.json]
  --token TEXT              GitHub token with push access to the source
                            repository. May also be set via the GITHUB_TOKEN
                            environment variable or resolved from `gh auth
                            token` when not provided.
  --run-id TEXT             Optional identifier appended to the branch name
                            for uniqueness.
  --debug                   Print resolved metadata and verbose git output.
  -h, --help                Show this message and exit.

Examples

# Contribute the patch for a tracked path (lockfile auto-resolved)
syncweaver contribute --path code/mypackage

# Specify source repo and patch file explicitly
syncweaver contribute \
  --path code/mypackage \
  --source-repository OWNER/mypackage \
  --patch patches/mypackage.patch \
  --base-ref main

# Pass a token directly (or set GITHUB_TOKEN in env)
syncweaver contribute \
  --path code/mypackage \
  --token "$GITHUB_TOKEN"